Commit Graph

24849 Commits

Author SHA1 Message Date
Wen bfe44d95f4
Wen restart aggregate last voted fork slots (#33892)
* Push and aggregate RestartLastVotedForkSlots.

* Fix API and lint errors.

* Reduce clutter.

* Put my own LastVotedForkSlots into the aggregate.

* Write LastVotedForkSlots aggregate progress into local file.

* Fix typo and name constants.

* Fix flaky test.

* Clarify the comments.

* - Use constant for wait_for_supermajority
- Avoid waiting after first shred when repair is in wen_restart

* Fix delay_after_first_shred and remove loop in wen_restart.

* Read wen_restart slots inside the loop instead.

* Discard turbine shreds while in wen_restart in windows insert rather than
shred_fetch_stage.

* Use the new Gossip API.

* Rename slots_to_repair_for_wen_restart and a few others.

* Rename a few more and list all states.

* Pipe exit down to aggregate loop so we can exit early.

* Fix import of RestartLastVotedForkSlots.

* Use the new method to generate test bank.

* Make linter happy.

* Use new bank constructor for tests.

* Fix a bad merge.

* - add new const for wen_restart
- fix the test to cover more cases
- add generate_repairs_for_slot_not_throtted_by_tick and
  generate_repairs_for_slot_throtted_by_tick to make it readable

* Add initialize and put the main logic into a loop.

* Change aggregate interface and other fixes.

* Add failure tests and tests for state transition.

* Add more tests and add ability to recover from written records in
last_voted_fork_slots_aggregate.

* Various name changes.

* We don't really care what type of error is returned.

* Wait on expected progress message in proto file instead of sleep.

* Code reorganization and cleanup.

* Make linter happy.

* Add WenRestartError.

* Split WenRestartErrors into separate erros per state.

* Revert "Split WenRestartErrors into separate erros per state."

This reverts commit 4c920cb8f8d492707560441912351cca779129f6.

* Use individual functions when testing for failures.

* Move initialization errors into initialize().

* Use anyhow instead of thiserror to generate backtrace for error.

* Add missing Cargo.lock.

* Add error log when last_vote is missing in the tower storage.

* Change error log info.

* Change test to match exact error.
2024-03-01 18:52:47 -08:00
Yueh-Hsuan Chiang 608329b974
[TieredStorage] rent_epoch() returns 0 for zero-lamport accounts (#35344)
#### Problem
In TieredAccountMeta, RENT_EXEMPT_RENT_EPOCH will be used when
its optional field rent_epoch is None.  However, for legacy reasons, 0
should be used for zero-lamport accounts.

#### Summary of Changes
Return 0 for TieredAccountMeta::rent_epoch() for zero-lamport accounts.

#### Test Plan
accounts_db::tests::test_clean_zero_lamport_and_dead_slot
2024-03-01 15:18:12 -08:00
Pankaj Garg cb260f10d1
Remove unnecessary unwrap from `simulate_transaction_unchecked()` (#35375)
Remove unnecessary unwrap from simulate_transaction_unchecked()
2024-03-01 13:37:51 -08:00
Greg Cusack 5f6d66e87b
Deprecate `ThinClient` and remove `ThinClient` from `bench-tps` (#35365)
* deprecate ThinClient

* switch localcluster bench test to use tpuclient

add back in command line args for thinclient. add thin-client deprecation README

refactor TpuClient connection

* remove thin-client from net/

* change 2.0.0 to 1.19.0
2024-03-01 12:14:52 -08: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 564a9f78a0
Casts executable bool to integer when computing account hash (#35373) 2024-03-01 14:28:28 -05:00
Brooks 59ed049dc5
Gives back 8 bytes to stack buffer for account data when hashing (#35374) 2024-03-01 14:27:48 -05:00
Brooks 3ec020f742
Removes cap_accounts_data_size_per_block feature (#35381) 2024-03-01 14:22:25 -05:00
Brooks 672943224e
Removes cap_accounts_data_len feature (#35378) 2024-03-01 14:22:19 -05:00
Andrew Fitzgerald ede9163633
Comments clarifying non-emptiness of threadset (#35388) 2024-03-01 11:18:42 -08:00
Lucas Steuernagel 532b806bef
Add more unit tests to SVM (#35383) 2024-03-01 16:04:08 -03:00
steviez 7c878973e2
Cleanup ReplayStage loop timing struct (#35361)
- Track loop_count in the struct
- Rename ReplayTiming ==> ReplayLoopTiming
- Make all metrics consistent to end with "_elapsed_us"
2024-03-01 12:30:50 -06:00
Pankaj Garg 7399178c78
Set slot and env in tx batch specific cache (#35377) 2024-03-01 08:20:17 -08:00
Tyera a7f9fe103f
Split runtime utilities out of stake_state.rs (#35386)
* Add points module

* Add rewards module

* Hide rewards doc

* Fixup ledger-tool imports
2024-03-01 09:08:55 -07:00
Brooks 245530b28e
Uses purge_all_bank_snapshots() (#35380) 2024-03-01 07:11:38 -05:00
Han Yang e3b9d7fbb3
SDK: refactor `Signer` and `Signers` traits (#34984)
* read_keypair_file\((.+?)\)[\n\r\s]+.unwrap\(\)[\n\r\s]+.into\(\) -> Box::new(read_keypair_file().unwrap()), Presigner::new\((.*?)\).into\(\) -> Box::new(Presigner::new())

* compiles

* moar general

* doc

* Result impls FromIterator

* doc
2024-03-01 12:34:32 +01:00
Sean Young 9bb59aa30f
ledger-tool: verify: add --record-slots and --verify-slots (#34246)
ledger-tool: verify: add --verify-slots and --verify-slots-details

This adds:

    --record-slots <FILENAME>
	Write the slot hashes to this file.

    --record-slots-config hash-only|accounts
	Store the bank (=accounts) json file, or not.

    --verify-slots <FILENAME>
        Verify slot hashes against this file.

The first case can be used to dump a list of (slot, hash) to a json file
during a replay. The second case can be used to check slot hashes against
previously recorded values.

This is useful for debugging consensus failures, eg:

    # on good commit/branch
    ledger-tool verify --record-slots good.json --record-slots-config=accounts

    # on bad commit or potentially consensus breaking branch
    ledger-tool verify --verify-slots good.json

On a hash mismatch an error will be logged with the expected hash vs the
computed hash.
2024-03-01 08:39:30 +00:00
Ashwin Sekar e8c87e86ef
local-cluster: fix flaky optimistic_confirmation tests (#35356)
* local-cluster: fix flaky optimistic_confirmation tests

* pr feedback: latest_vote -> newest_vote, reword some comments
2024-02-29 12:05:20 -08:00
Brooks bdc5cceb18
Purges all bank snapshots after fastboot (#35350) 2024-02-29 14:31:13 -05:00
dependabot[bot] 5f54f6a7d9
build(deps): bump log from 0.4.20 to 0.4.21 (#35370)
* build(deps): bump log from 0.4.20 to 0.4.21

Bumps [log](https://github.com/rust-lang/log) from 0.4.20 to 0.4.21.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.20...0.4.21)

---
updated-dependencies:
- dependency-name: log
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* [auto-commit] Update all Cargo lock files

---------

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>
2024-03-01 00:51:44 +08:00
dependabot[bot] eef4afa782
build(deps): bump crossbeam-channel from 0.5.11 to 0.5.12 (#35372)
* build(deps): bump crossbeam-channel from 0.5.11 to 0.5.12

Bumps [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam) from 0.5.11 to 0.5.12.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-channel-0.5.11...crossbeam-channel-0.5.12)

---
updated-dependencies:
- dependency-name: crossbeam-channel
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* [auto-commit] Update all Cargo lock files

---------

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>
2024-03-01 00:51:01 +08:00
dependabot[bot] 996de53309
build(deps): bump syn from 2.0.51 to 2.0.52 (#35371)
* build(deps): bump syn from 2.0.51 to 2.0.52

Bumps [syn](https://github.com/dtolnay/syn) from 2.0.51 to 2.0.52.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.51...2.0.52)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* [auto-commit] Update all Cargo lock files

---------

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>
2024-03-01 00:50:47 +08:00
Brooks 83de6a5930
Moves in_mem_accounts_index.rs into accounts_index directory (#35360) 2024-02-29 06:51:18 -05:00
Justin Starry c9c2fbbdd6
Add `Message::is_maybe_writable` (#35340) 2024-02-29 10:27:33 +08:00
Pankaj Garg 990ca1d0b8
Add limit to looping in banking-stage (#35342) 2024-02-28 17:36:45 -08:00
Justin Starry 312f786abf
Rename `SanitizedMessage::try_from` to `try_from_legacy_message` (#35338)
* Simplify and refactor tx message creation in tests

* Rename SanitizedMessage::try_from to try_from_legacy_message
2024-02-29 08:25:22 +08:00
Brooks 9146236f02
Removes ouroboros dependency (#35355) 2024-02-28 17:58:14 -05:00
Brooks 2e10b3b64f
Removes InMemAccountsIndex::get() (#35354) 2024-02-28 17:57:55 -05:00
Brooks 140c21f8a9
Removes ReadAccountMapEntry (#35351) 2024-02-28 16:08:00 -05:00
Brooks 6aaaf858c9
Adds more info to panic message in AccountsHashVerifier (#35353) 2024-02-28 15:55:05 -05:00
behzad nouri a7a41e7631
adds Merkle shred variant with retransmitter's signature (#35293)
Moving towards locking down Turbine propagation path, the commit
reserves a buffer within shred payload for retransmitter's signature.
2024-02-28 20:31:40 +00:00
Greg Cusack 98ec72e6ed
change default `bench-tps` client to `tpu-client` (#35335)
* change default bench-tps client to tpu-client

* remote client default to tpu-client

* add --use-tpu-client back in. hide --use-thin-client

* address nit, inform of future thinclient deprecation
2024-02-28 12:30:24 -08:00
steviez 140818221c
Rename SamplePerformanceService thread for consistency (#35332)
- Rename thread
- Add uniform service start/stop logs
- Misc cleanup with variables / constants / exit flag check
2024-02-28 13:47:27 -06:00
Brooks 7c48cbb7aa
Replaces InMemAccountsIndex::get() with AccountsIndex::get_cloned() (#35352) 2024-02-28 14:45:08 -05:00
Brooks 6402198902
Replaces ReadAccountMapEntry in calculate_accounts_hash_from_index() (#35349) 2024-02-28 14:38:19 -05:00
Lucas Steuernagel 8f3e960640
Add tests for private functions in SVM `account_loader.rs` (#35334) 2024-02-28 14:17:45 -03:00
Brooks f340c1c181
Replaces ReadAccountMapEntry in do_scan_secondary_index() (#35219) 2024-02-28 11:43:33 -05:00
dependabot[bot] 695fe1e7c8
build(deps): bump ahash from 0.8.9 to 0.8.10 (#35347)
* build(deps): bump ahash from 0.8.9 to 0.8.10

Bumps [ahash](https://github.com/tkaitchuck/ahash) from 0.8.9 to 0.8.10.
- [Release notes](https://github.com/tkaitchuck/ahash/releases)
- [Commits](https://github.com/tkaitchuck/ahash/compare/v0.8.9...v0.8.10)

---
updated-dependencies:
- dependency-name: ahash
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* [auto-commit] Update all Cargo lock files

---------

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>
2024-02-28 23:38:18 +08:00
Tao Zhu 089cead024
add bench for precompiled programs (#35310)
* add bench for ed25519 instruction

* add bench for secp256k1 instruction

* Apply suggestions from code review

Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>

* prepare unique txs for benching

* use iter::Cycle for endless loop

---------

Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>
2024-02-28 09:06:55 -06:00
Alexander Meißner e6f8cdce01
Refactor - `LoadedPrograms::assign_program()` (#35233)
* Forbids all program replacements except for reloads and builtins.

* Adds test_assign_program_failure() and test_assign_program_success().

* Explicitly disallows LoadedProgramType::DelayVisibility to be inserted in the global cache.
2024-02-28 09:20:11 +01:00
dependabot[bot] 6ee3bb973c
build(deps): bump tempfile from 3.10.0 to 3.10.1 (#35328)
* build(deps): bump tempfile from 3.10.0 to 3.10.1

Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.10.0 to 3.10.1.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.10.0...v3.10.1)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* [auto-commit] Update all Cargo lock files

---------

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>
2024-02-28 11:36:14 +08:00
Brooks a4e1a9ac98
Adds AccountsIndex::get_account_info_with_and_then() (#35336) 2024-02-27 20:01:29 -05:00
Brooks da088681ba
Adds safer alternatives to get_internal() (#35325) 2024-02-27 18:08:25 -05:00
steviez 94698b8dd0
Name PubSubService tokio threads (#35331)
Also add logs for service starting/stopping
2024-02-27 14:59:07 -06:00
Lucas Steuernagel 8be9930c98
Bump platform tools version (#35330)
Co-authored-by: Dmitri Makarov <dmakarov@users.noreply.github.com>
2024-02-27 17:58:26 -03:00
Kirill Fomichev 8ad125d0c0
rpc: optimize `getTokenLargestAccounts` (#35315)
* rpc: optimize `getTokenLargestAccounts`

* use tuple instead of struct

* untuple

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

---------

Co-authored-by: Tyera <teulberg@gmail.com>
2024-02-27 00:08:29 -07:00
steviez 09925a11eb
Remove the Blockstore thread pool used for fetching Entries (#34768)
There are several cases for fetching entries from the Blockstore:
- Fetching entries for block replay
- Fetching entries for CompletedDataSetService
- Fetching entries to service RPC getBlock requests

All of these operations occur in a different calling thread. However,
the currently implementation utilizes a shared thread-pool within the
Blockstore function. There are several problems with this:
- The thread pool is shared between all of the listed cases, despite
  block replay being the most critical. These other services shouldn't
  be able to interfere with block replay
- The thread pool is overprovisioned for the average use; thread
  utilization on both regular validators and RPC nodes shows that many
  of the thread see very little activity. But, these thread existing
  introduce "accounting" overhead
- rocksdb exposes an API to fetch multiple items at once, potentially
  with some parallelization under the hood. Using parallelization in
  our API and the underlying rocksdb is overkill and we're doing more
  damage than good.

This change removes that threadpool completely, and instead fetches
all of the desired entries in a single call. This has been observed
to have a minor degradation on the time spent within the Blockstore
get_slot_entries_with_shred_info() function. Namely, some buffer
copying and deserialization that previously occurred in parallel now
occur serially.

However, the metric that tracks the amount of time spent replaying
blocks (inclusive of fetch) is unchanged. Thus, despite spending
marginally more time to fetch/copy/deserialize with only a single
thread, the gains from not thrashing everything else with the pool
keep us at parity.
2024-02-26 20:27:03 -06:00
Brooks bf2e8ee32f
AccountsIndex::get_cloned() *must* add entry to in-mem cache (#35322) 2024-02-26 18:20:21 -05:00
Brooks 8143fc3f4a
Replaces ReadAccountMapEntry in read_index_for_accessor_or_load_slow() (#35220) 2024-02-26 14:19:18 -05:00
Brooks 8235feefc4
Removes get_for_tests() (#35311) 2024-02-26 14:17:33 -05:00