Commit Graph

25137 Commits

Author SHA1 Message Date
Brooks 8b66a670b7
Removes AccountsFile::is_recyclable() (#359) 2024-03-21 15:09:26 -04:00
Lucas Steuernagel 4d838d5af9
Add `hello-solana` example source files to SVM folder (#361) 2024-03-21 15:12:32 -03:00
Tyera dff99d0740
Cli stake-split: adjust transfer amount if recipient has lamports (#266)
* Remove incorrect check

* Move to closure

* Use match statement instead

* Adjust rent_exempt_reserve by existing balance

* Only transfer lamports if rent_exempt_reserve needs are greater than 0

* Rename variable for clarity

* Add minimum-delegation check

* Bump test split amount to meet arbitrary mock minimum-delegation amount
2024-03-21 11:03:55 -06:00
Greg Cusack 792d7454d9
switch to `solana-tpu-client` from `solana_client::tpu_client` for `bench-tps`, `dos/`, `LocalCluster`, `gossip/` (#310)
* switch over to solana-tpu-client for bench-tps, dos, gossip, local-cluster

* put TpuClientWrapper back in solana_client
2024-03-21 09:25:54 -07:00
Jon C b2f4fb306e
client: Start resending sooner during `send_and_confirm_transactions_in_parallel` (#348)
client: Confirm sooner during send_and_confirm_in_parallel
2024-03-21 14:35:09 +01:00
Tao Zhu 1e08e90498
Add functions to collect executed transactions fee in details; (#178)
* Add functions to collect executed transactions fee in details;

* remove unnecessary derive attributes

* change function name from add to accumulate; remove collector_fee_details from PartialEq

* add AbiExample

* add test

* share function to withdraw errored transaction

* more tests
2024-03-21 04:33:35 +00:00
Alessandro Decina 981881544c
runtime: do fewer syscalls in remap_append_vec_file (#336)
* 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
2024-03-21 14:28:23 +11:00
Wen 11aa06d24f
wen-restart: Find heaviest fork (#183)
* Pass the final result of LastVotedForkSlots aggregation to next
stage and find the heaviest fork we will Gossip to others.

* Change comments.

* Small fixes to address PR comments.

* Move correctness proof to SIMD.

* Fix a broken merge.

* Use blockstore to check parent slot of any block in FindHeaviestFork

* Change error message.

* Add special message when first slot in the list doesn't link to root.
2024-03-20 19:38:46 -07:00
Joe C f194f70e68
Runtime: Refactor builtins module (#304)
* runtime: builtins: move to new bank submodule

* runtime: builtins: change `feature_id` to `enable_feature_id`

* runtime: builtins: add stateless builtins
2024-03-20 20:46:38 -05:00
Dmitri Makarov 54575feb42
SVM: add a missing doc comment (#347) 2024-03-20 20:03:20 -04:00
Alessandro Decina ade90354a1
runtime: use str::split instead of regex to parse appendvec filenames (#323) 2024-03-21 09:14:16 +11:00
steviez 4a67cd495b
Allow configuration of replay thread pools from CLI (#236)
Bubble up the constants to the CLI that control the sizes of the
following two thread pools:
- The thread pool used to replay multiple forks in parallel
- The thread pool used to execute transactions in parallel
2024-03-20 15:07:04 -05:00
Dmitri Makarov 09ae5872b3
Rename LoadedPrograms to ProgramCache for readability (#339) 2024-03-20 15:26:45 -04:00
Yueh-Hsuan Chiang 3038d47f1c
[TieredStorage] Store account address range (#172)
#### Problem
The TieredStorageFooter has the min_account_address and
max_account_address fields to describe the account address
range in its file.  But the current implementation hasn't updated
the fields yet.

#### Summary of Changes
This PR enables the TieredStorage to persist address range
information into its footer via min_account_address and
max_account_address.

#### Test Plan
Updated tiered-storage test to verify persisted account address range.
2024-03-20 12:17:12 -07:00
Yueh-Hsuan Chiang 0e932c7308
[TieredStorage] Refactor TieredStorage::new_readonly() code path (#195)
#### Problem
The TieredStorage::new_readonly() function currently has the following
problems:

* It opens the file without checking the magic number before checking and loading the footer.
* It opens the file twice: first to load the footer, then open again by the reader.

#### Summary of Changes
This PR refactors TieredStorage::new_readonly() so that it first performs all
checks inside the constructor of TieredReadableFile.  The TieredReadableFile
instance is then passed to the proper reader (currently HotStorageReader)
when all checks are passed.

#### Test Plan
* Added a new test to check MagicNumberMismatch.
* Existing tiered-storage tests
2024-03-20 10:39:25 -07:00
Trent Nelson f41fb84e15
rpc-sts: add config options for stake-weighted qos (#197)
* rpc-sts: plumb options for swqos config

* rpc-sts: send to specific tpu peers when configured
2024-03-20 11:13:50 -06:00
HaoranYi 0f8f8cd970
Revert deprecate executable feature (#309)
* revert deprecate executable feature

* add native loader account transfer test

---------

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2024-03-20 10:54:15 -05:00
Pankaj Garg aba8ce5f3e
Move code to check_program_modification_slot out of SVM (#329)
* Move code to check_program_modification_slot out of SVM

* add documentation for the public function
2024-03-20 05:39:07 -07:00
Jon C 261b3e9ee7
CI: Add windows clippy job and fix clippy errors (#330)
* CI: Run clippy on windows

* Update cargo-clippy-before-script.sh for Windows

* Pacify clippy
2024-03-20 13:21:00 +01:00
Tao Zhu 184ba6cb84
qos service should also accumulate executed but errored units (#328)
qos service should also accumulated executed but errored units
2024-03-20 00:44:34 +00:00
Alessandro Decina 8df80d9c12
accounts-db: unpack_archive: unpack accounts straight into their final destination (#289)
* accounts-db: unpack_archive: avoid extra iteration on each path

We used to do a iterator.clone().any(...) followed by
iterator.collect(). Merge the two and avoid an extra iteration and
re-parsing of the path.

* accounts-db: unpack_archive: unpack accounts straight into their final destination

We used to unpack accounts into account_path/accounts/<account> then
rename to account_path/<account>. We now unpack them into their final
destination directly and avoid the rename syscall.
2024-03-20 09:39:33 +11:00
Ashwin Sekar 228413ca8a
vote: reuse ff to gate tvc constant update from 8 -> 16 (#322) 2024-03-19 22:26:13 +00:00
Dmitri Makarov f1d56e95f5
SVM: minor refactoring to improve code readability (#317) 2024-03-19 15:32:07 -04:00
Lucas Steuernagel e8526f60aa
SVM integration test (#307) 2024-03-19 13:44:34 -03:00
Jon C d4bcdf856e
install: Fix check for windows build (#295) 2024-03-19 14:20:27 +08:00
Brennan 67c3bff092
fix polarity for concurrent replay (#297)
* fix polarity for concurrent replay
2024-03-18 19:37:32 -07:00
Greg Cusack ed573ff60c
add in method for building a `TpuClient` for `LocalCluster` tests (#258)
* add in method for building a TpuClient for LocalCluster tests

* add cluster trait. leave dependency on solana_client::tpu_client
2024-03-18 17:58:11 -07:00
Justin Starry 2c12500513
cli: skip no-op program buffer writes (#277)
cli: skip no-op program deploy write txs
2024-03-19 07:28:53 +08:00
Yueh-Hsuan Chiang 7c49b9c59e
[TieredStorage] Use BufWriter in TieredWritableFile (#261)
#### Problem
TieredWritableFile currently uses File instead of BufWriter.
This will introduce more syscall when doing file writes.

#### Summary of Changes
This PR makes TieredWritableFile uses BufWriter to allow the
write-call to be more optimized to reduce the number of syscalls.

#### Test Plan
Existing tiered-storage test.
Will run experiments to verify its performance improvement.

#### Dependency
https://github.com/anza-xyz/agave/pull/260
2024-03-18 14:27:55 -07:00
Lijun Wang 69b40a4d75
Net script fix for expected shred version (#280)
Fix for --expected-shred-version when maybeWaitForSupermajority is on

Co-authored-by: Lijun Wang <lijun@anza.xyz>
2024-03-18 13:54:07 -07:00
Yueh-Hsuan Chiang 6441209682
[TieredStorage] TieredStorageFile -> TieredReadonlyFile and TieredWritableFIle (#260)
#### Problem
TieredStorageFile struct currently offers new_readonly() and new_writable()
to allow both read and write work-load to share the same struct.  However,
as we need the writer to use BufWriter to improve performance as well as
enable Hasher on writes.  There is a need to refactor TieredStorageFile to
split its usage for read-only and writable.

#### Summary of Changes
Refactor TieredStorageFile to TieredReadonlyFIle and TieredWritableFile.

#### Test Plan
Existing tiered-storage tests.
2024-03-18 12:24:19 -07:00
ryleung-solana 36e97654e3
Make the quic server connection table use an async lock, reducing thrashing (#293)
Make the quic server connection table use an async lock, reducing lock contention
2024-03-18 12:05:00 -07:00
WGB5445 a71a62f2e2
[solana-install-init] Optimize error message for Windows user permission installation (#234)
* feat: check user's permissions in Windows

* feat: Remove check fun and check os_err

* fmt and optimize code
2024-03-18 17:58:28 +01:00
Jeff Washington (jwash) 1fc4e38a4f
add stats for write cache flushing (#233)
* add stats for write cache flushing

* some renames
2024-03-18 09:53:44 -05:00
Pankaj Garg cc3afa5588
Remove public visibility of program cache from bank (#279) 2024-03-17 15:29:20 -07:00
Ashwin Sekar b27c80a920
vote: deprecate unused legacy vote tx plumbing (#274) 2024-03-15 22:21:52 -07:00
听寒 87a0071e9a
fix typo (#264)
fix typo in comment of test_optimistic_confirmation_violation_without_tower
2024-03-15 16:20:30 -05:00
ripatel-fd fb01ab28ec
Use static memory layout for all sysvars (#249)
Co-authored-by: Richard Patel <ripatel@jumptrading.com>
2024-03-15 14:59:41 -06:00
Andrew Fitzgerald 4425dbea91
congestion_multiplier as u64 (#267) 2024-03-15 12:37:15 -07:00
Tyera 7f959509ed
Clean up require_rent_exempt_split_destination feature (#253)
* Clean up require_rent_exempt_split_destination feature

* Clean up comment
2024-03-15 13:36:31 -06:00
HaoranYi dcc6f1eb3a
fix typos (#247)
Co-authored-by: HaoranYi <haoran.yi@solana.com>
2024-03-15 09:15:23 -05:00
Trent Nelson a2579d484e
remove raptor coding experiments (#255) 2024-03-14 22:01:15 -06:00
Wen 5591db7801
Wen_restart: check block full using blockstore (#250)
* Switch to blockstore.is_full() check because replay thread isn't active.

* Use make_chaining_slot_entries and add first_parent to the method.
Small style fixes.

* Switch to blockstore.is_full() check because replay thread isn't active.
2024-03-14 20:45:03 -07:00
Yihau Chen 2537e3e4ad
[anza migration] fix: use the correct log filter for non-unix (#245)
fix: use the correct log filter for non-unix
2024-03-15 11:27:16 +08:00
Wen f5a3f2476a
wen_restart: replace get_aggregate_result() with more methods (#254)
* Replace AggregateResult with more methods.

* Rename slots_to_repair() to slots_to_repair_iter().
2024-03-14 19:01:17 -07:00
samkim-crypto fba70c8504
[zk-token-sdk] Implement `FromStr` for `ElGamalPubkey`, `ElGamalCiphertext`, and `AeCiphertext` (#130)
* add `ParseError` in `zk-token-elgamal`

* implement `FromStr` for `ElGamalPubkey` and `ElGamalCiphertext`

* implement `FromStr` for `AeCiphertext`

* fix target

* cargo fmt

* use constants for byte length check

* make `FromStr` functions available on chain

* use macros for the `FromStr` implementations

* restrict `from_str` macro to `pub(crate)`

* decode directly into array

* cargo fmt

* Apply suggestions from code review

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

* remove unnecessary imports

* remove the need for `ParseError` dependency

---------

Co-authored-by: Jon C <me@jonc.dev>
2024-03-15 09:09:41 +09:00
sakridge b3fd87fe81
Fix gossip contact trace (#241) 2024-03-14 19:43:59 +01:00
Greg Cusack d49ceb0e3f
Add in metrics for detecting Redundant Pulls (#199) 2024-03-14 11:22:52 -07:00
Nagaprasad V R 6bcb77dcfa
relax stake split destination check (#162)
* relax stake split destination check

* change stake_account error handling logic

* fmt

* modify logic

* change error message when account is neither owned by stake program or system program

* add a comment explaining nested ifs in stake_account error handling

* fix typos in comments

* update comment
2024-03-14 11:43:34 -06:00
dependabot[bot] 75ef68ffe8
build(deps): bump hidapi from 2.6.0 to 2.6.1 (#237)
Bumps [hidapi](https://github.com/ruabmbua/hidapi-rs) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/ruabmbua/hidapi-rs/releases)
- [Commits](https://github.com/ruabmbua/hidapi-rs/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-15 01:42:32 +08:00