Commit Graph

24622 Commits

Author SHA1 Message Date
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
Yueh-Hsuan Chiang 26d62b9516
[TieredStorage] writing hot account blocks and index blocks (#34828)
#### Problem
The implementation of write_accounts() for HotAccountStorage is missing.
It consists of the writing of account blocks, index block, and owners block.

#### Summary of Changes
This PR completes part of the HotStorageWriter::write_accounts().
Specifically, it finishes the writing of account blocks and index block.

#### Test Plan
A new unit-test is added to verify the correctness of the work-in-progress
HotStorageWriter::write_accounts().
2024-01-25 09:38:06 -08:00
Alexander Meißner 2c98399afd
Docs - for loaded_programs.rs (#34715)
Adds doc comments to loaded_programs.rs
2024-01-25 18:02:38 +01:00
hana 0c2d9d25fd
solana-program: VoteState::deserialize() (#34829)
* implement a custom parser for `VoteState` which is usuable in a bpf context
* derive or impl `Arbitrary` for `VoteStateVersions` and its component types, for test builds only
2024-01-25 08:51:41 -08:00
dependabot[bot] b18f738371
build(deps): bump bytemuck from 1.14.0 to 1.14.1 (#34945)
* build(deps): bump bytemuck from 1.14.0 to 1.14.1

Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.14.0 to 1.14.1.
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.14.0...v1.14.1)

---
updated-dependencies:
- dependency-name: bytemuck
  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-25 23:52:40 +08:00
Pankaj Garg b161f6ce08
Create SVM folder as a placeholder for the relevant code (#34942) 2024-01-25 06:20:00 -08:00
Pankaj Garg b04765f8b5
Code cleanup in account_rent_state (#34941) 2024-01-24 17:35:56 -08:00
Dmitri Makarov 5b59930782
Refactoring internal bank method signature for consistency (#34936) 2024-01-24 20:28:25 -05:00
Andrew Fitzgerald 62e7ebd0cc
BlockProductionMethod::CentralScheduler as default (#34891) 2024-01-24 15:30:32 -08:00
Tyera bbd1fd41ac
Move EpochRewardsHasher to solana-sdk (#34934)
* Move EpochRewardsHasher to solana-sdk

* Cargo.lock

* Apparently we're allowing arithmetic_side_effects in all of runtime

* Move allow stmt to block instead of module

* Also allow in test mod
2024-01-24 16:25:01 -07:00
samkim-crypto 3004eaa9bd
[clap-v3-utils] Add functions to parse directly from `SignerSource` (#34678)
* add `_from_source` function variants for signer, keypair, and pubkey

* make `parse_signer_source` an associated function of `SignerSource`

* refactor `SignerSource` into `input_parsers::signer`

* make `_from_source` functions public

* remove unnecessary import
2024-01-25 06:27:02 +09:00
Brooks 5898b9a2f7
Cleans up stale accounts hash cache files (#34933) 2024-01-24 15:31:50 -05:00
Dmitri Makarov 662e77feaa
Refactor bank's load_and_execute_transaction (#34893)
* Refactor bank load_and_execute_transactions

* Remove redundant clippy annotation

* Report check time where it is done in load_and_execute_transactions
2024-01-24 14:37:18 -05:00
Wen 0d92254736
Add push_heaviest_fork and get_heaviest_fork. (#34892)
Add push_get_heaviest_fork and push_get_heaviest_fork.
2024-01-24 08:57:50 -08:00
Dmitri Makarov ef233eaaa7
Refactor load_accounts to take a reference to a slice instead of vec (#34919)
This is in preparation for further refactoring of
Bank::load_and_execute_transactions in a separate commit.
2024-01-24 09:43:18 -05:00
samkim-crypto b11d41a3f7
[zk-token-sdk] Use checked arithmetic when processing transfer amount (#34130)
* add `try_split_u64`

* add `try_combine_lo_hi_u64`

* add `try` variants of ciphertext arithmetic functions

* use try functions in proof generaiton and verification logic

* deprecate non-`try` functions

* use try functions in proof generaiton and verification logic

* Apply suggestions from code review

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

* cargo fmt

---------

Co-authored-by: Jon C <me@jonc.dev>
2024-01-24 22:27:03 +09:00
Tyera b9947bd327
Support json parsing of epoch-rewards partition data sysvar accounts (#34914) 2024-01-23 21:54:06 -07:00
Ryo Onodera bd103865df
Introduce primitive threading in unified scheduler (#34676)
* Introduce primitive threading in unified scheduler

* Make the internal struct ExecutedTask not pub

* Improve wording a bit

* Explain scheduler main loop's overhead sensitivity

* Improve wording a bit

* Define ChainedChannel{Sender, Receiver} wrappers

* Clean up a bit

* Use derivative to avoid manual Clone impl

* Clarify comment

* Remove extra whitespace in comment

* Remove unneeded dyn trait for ChainedChannel

* Remove the accumulator thread for now

* Fix typo

* Use unimplemented!() to convey intention better
2024-01-24 12:46:16 +09:00
Brooks bfbe03a536
Updates mergify backport actions for new minor version (#34921) 2024-01-23 22:29:21 -05:00
Yueh-Hsuan Chiang 1810feadc2
[TieredStorage] In-memory struct for writing OwnersBlock (#34853)
#### Problem
To write the owners-block, it requires an in-memory struct that maintains
a set of unique owner addresses while providing a look-up function to
obtain the OwnerOffset with the specified owner address. 

#### Summary of Changes
This PR adds OwnersTable, the in-memory struct that maintains
a set of unique owner addresses while providing a look-up function to
obtain the OwnerOffset with the specified owner address.

#### Test Plan
A new unit-test is added.
2024-01-23 14:57:53 -08:00
Brooks 3303c2566c
Removes fs-err dependency (#34911) 2024-01-23 17:25:03 -05:00
Tyera 7ebe0bccd6
Fix epoch rewards partition-data program owner (#34913)
Fix account program owner
2024-01-23 15:19:21 -07:00
Will Hickey ad0aabcd1c
Update changelog in preparation for creating new v1.18 branch (#34912) 2024-01-23 15:28:57 -06:00