quic: use smallvec, save one allocation per packet
Use smallvec to hold chunks. Streams are packet-sized so we don't expect
them to have many chunks. This saves us an allocation for each packet.
* Find the bank hash of the heaviest fork, replay if necessary.
* Make it more explicit how heaviest fork slot is selected.
* Use process_single_slot instead of process_blockstore_from_root, the latter
may re-insert banks already frozen.
* Put BlockstoreProcessError into the error message.
* Check that all existing blocks link to correct parent before replay.
* Use the default number of threads instead.
* Check whether block is full and other small fixes.
* Fix root_bank and move comments to function level.
* Remove the extra parent link check.
* Introduce SchedulingStateMachine
* Apply all typo fixes from code review
Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>
* Update word wrapping
* Clarify Token::assume_exclusive_mutating_thread()
* Use slice instead of &Vec<_>
* Improve non-const explanation
* Document consecutive readonly rescheduling opt.
* Make test_gradual_locking terminate for miri
* Avoid unnecessary Task::clone()
* Rename: lock_{status,result} and no attempt_...()
* Add safety comment for get_account_locks_unchecked
* Reduce and comment about Page::blocked_tasks cap.
* Document SchedulingStateMachine::schedule_task()
* Add justification of closure in create_task
* Use the From trait for PageUsage
* Replace unneeded if-let with .expect()
* Add helpful comments for peculiar crossbeam usage
* Fix typo
* Make bug-bounty-exempt statement more clear
* Add test_enfoced_get_account_locks_verification
* Fix typos...
* Big rename: Page => UsageQueue
* Document UsageQueueLoader
* Various minor cleanings for beautifier diff
* Ensure reinitialize() is maintained for new fields
* Remove uneeded impl Send for TokenCell & doc upd.
* Apply typo fixes from code review
Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>
* Merge similar tests into one
* Remove test_debug
* Remove assertions of task_index()
* Fix UB in TokenCell
* Make schedule_task doc comment simpler
* Document deschedule_task
* Simplify unlock_usage_queue() args
* Add comment for try_unblock() -> None
* Switch to Option<Usage> for fewer assert!s
* Add assert_matches!() to UsageQueue methods
* Add panicking test case for ::reinitialize()
* Use UsageFromTask
* Rename: LockAttempt => LockContext
* Move locking and unlocking methods to usage queue
* Remove outdated comment...
* Remove redundant fn: pop_unblocked_usage_from_task
* Document the index of task
* Clarifty comment a bit
* Update .current_usage inside try_lock()
* Use inspect_err to simplify code
* fix ci...
* Use ()...
* Rename: schedule{,_next}_unblocked_task()
* Rename: {try_lock,unlock}_{for_task,usage_queues}
* Test solana-unified-scheduler-logic under miri
* Test UB to illustrate limitation of TokenCell
* Test UB of using multiple tokens at the same time
---------
Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>
The IP echo server currently spins up a worker thread for every thread
on the machine. Observing some data for nodes,
- MNB validators and RPC nodes look to get several hundred of these
requests per day
- MNB entrypoint nodes look to get 2-3 requests per second on average
In both instances, the current threadpool is severely overprovisioned
which is a waste of resources. This PR plumnbs a flag to control the
number of worker threads for this pool as well as setting a default of
two threads for this server. Two threads allow for one thread to always
listen on the TCP port while the other thread processes requests
* runtime: do fewer syscalls in remap_append_vec_file
Use renameat2(src, dest, NOREPLACE) as an atomic version of if
statx(dest).is_err() { rename(src, dest) }.
We have high inode contention during storage rebuild and this saves 1
fs syscall for each appendvec.
* Address review feedback
The default value was previously being determined down where the thread
pool is being created. Providing a default value at the CLI level is
consistent with other args, and gives an operator better visibility into
what the default will actually be
RuntimeConfig doesn't use anything SVM specific and logically belongs
in program runtime rather than SVM. This change moves the definition
of RuntimeConfig struct from the SVM crate to program-runtime and
adjusts `use` statements accordingly.
* 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.