Commit Graph

1430 Commits

Author SHA1 Message Date
Jeff Washington (jwash) 67c7e343a2
test permutations of set_exempt_rent_epoch_max (#29461) 2023-01-02 11:59:50 -08:00
Jeff Washington (jwash) cf1aa4beea
feature: set rent_epoch to Epoch::MAX (#28690)
* check android builds

* feature: set rent_epoch to Epoch::MAX

* tweaks

* Update runtime/src/rent_collector.rs

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

* simplify changes to tests

* back out some test changes

* calculate_rent_result passes through Exempt

* move calc outside loop

* if rent epoch is already max, use 'NoRentCollectionNow'

Co-authored-by: Brooks Prumo <brooks@prumo.org>
2023-01-02 07:51:08 -08:00
Tyera 1e0d3931fd
Fix "tranaction" typo in code base (#29347)
Fix typos
2022-12-21 18:02:36 -07:00
Jeff Washington (jwash) 3e649d2aa0
remove add_root(caching_enabled) (#29245) 2022-12-13 11:26:28 -08:00
Jeff Washington (jwash) b779134020
remove process_stale_slot_with_budget (#29236) 2022-12-13 07:50:14 -08:00
Jeff Washington (jwash) 5983363b03
remove test_store_scan_consistency(caching_enabled) (#29233) 2022-12-13 07:18:55 -08:00
Jeff Washington (jwash) ceeec9d625
remove enable_caching from Bank::new_with_config_for_tests (#29215) 2022-12-12 15:33:12 -08:00
Jeff Washington (jwash) 2c2324f4ea
remove caching_enabled from Bank::new_with_paths_for_tests (#29214) 2022-12-12 15:30:46 -08:00
Jeff Washington (jwash) dd4393e46d
remove accounts_caching from Bank::new_with_paths (#29213) 2022-12-12 15:18:12 -08:00
Jeff Washington (jwash) 536b879aa7
remove accounts.new_with_config_for_tests.caching_enabled (#29168) 2022-12-12 11:31:51 -08:00
Jeff Washington (jwash) 7b1d00ee80
remove dead just_rewrites (#29188) 2022-12-12 10:04:16 -08:00
Jeff Washington (jwash) db2cc53967
remove skip rewrites from bank (#29182) 2022-12-10 09:27:15 -08:00
Brooks Prumo 5f74fb9c87
Removes erroneous duplicate `#[ignore]` (#29193) 2022-12-09 20:58:22 -05:00
Jeff Washington (jwash) f9c4170d34
remove caching_enabled (#29117)
* warp_from_parents works with write_cache enabled

* remove caching_enabled
2022-12-09 14:31:54 -08:00
Jeff Washington (jwash) 631a98a3b6
warp_from_parents works with write_cache enabled (#29185) 2022-12-09 14:28:18 -08:00
Jeff Washington (jwash) 04c10a9382
panic on process_stale_slot_with_budget and remove test (#29045) 2022-12-09 13:25:34 -08:00
Jeff Washington (jwash) a3c95eaa53
remove BankTestConfig.caching_enabled (#29173) 2022-12-09 11:52:36 -08:00
Jeff Washington (jwash) ec5098a723
remove bank_test_config_caching_enabled (#29170) 2022-12-09 08:28:02 -08:00
Jeff Washington (jwash) 2f4731570a
ledger-tool create-snapshot uses write cache (#29119)
* ledger-tool create-snapshot uses write cache

* ledger tool create snapshot works with write cache
2022-12-08 06:09:52 -08:00
Jeff Washington (jwash) 019f276a91
test_shrink_candidate_slots_cached works with write cache (#29143) 2022-12-08 06:08:31 -08:00
behzad nouri 9524c9dbff patches errors from clippy::uninlined_format_args
https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
2022-12-06 19:32:15 +00:00
Jeff Washington (jwash) b4075a0e29
bank tests use write cache (#28885) 2022-12-05 14:08:28 -08:00
Jeff Washington (jwash) 293a5860b8
test_process_stale_slot_with_budget never uses write cache (#29076) 2022-12-05 11:40:14 -08:00
Jeff Washington (jwash) 1036d4409b
test_verify_snapshot_bank works without write cache (#29075) 2022-12-05 11:00:01 -08:00
Brooks Prumo c65a8ce6c3
AccountsDb::get_snapshot_storages() takes a Range for slots (#29054) 2022-12-05 11:21:21 -05:00
Jeff Washington (jwash) babc241345
tests use write cache (#29027)
* test_add_precompiled_account uses write cache

* test_add_precompiled_account_squatted_while_not_replacing uses write cache
2022-12-02 10:26:51 -08:00
Jeff Washington (jwash) 5104f4ef0d
test_bank_update_vote_stake_rewards works with write cache (#29044) 2022-12-02 10:19:43 -08:00
Jeff Washington (jwash) 00ba78bd2d
test_bank_update_rewards_determinism works with write cache (#29043) 2022-12-02 09:56:58 -08:00
Jeff Washington (jwash) 6852d5768a
test_add_builtin_account* works with write cache (#29030) 2022-12-02 09:48:21 -08:00
Jeff Washington (jwash) 87a3130226
test_bank_hash_internal_state works with write cache (#29042) 2022-12-02 09:37:22 -08:00
Jeff Washington (jwash) d17a740a99
test_bank_hash_internal_state_verify works with write cache (#29041) 2022-12-02 09:22:42 -08:00
Jeff Washington (jwash) 63e19c0068
do_test_clean_dropped_unrooted_banks uses write cache (#29029) 2022-12-02 08:04:57 -08:00
Jeff Washington (jwash) 911a8d2a4a
test_add_instruction_processor_for_existing_unrelated_accounts works with write cache (#29031) 2022-12-02 08:04:34 -08:00
Jeff Washington (jwash) 20aeff3632
test_purge_empty_accounts uses write cache (#29018) 2022-12-01 15:22:26 -08:00
Jeff Washington (jwash) dbd6ce8f21
test_bank_update_sysvar_account uses write cache (#29022)
* test_add_precompiled_account_inherited_cap_while_replacing uses write cache

* test_bank_update_sysvar_account uses write cache
2022-12-01 15:21:05 -08:00
Jeff Washington (jwash) a9c8f26a66
test_add_precompiled_account_inherited_cap_while_replacing uses write cache (#29019) 2022-12-01 14:07:39 -08:00
Brooks Prumo 9327658007
Promotes accounts hash to a strong type (#28930) 2022-11-28 10:09:47 -05:00
Brooks Prumo 04016e3bcf
Don't wait for EAH unless feature is enabled (#28938) 2022-11-23 09:11:28 -05:00
Jeff Washington (jwash) 5d88a9b32b
improve perf of storing accounts for shrink/ancient (#28880)
* improve perf of storing accounts for shrink/ancient

* rename

* phantom data

* update comment

* make impl Borrow<Hash> consistent

* remove unused static
2022-11-22 15:36:57 -08:00
Jeff Washington (jwash) f22104d46b
use write cache by default in some tests (#28876) 2022-11-18 14:35:52 -08:00
Brooks Prumo 7787cb2ab2
Renames BankHashInfo field to accounts_delta_hash (#28878) 2022-11-18 15:35:03 -05:00
Justin Starry 7371608722
Support versioned transactions in program test framework (#28739)
* Support versioned transactions in program test framework

* use working bank

* Update to process_transaction_with_metadata

* Migrate client apis from Transaction to Into<VersionedTransaction>

* feedback
2022-11-18 23:43:52 +08:00
Trent Nelson 53a579bed1 ledger-tool: stream output of `accounts` subcommand 2022-11-17 12:45:26 -07:00
K-anon e8c8235474
Get Index Key Size RPC Support (#28383)
Co-authored-by: K-anon <IntokuSatori@users.noreply.github.com>
2022-11-16 20:39:11 -07:00
Tao Zhu ae48ac97dd
fix account resize test by requesting max tx data size (#28826)
* fix account resize test by requesting max tx data size
* define data size limit in incremental of 1024
2022-11-16 17:52:15 -06:00
Brooks Prumo c1e440acb6
Warping calculates and sets new EAH (#28809) 2022-11-15 23:16:38 -05:00
behzad nouri 28956d7653
removes feature gate code preventing crediting accounts that end rent paying (#28818) 2022-11-15 19:55:34 +00:00
Brooks Prumo d798e751a0
Disables EAH with short epochs (#28803) 2022-11-15 13:26:19 -05:00
Brooks Prumo ac9b11762a
Lowers test's account data size to avoid hitting MaxLoadedAccountsDataSizeExceed (#28814) 2022-11-15 16:52:35 +00:00
Jeff Washington (jwash) 84cfdf23fc
remove LoadedAccount::stored_size (#28802) 2022-11-15 05:47:12 -08:00
Brooks Prumo 503da50f2c
Verifies EAH in SnapshotHash (#28775) 2022-11-14 16:02:08 -05:00
Brooks Prumo 0bfea02056
Snapshots wait for EAH calculations to complete (#28777) 2022-11-14 11:34:44 -06:00
Tao Zhu 81dc2e56ac
Cap accounts data a transaction can load by its requested limit (#27840)
- Add new compute-budget instruction to set transaction-wide accounts data size limit
- Set default accounts data limit to 10MB, and max to 100MB, per transaction;
- Add getters to make changing default and/or max values easier in the future with feature gates;
- added error counter for transactions exceed data size limit
2022-11-14 10:29:35 -06:00
Alexander Meißner 4142f42319
Refactor - Move `Executor` in program-runtime crate (#28782)
* Moves CreateMetrics into the program-runtime crate.

* Moves the Executor trait into executor.rs

* Removes the first_instruction_account parameter from Executor::execute().
2022-11-10 21:11:00 +01:00
Brooks Prumo d1ba42180d
clippy for rust 1.65.0 (#28765) 2022-11-09 19:39:38 +00:00
Brooks Prumo 0a62f01cab
Removes EAH string from datapoint metric (#28724) 2022-11-02 14:14:08 -04:00
behzad nouri 17680fe837
removes feature gate code preserving rent_epoch for rent exempt accounts (#28507)
* removes feature gate code preserving rent_epoch for rent exempt accounts

* update test expected hashes

Co-authored-by: jeff washington <jeff.washington@solana.com>
2022-11-01 13:36:59 +00:00
Brooks Prumo 59bf1809fe
Uses SnapshotHash type in snapshot archive fields (#28681) 2022-10-31 14:28:35 -04:00
Brooks Prumo bfa62da29e
Renames variant to CalcAccountsHashDataSource::IndexForTests (#28623) 2022-10-29 08:55:33 -04:00
Brooks Prumo 2ebf248f47
Renames fn to Bank::update_accounts_hash() (#28619) 2022-10-28 17:31:16 -04:00
Brooks Prumo 5a3d252899
Renames fn to Bank::update_accounts_hash_for_tests() (#28620) 2022-10-28 14:33:05 -04:00
steviez 7b70aef33c
Add help text to genesis creation time assert (#28629)
If a validator starts with a snapshot from the wrong cluster, an assert
will trigger complaining about the genesis_creation_time encoded in the
snapshot differing from the genesis_creation_time embedded in
genesis.bin.

This could be a fairly easy mistake to make so add a help string to the
assertion to point operators in the right direction.
2022-10-27 18:02:36 +02:00
Brooks Prumo 27269d833c
Uses enum for data source with calc_accounts_hash() (#28584) 2022-10-26 13:04:01 -04:00
Justin Starry 2d8665d307
Record inner instruction stack height (#28430)
* Record inner instruction stack height

* fix sbf tests

* feedback
2022-10-26 10:37:44 +08:00
Brooks Prumo 1dbcb78de7
Renames fn to update_accounts_hash() (#28574) 2022-10-25 16:43:19 -04:00
Jeff Washington (jwash) 8a538f8da5
skip_rewrite skips almost all accounts with no rent (#28552) 2022-10-24 11:48:00 -07:00
Ashwin Sekar f207af765e
Split out voting and banking threads in banking stage (#27931)
* Split out voting and banking threads in banking stage

Additionally this allows us to aggressively prune the buffer for voting threads
as with the new vote state only the latest vote from each validator is
necessary.

* Update local cluster test to use new Vote ix

* Encapsulate transaction storage filtering better

* Address pr comments

* Commit cargo lock change

* clippy

* Remove unsafe impls

* pr comments

* compute_sanitized_transaction -> build_sanitized_transaction

* &Arc -> Arc

* Move test

* Refactor metrics enums

* clippy
2022-10-20 21:10:48 +00:00
Trent Nelson cb7fe87abb bank: factor accumulation out to helper on `TotalAccountsStats` 2022-10-20 10:50:51 -07:00
Alexander Meißner 5aca7df232
Bank::create_executor() (#28474)
* Moves the integration test test_bpf_loader_upgradeable_deploy_with_max_len() from the bpf_loader into the runtime.

* Adds Bank::create_executor().

* Adds a test for Bank::create_executor().
2022-10-19 22:28:57 +02:00
Jeff Washington (jwash) fd2e671861
remove slot# from account hash (#28405)
* remove slot# from account hash

* add feature

* fix tests

* constants to help clarify 'irrelevant' changes

* move to enum for enforcing irrelevancy

* ignore unsupported tests
2022-10-18 08:03:37 -07:00
Justin Starry 70445b7402
Refactor: Rename `max_invoke_depth` to `max_invoke_stack_height` (#28427)
Refactor: Rename max_invoke_depth to max_invoke_stack_height
2022-10-17 23:54:56 +08:00
Jeff Washington (jwash) 28a89a1d99
remove expected rent collection and rehashing completely (#28422) 2022-10-17 07:24:42 -07:00
Alexander Meißner 664339e239
Refactor - executor_cache (#28332)
* Renames CachedExecutors => BankExecutorCache.

* Renames TransactionExecutor => TransactionExecutorCacheEntry.

* Renames TransactionExecutorStatus => TxBankExecutorCacheDiff.

* Adds TransactionExecutorCache.

* Renames the items of TxBankExecutorCacheDiff.
2022-10-12 18:09:03 +02:00
Ian Macalinao cdf77bb824
runtime: fix typo 'transaction' (#27948) 2022-10-11 07:47:10 -07:00
Alexander Meißner 2fc8e533a2
Refactor - Move `executor_cache` to program-runtime crate (#28322)
* Moves CachedExecutors, related structs, consts and tests into the program-runtime crate.

* Moves TransactionExecutor, related enum and type defs into executor_cache mod.
2022-10-10 15:01:41 +02:00
Tao Zhu 0324573667
report additional transaction errors to metrics (#28285) 2022-10-07 10:36:22 -05:00
Jeff Washington (jwash) 435d4aded9
run initial hash calc in background, using background threads (#28239) 2022-10-05 19:42:06 -07:00
Brooks Prumo a8c6a9e5fc
Bank::freeze() waits for EAH calculation to complete (#28170) 2022-10-05 17:44:35 -04:00
Brooks Prumo 2f8f6c6a31
Send Epoch Accounts Hash requests from set_root() (#27764) 2022-09-30 14:59:41 -04:00
Jeff Washington (jwash) cfc124c825
acct idx can no longer use write cache (#28150) 2022-09-30 10:55:27 -07:00
Brooks Prumo e6b237c2e8
eah: Add log in bank (#28110) 2022-09-28 14:45:42 -04:00
Brooks Prumo 4d02292931
Use epoch_accounts_hash::calculation_stop() (#28106) 2022-09-28 09:11:18 -04:00
Alexander Meißner 71aee4fcaf
Feature: Explicitly limit `TransactionContext::instruction_trace_capacity` (#27938)
* Renames instruction_stack_capacity => instruction_stack_capacity.

* Replaces number_of_instructions_at_transaction_level by instruction_trace_capacity.

* Adds MaxInstructionTraceLengthExceeded.

* Adjusts TransactionContext::new() parameter.

* Adds feature gate limit_max_instruction_trace_length.

* Adds test_max_instruction_trace_length().
2022-09-26 10:47:16 +02:00
Alessandro Decina b9f4c8e3c0
BorrowedAccount: add set_data_from_slice(), make set_data() take owned values (#27836)
* BorrowedAccount: add set_data_from_slice(), make set_data() take owned values

set_data() used to take a slice and would force alloc+copy if the caller
has owned values (eg account creation, account lookup table).

Expose set_data_from_slice() for callers that have slices, and switch
set_data() to taking an owned Vec.

* BorrowAccount: refactor common accounts_update_delta code in helper method

* BorrowedAccount: add extend_from_slice()

This allows avoiding copies appending entries to account lookup tables.

* BorrowedAccount: remove unnecessary ifs around update_accounts_resize_delta
2022-09-24 01:37:02 +01:00
behzad nouri 9ee53e594d
patches clippy errors from new rust nightly release (#28028) 2022-09-23 20:57:27 +00:00
Michael Vines fb686cc83b Nodes with 0% commission are now included in the `getBlock` RPC method `rewards` response field. 2022-09-22 20:31:41 -07:00
behzad nouri 9a57c64f21
patches clippy errors from new rust nightly release (#27996) 2022-09-22 22:23:03 +00:00
Brooks Prumo 1ee595ca9c
remove AccountsDb::initial_blockstore_processing_complete (#27974) 2022-09-22 13:52:04 -04:00
Ian Macalinao ab8b3386a1
runtime: fix typo for 'exempt' (#27947) 2022-09-20 16:58:57 -06:00
Ian Macalinao aa52b8aec1
runtime: fix 'governed' typo (#27946) 2022-09-20 13:05:13 -06:00
Jeff Washington (jwash) f2d6a7ecea
bank.initial_blockstore_processing_complete to avoid concurrent hash calculations (#27776)
* bank.initial_blockstore_processing_complete to avoid concurrent hash calculations

* Update runtime/src/bank.rs

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

* Update runtime/src/bank.rs

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

* Rename TestValidator::set_startup_verification_complete()

* Initialize with `AtomicBool::new(false)` instead of `default()`

* snapshot tests: move where `initial_blockstore_processing_completed()` is called

* fixup bank_forks.rs calling `is_initial_blockstore_processing_complete()`

* only call initial_blockstore_processing_completed() in blockstore_processor

Co-authored-by: Brooks Prumo <brooks@prumo.org>
Co-authored-by: Brooks Prumo <brooks@solana.com>
2022-09-19 13:00:21 -07:00
Ian Macalinao c237f15295
runtime: ParitalEq -> PartialEq (#27900) 2022-09-17 21:55:29 -06:00
Ian Macalinao 8c24840247
runtime: compleleted -> completed (#27901) 2022-09-17 21:53:57 -06:00
Jeff Washington (jwash) 1db7da5c32
pass enable_rehashing to verify_bank_hash_and_lamports (#27827) 2022-09-17 06:09:06 -07:00
Justin Starry b9700244b5
Increase transaction account lock limit from 64 to 128 (#27242)
* Increase transaction account lock limit from 64 to 256

* fix bpf test

* Reduce lock limit from 256 to 128
2022-09-15 13:50:14 -04:00
Jeff Washington (jwash) 3a47dfb8e6
add bank.bank_enable_rehashing_on_accounts_hash (#27768) 2022-09-14 11:29:23 -07:00
Jeff Washington (jwash) 416b45ac0f
calculate_capitalization gets 'enable_rehashing' (#27767) 2022-09-14 06:52:18 -07:00
Jeff Washington (jwash) d242c0fc97
pass 'enable_rehashing' through all accounts hash functions (#27701) 2022-09-12 12:18:09 -07:00
Jeff Washington (jwash) 765c628546
use exit signal for acct idx bg threads (#27483) 2022-09-12 11:51:12 -07:00
Christian Kamm 90b8a3a44d
Remove KeypairInsecureClone trait and add insecure_clone() instead (#27396)
See discussion in #26248
2022-09-12 14:59:41 +00:00