Commit Graph

24744 Commits

Author SHA1 Message Date
Brooks f62293918d
Moves the async deleter code to accounts-db (#35040) 2024-02-02 09:21:26 -05:00
Alexander Meißner 5dd9609aea
Fix - LoadedPrograms statistics (#35026)
Fixes hits, misses.
Adds reloads, lost_insertions.
Removes prunes_expired.
2024-02-02 13:35:36 +01:00
Jon C 3646291dc6
sdk: Do not derive AbiEnum on InstructionError for Solana builds (#35038) 2024-02-02 00:00:31 +01:00
Yueh-Hsuan Chiang be9f17f053
[TieredStorage] Have HotStorageWriter::write_account() return Vec<StoredAccountInfo> (#34929)
#### Problem
To allow hot-storage to use HotStorageWriter::write_account() to
implement AccountsFile::append_accounts(), it is required to
provide a Vector of StoredAccountInfo to allow AccountsDB to
properly prepare the entry for each account.

#### Summary of Changes
This PR enables HotStorageWriter::write_account() to return
Vec<StoredAccountInfo>.

#### Test Plan
Extend existing tests for HotStorageWriter to verify the correctness
of the returned Vec<StoredAccountInfo>.
2024-02-01 13:33:42 -08:00
galactus 35f900b03b
Metrics prioritization fees (#34653)
* Adding metrics for prioritization fees min/max per thread

* Adding scheduled transaction prioritization fees to the metrics

* Changes after andrews comments

* fixing Taos comments

* Adding metrics to the new scheduler

* Fixing getting of min max for TransactionStateContainer

* Fix clippy CI Issue

* Changes after andrews comments about min/max for new scheduler

* Creating a new structure to store prio fee metrics

* Reporting with prio fee stats banking_stage_scheduler_counts

* merging prioritization stats into SchedulerCountMetrics

* Minor changes after andrews review
2024-02-01 15:06:45 -06:00
Brooks daa2449ad4
Removes RwLock on AccountsDb::shrink_paths (#35027) 2024-02-01 09:35:34 -05:00
Brooks 0569304835
Replaces bare Arc::default() in CacheHashData::new() (#35017) 2024-01-31 10:52:59 -05:00
steviez b3ea62fba3
ledger-tool: Change --snapshot-archive-path to --snapshots (#35019)
This change makes solana-ledger-tool match solana-validator CLI; the old
flag --snapshot-archive-path is retained as an argument alias and can
still be used for the sake of backwards compatibility.
2024-01-30 22:50:37 -04:00
Tao Zhu 0dcac3fe7c Revert "Remove congestion multiplier from calculate fee (#34865)"
This reverts commit 73d3973c7c.
2024-01-30 17:30:01 -06:00
Tao Zhu df2ee120e9 Revert "separate priority fee and transaction fee from fee calculation (#34757)"
This reverts commit 5ecc47ec5a.
2024-01-30 17:30:01 -06:00
Tao Zhu 15423928c1 Revert "refactor unused parameter (#34970)"
This reverts commit 083890928f.
2024-01-30 17:30:01 -06:00
Pankaj Garg c6c23405d6
Remove SVM dependency on Bank::should_collect_rent() (#35011) 2024-01-30 08:38:24 -08:00
dependabot[bot] d5ab2fa1df
build(deps): bump serde_json from 1.0.111 to 1.0.113 (#35000)
* build(deps): bump serde_json from 1.0.111 to 1.0.113

Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.111 to 1.0.113.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.111...v1.0.113)

---
updated-dependencies:
- dependency-name: serde_json
  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-01-30 16:30:10 +08:00
dependabot[bot] 6666660d4c
build(deps): bump hidapi from 2.5.0 to 2.5.1 (#34998)
Bumps [hidapi](https://github.com/ruabmbua/hidapi-rs) from 2.5.0 to 2.5.1.
- [Commits](https://github.com/ruabmbua/hidapi-rs/commits/v2.5.1)

---
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-01-30 16:29:48 +08:00
dependabot[bot] 0f376254af
build(deps): bump chrono from 0.4.32 to 0.4.33 (#34997)
* build(deps): bump chrono from 0.4.32 to 0.4.33

Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.32 to 0.4.33.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.32...v0.4.33)

---
updated-dependencies:
- dependency-name: chrono
  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-01-30 16:29:24 +08:00
dependabot[bot] 9ad6198d2d
build(deps): bump serde from 1.0.195 to 1.0.196 (#34996)
* build(deps): bump serde from 1.0.195 to 1.0.196

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.195 to 1.0.196.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.195...v1.0.196)

---
updated-dependencies:
- dependency-name: serde
  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-01-30 16:28:59 +08:00
Brooks c8cdd0087f
Removes pushing and pulling account hashes in gossip (#34979) 2024-01-29 17:19:55 -05:00
Yueh-Hsuan Chiang 16a2f1bd3d
[TS] Add get_account() and account_matches_owner() to TieredStorageReader (#34968)
#### Problem
TieredStorageReader is a wrapper enum that works for
both Hot and Cold storage readers, but its get_account()
and account_matches_owner() API are missing.

#### Summary of Changes
Add get_account() and account_matches_owner() to
TieredStorageReader.

#### Test Plan
hot.rs offers similar coverage for HotStorageReader.
2024-01-29 11:05:47 -08:00
HaoranYi b1f8a89da5
Fix bank new_from_field for epoch reward status (#34992)
* fix bank new_from_field for epoch reward status

* fix bank serde test assert for epoch reward status

---------

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2024-01-29 09:00:40 -06:00
Lijun Wang 8fde8d26c7
don't sign X.509 certs (#34896)
This get rid of 3rd party components rcgen in the path of private key access to make the code more secure.
2024-01-28 16:17:46 -08:00
Brooks b9815da6cc
Fixes typo (#34990) 2024-01-28 17:32:09 -05:00
dependabot[bot] 52d3c021ef
build(deps): bump chrono from 0.4.31 to 0.4.32 (#34898)
* build(deps): bump chrono from 0.4.31 to 0.4.32

Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.31 to 0.4.32.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.31...v0.4.32)

---
updated-dependencies:
- dependency-name: chrono
  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-01-28 13:02:29 +08:00
hana c99427eb9e
solana-program: only decode prior_voters if needed (#34972) 2024-01-27 11:10:45 -08:00
Pankaj Garg 2455dc1a69
SVM: Move `TransactionAccountStateInfo` to svm and decouple from `bank` (#34981) 2024-01-27 11:10:09 -08: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
behzad nouri d4fdcd940a
adds feature to enable chained Merkle shreds (#34916)
During a cluster upgrade when only half of the cluster can ingest the new shred
variant, sending shreds of the new variant can cause nodes to diverge.
The commit adds a feature to enable chained Merkle shreds explicitly.
2024-01-27 15:03:16 +00:00
Brooks 02062a6b6a
Removes unused AccountsHashFaultInjector (#34977) 2024-01-26 19:21:23 -05:00
Brooks 59c2f35609
Removes unused retain_max_n_elements() (#34978) 2024-01-26 18:34:47 -05:00
Brooks e1260a9604
Removes unused parameters from AccountsHashVerifier::new() (#34976) 2024-01-26 21:52:05 +00:00
Pankaj Garg 0d117d420c
Remove BlockhashQueue dependency from SVM related code (#34974) 2024-01-26 13:46:44 -08:00
HaoranYi e38848e519
Remove unused get_append_vec_id function (#34949)
remove unused get_append_vec_id fn

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2024-01-26 21:41:09 +00:00
HaoranYi 8a0c91d842
Skip creating reward partition account for `--partitioned-epoch-rewards-force-enable-single-slot` (#34946)
* skip creating reward partition account when we are testing agains mainnet

* Update runtime/src/bank.rs

Co-authored-by: Brooks <brooks@prumo.org>

* Update runtime/src/bank.rs

Co-authored-by: Brooks <brooks@prumo.org>

* refactor bool logic for partition reward single slot enable

* Update runtime/src/bank.rs

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

* move force_partition_rewards check into data account create fn

* share code

---------

Co-authored-by: HaoranYi <haoran.yi@solana.com>
Co-authored-by: Brooks <brooks@prumo.org>
Co-authored-by: Tyera <teulberg@gmail.com>
2024-01-26 21:24:54 +00:00
Brooks c656ca68b8
Stops pushing accounts hashes to gossip in AccountsHashVerifier (#34971) 2024-01-26 15:25:23 -05:00
Tao Zhu 083890928f
refactor unused parameter (#34970) 2024-01-26 12:28:44 -06:00
Yueh-Hsuan Chiang 3380c14044
[TieredStorage] Correct the HotStorage API for account_matches_owners (#34967)
#### Problem
In HotStorageReader, the account_matches_owners takes
&[&Pubkey] as the address candidates.  However, it should
be &[Pubkey] as defined in the accounts_file API.

#### Summary of Changes
Correct HotStorageReader::account_matches_owners() to
take &[Pubkey] instead.

#### Test Plan
Existing unit-tests
2024-01-26 09:40:05 -08:00
Yueh-Hsuan Chiang 7138f8767e
[TieredStorage] Avoid AccountHash copy in AccountMetaOptionalFields (#34969)
#### Problem
Using non-reference type of AccountHash in 
AccountMetaOptionalFields causes an unnecessary copy
as mentioned in #34948.

#### Summary of Changes
Uses &AccountHash in AccountMetaOptionalFields to
avoid copying.

#### Test Plan
Existing unit tests.

Fixes #34948
2024-01-26 09:13:09 -08: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
Yueh-Hsuan Chiang 663a1bb8f4
[TieredStorage] Write owners block for HotAccountStorage (#34927)
#### Problem
So far the current HotStorageWriter::write_accounts() only writes
accounts blocks and index block.

#### Summary of Changes
The PR further writes owners block in HotStorageWriter::write_accounts().

#### Test Plan
Extended existing test for HotStorageWriter to cover the owners block.
2024-01-26 06:48:28 -08:00
Tao Zhu 5ecc47ec5a
separate priority fee and transaction fee from fee calculation (#34757)
add function calculate_fee_details() that returns FeeDetails with base and priority fee separated
2024-01-26 08:24:45 -06:00
dependabot[bot] 5da06c5f7d
build(deps): bump hidapi from 2.4.1 to 2.5.0 (#34965)
Bumps [hidapi](https://github.com/ruabmbua/hidapi-rs) from 2.4.1 to 2.5.0.
- [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-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-26 20:33:48 +08:00
steviez 3add40fc07
ledger-tool: Refactor accounts subcommand output code (#34915)
The accounts command currently dumps every single account in the
AccountsDb. This is obviously a lot of output, so a previous change
streamed the accounts instead of collecting and dumping at the end.

The streaming approach is much more performant, but the implementation
is non-trivial. This change
- Moves the accounts output code to output.rs
- Refactor the logic to several objects that implment the functionality
- Adjust the json output to also include the summary

This change lays the groundwork for cleanly adding several more flags
that will allow for querying different subsets of accounts.
2024-01-26 00:55:05 -06:00
steviez 89fd6acb8f
ledger-tool: Minor cleanup on --ignore-ulimit-nofile-error flag (#34944)
This argument is a flag and doesn't take a value; however, it had the
.value_name() modifier set with "FORMAT". This could be confusing so
remove .value_name() and add .takes_value(false)
2024-01-25 22:57:26 -06:00
Yueh-Hsuan Chiang 51c0649af8
[TieredStorage] Use RENT_EXEMPT_RENT_EPOCH in HotStorageWriter (#34950)
#### Problem
In HotStorageWriter::write_accounts, it skips storing rent-epoch when
the rent-epoch equals Epoch::MAX.  While the value is correct, it is
more suitable to use RENT_EXEMPT_RENT_EPOCH instead as the
goal here is to save bytes for rent-exempt accounts.

#### Summary of Changes
Replace Epoch::MAX by RENT_EXEMPT_RENT_EPOCH when checking
whether to skip storing rent-epoch in HotStorageWriter.
2024-01-25 17:17:24 -08:00
Brooks f0d67d7f28
Adds hit/miss stats for cache hash data (#34954) 2024-01-25 17:27:45 -05:00
ellttBen 9e09524595
Cli: Return final transaction signature in solana program deploy (#34931) 2024-01-25 22:25:03 +00:00
Brooks e155d9c445
Adds cache hash data deletion policy enum (#34956) 2024-01-25 16:58:56 -05:00
Pankaj Garg 1e68ba5f8a
Move counter and logging code back to load_and_execute_transactions() (#34951) 2024-01-25 13:56:43 -08:00
Tyera 22500c23db
Add rpc support for partitioned rewards (#34773)
* Check feature_set for enable_partitioned_epoch_reward

* Keep common variable outside if case

* Keep common early return out of if case, since the first_slot_in_epoch must exist for partiion PDA to exist

* Get and parse epoch partition data PDA

* Find partition index for all addresses

* Pull relevant blocks and get rewards

* Reuse ordering and reformatting

* Remove feature deactivation from TestValidator

* Restore rewards iteration in first block in epoch for feature case to catch Voting rewards

* Add fn get_reward_map helper to dedupe code

* No need to start 2nd get_block_with_limit call with first block again

* Replace filter_map to parameterize RewardType filter expression

* Weird thing to make clippy and compiler agree (https://github.com/rust-lang/rust-clippy/issues/8098)

* Use activated_slot to ensure the right approach for past rewards epochs
2024-01-25 13:39:06 -07:00
Tyera 6c4746dc14
accounts-cluster-bench: Break early when a max-accounts limit is reached (#34922)
* Improve help text

* Add max_accounts cli arg and halt loop accordingly

* Log totals before max_account exit

* Add test of early end on max_accounts

* Add logging when account-creation loop breaks
2024-01-25 19:46:43 +00:00
Andrew Fitzgerald 29737ab5e4
Use ThreadLocalMultiIterator for tests (#34947)
* Use ThreadLocalMultiIterator for tests

* some validator config was not using default_for_test
2024-01-25 11:22:27 -07:00