Commit Graph

4522 Commits

Author SHA1 Message Date
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
Brooks e74f04ad0d
Replaces fs-err in snapshot_utils.rs (#34908) 2024-01-23 14:48:30 -05:00
Brooks b150de6d10
Replaces fs-err in clean_orphaned_account_snapshot_dirs() (#34902)
* Replaces fs-err in clean_orphaned_account_snapshot_dirs()

* pr: revert info message format changes
2024-01-23 19:46:02 +00:00
Brooks c30db7ad92
Replaces fs-err in snapshot_version_from_file() (#34904) 2024-01-23 14:35:10 -05:00
Tao Zhu 73d3973c7c
Remove congestion multiplier from calculate fee (#34865)
* remove println from a test

* sync fee_structure with fee_rate_governor;
remove congestion_multiplier from calculacte_fee(), leave parameters unused for now.
2024-01-23 12:59:50 -06:00
Brooks 22fc49c444
Replaces fs-err in rebuild_storages_from_snapshot_dir() (#34907) 2024-01-23 13:26:23 -05:00
Brooks 94f35da8e2
Replaces fs-err in purge_bank_snapshot() (#34906) 2024-01-23 17:50:39 +00:00
Brooks a21cfbd13f
Replaces fs-err in untar_snapshot_create_shared_buffer() (#34905) 2024-01-23 12:46:31 -05:00
Brooks 4bd8eedc06
Replaces fs-err in move_and_async_delete_path() (#34903) 2024-01-23 12:42:44 -05:00
Brooks 8ff511e8fa
Moves create_and_canonicalize_directories() into accounts-db utils (#34882) 2024-01-23 06:46:27 -05:00
Tyera 8aa726bfdf
Define epoch-rewards partition data program id (#34862)
* Create new program id for epoch-rewards partition data PDAs

* Remove misleading repr attribute

* Remove storage of HasherKind

* Split up seeds
2024-01-22 19:14:29 -07:00
Brooks 098076f5ca
Uses accounts run and snapshot dir constants (#34879) 2024-01-22 19:47:58 -05:00
Brooks 2f744f1639
Moves create_all_accounts_run_and_snapshot_dirs() into accounts-db utils (#34877) 2024-01-22 18:18:43 -05:00
Brooks 8cfad7f165
Replaces fs-err in verify_snapshot_archive() (#34887) 2024-01-22 17:20:00 -05:00
Brooks 16698b19d8
Replaces fs-err in snapshot_utils fns (#34883) 2024-01-22 21:36:22 +00:00
Tao Zhu a5c470d2fb
harden bank tests (#34821)
* harden bank tests by specifying exact genesis config wrt the fee rate and rent

* rename to clarify test function, add comments
2024-01-22 13:38:56 -06:00
Brooks c264307f10
Removes get_io_error() (#34863) 2024-01-22 14:07:29 -05:00
Brooks b78d41792a
Replaces fs-err in snapshot_utils tests (#34870) 2024-01-22 06:55:32 -05:00
Brooks 90933fea75
Replaces fs-err in snapshot_bank_utils.rs (#34861) 2024-01-21 20:54:25 -05:00
Brooks 6835e10ba5
Replaces fs-err for some snapshot errors (#34837) 2024-01-19 12:53:10 -05:00
Brooks a915e2f2a0
Returns ArchiveSnapshotPackageError from archive_snapshot_package() (#34855) 2024-01-19 11:21:14 -05:00
Tao Zhu 32a3de0939
use intended lamports_per_signature for fee_structure (#34845)
use intented lamports_per_signature for fee_struture, instead of using default
2024-01-19 09:18:17 -06:00
Tao Zhu 2c0278b8b2
be explicit of test expects zero transaction fee (#34846)
be explcit of test expects 0 transaction fee
2024-01-18 18:49:39 -06:00
Pankaj Garg dfb44959fa
Cleanup after simplify_writable_program_account_check feature activation (#34840) 2024-01-18 15:36:13 -08:00
Brooks 3388507878
Replaces fs-err in remove_tmp_snapshot_archives() (#34839) 2024-01-18 17:40:45 -05:00
Brooks 10590a3bcb
Replaces fs-err for HardLinkStoragesToSnapshotErrors (#34838) 2024-01-18 16:49:49 -05:00
Brooks 8f9d9152e0
Snapshot archive uses version file from bank snapshot (#34832) 2024-01-18 14:02:24 -05:00
Brooks b53915f164
Cleans up snapshot errors (#34831) 2024-01-18 13:42:22 -05:00
Brooks d8788999a6
Removes unused snapshot errors (#34812) 2024-01-17 14:04:56 -05:00
HaoranYi 258c920cf9
fix buffer size for updateable program buffer rent exempt fee calculation (#34781)
fix buffer size for updateable program buffer rent exempt fee
calculation

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2024-01-16 09:04:56 -06:00
Tao Zhu 51eaa2b9cc
cleanup feature code after activation (#34695)
cleanup feature checking code
2024-01-12 14:28:50 -06:00
Andrew Fitzgerald be5337a839
earlier fee payer validation (#34666) 2024-01-12 08:22:39 -08:00
Tyera 4385ed11b1
Populate partitioned-rewards PDA during calculation (#34624)
* Add epoch_rewards_partition_data module

* Rename variable

* Pass hasher's parent_blockhash up to begin_partitioned_rewards

* Populate epoch rewards partition data account in begin_partitioned_rewards

* Fix method name
2024-01-11 23:15:55 -07:00
Tyera 8e2943604b
Use parent blockhash to seed EpochRewardsHasher (#34744)
* Use parent blockhash to seed rewards-partition hasher

* Make blockhash word more consistent
2024-01-11 11:21:11 -07:00
Brooks e9a6bb35e2
Removes remaining unused accounts data len bits (#34732) 2024-01-10 18:16:56 -05:00
HaoranYi 61e42cb390
Fix program buffer account rent-exempt lamport calculation (#34722)
fix program buffer size in minimul for rent exempt calculation

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2024-01-10 11:32:51 -06:00
Tao Zhu 88f8d11da2
program-test consumes some units as native (#34714)
program-test consumes some units as native;
harden a unit test wrt if builtin consumes units;
2024-01-10 09:05:30 -06:00
Justin Starry 5f74fc4f16
Update genesis processing to have a fallback collector id for tests (#34135)
* Update genesis processing to have a fallback collector id for tests

* DCOU-ify the collector id for tests parameter (#1902)

* wrap test_collector_id in DCOU

* rename param to collector_id_for_tests

* fix program test

* fix dcou

---------

Co-authored-by: Brooks <brooks@prumo.org>
2024-01-10 08:34:41 +08:00
Brooks 642a7e0acb
Moves where the TransactionExecutionDetails::accounts_data_len_delta is interpreted (#34692) 2024-01-09 17:39:42 -05:00
Brooks 38494e5956
Removes unused Bank::accounts_data_size_limit() (#34700) 2024-01-09 12:46:57 -05:00
Brooks d3690ddfc3
Removes unnecessary feature activation when testing accounts data size (#34701) 2024-01-08 19:21:02 -05:00
Brooks 40e410341a
Removes cap-accounts-data-len bits when constructing a new Bank (#34688) 2024-01-08 17:24:27 -05:00
HaoranYi 5a3a10e847
Deprecate account meta executable read/update in bpf loaders (#34194)
* use PROGRAM_OWNER + program data for account executable

mock account data with executable_meta in precompiled program and update
test_bank_hash_consistency test

pr: return const slice and add comments

pr: use ReadableAccount

use const to get rid of magic number

add featuregate disable_bpf_loader_instructions to disable bpf loader management instructions, and deprecate_executable_meta_update_in_bpf_loader to deprecate executable flag update in bpf loader

deprecate usage of executable in Account

fix a test

fix sbp bench

fix sbf program tests

add feature gate to account and borrowed account apis

fix tests

more test fixes

* restore bpf_loader v2 tests

---------

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2024-01-03 15:11:48 -06:00
Brooks de976be596
clippy: runtime lints (#34630)
```
warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
   --> runtime/src/accounts/mod.rs:483:82
    |
483 |       let min_balance = match get_system_account_kind(payer_account).ok_or_else(|| {
    |  __________________________________________________________________________________^
484 | |         error_counters.invalid_account_for_fee += 1;
485 | |         TransactionError::InvalidAccountForFee
486 | |     })? {
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
    = note: `#[warn(clippy::blocks_in_conditions)]` on by default

warning: this `let...else` may be rewritten with the `?` operator
    --> runtime/src/bank.rs:3093:21
     |
3093 | /                     let Some(vote_account) = get_vote_account(&vote_pubkey) else {
3094 | |                         return None;
3095 | |                     };
     | |______________________^ help: replace it with: `let vote_account = get_vote_account(&vote_pubkey)?;`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
     = note: `#[warn(clippy::question_mark)]` on by default

warning: this `let...else` may be rewritten with the `?` operator
    --> runtime/src/bank.rs:4778:17
     |
4778 | /                 let Some((_, account)) = accounts.get(i) else {
4779 | |                     return None;
4780 | |                 };
     | |__________________^ help: replace it with: `let (_, account) = accounts.get(i)?;`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark

    Checking solana-bench-streamer v1.18.0 (/Users/brooks/src/solana/bench-streamer)
warning: `solana-runtime` (lib) generated 3 warnings
```
2024-01-03 14:16:25 +00:00
Brooks 58170cf9bf
clippy: Fixes blocks in conditions (#34600) 2023-12-28 12:17:23 -05:00
steviez 1f7c714acf
Allow bank hash file to contain details for multiple slots (#34516)
The initial implementation only allowed for outputting details for one
bank/slot. There are several usecases that could take advantage of the
file being able to contain details for multiple banks.

So, this PR adjusts the structure to contain details about multiple
banks. Note that using a basic diff will not work for comparing the old
format to this new format. Instead, a basic transform with jq will be
necessary to do so.
2023-12-27 12:37:11 -05:00
Brooks 6b76ec1de0
Uses Bank::new_for_tests() instead of new_for_tests_with_config() (#34587) 2023-12-26 12:54:14 -05:00
Justin Starry 88af74d1d0
refactor: optional `stake_history` arg is never `None` (#34556)
refactor: optional stake_history arg is never none
2023-12-22 10:44:28 +08:00
GoodDaisy 03386cc7b9
Fix typos (#34459)
* Fix typos

* Fix typos

* fix typo
2023-12-21 13:06:00 -07:00