Commit Graph

1223 Commits

Author SHA1 Message Date
Nicholas Clarke ee0a40937e
Add validator argument log_messages_bytes_limit to change log truncation limit.
Add new cli argument log_messages_bytes_limit to solana-validator to control how long program logs can be before truncation
2022-07-11 10:53:18 -05:00
behzad nouri ba785cf8ab
removes erroneous uses of std::mem::swap (#26536)
All instances should be replace by std::mem::{replace,take},
or just plain assignment.
2022-07-11 11:33:15 +00:00
Jeff Washington (jwash) 602da5e51f
add accounts db config to bank tests (#26517) 2022-07-10 19:42:06 -05:00
Jeff Washington (jwash) 1babf460ab
collapse some bank test creation fns (#26532) 2022-07-10 17:51:38 -05:00
behzad nouri 105c7e19e1
moves check for feature activation out of accounts loop (#26535) 2022-07-10 17:39:19 +00:00
Jeff Washington (jwash) 8576832f2a
rename Bank::new_with_config_for_tests (#26533) 2022-07-10 09:33:13 -05:00
Brooks Prumo 785a7a5936
Track more accounts data size changes (#26467) 2022-07-08 19:17:15 -05:00
behzad nouri c99d9f00a9
preserves rent_epoch for rent exempt accounts (#26479)
https://github.com/solana-labs/solana/pull/22292
prevents rent paying account creation going forward. As a result
rent_epoch field for rent exempt accounts is redundant, and advancing
this field will incur expensive account rewrites and cause discrepancy
between accounts-db and cached vote/stake accounts.

This commit adds a feature which upon activation preserves rent_epoch
field for rent exempt accounts so that the field is frozen and is no
longer advanced.
2022-07-08 20:04:08 +00:00
Brooks Prumo 78b8a8a6db
Remove `get_total_resize_remaining()` and `total_resize_limit` from `TransactionContext` (#26504) 2022-07-08 20:26:54 +02:00
Brooks Prumo 3b759bcffb
Add fn to get max accounts data size from Bank (#26478) 2022-07-07 18:08:42 -05:00
Jeff Washington (jwash) 8e64b5883e
restore population of 'accounts' metric in rent collection (#26454) 2022-07-07 13:19:23 -05:00
Justin Starry 8416090732
Clean up `enable_durable_nonce` feature (#26470)
Clean up enable_durable_nonce feature
2022-07-07 17:14:46 +01:00
Justin Starry eb6a722eba
Clean up `nonce_must_be_writable` feature (#26444)
Clean up nonce_must_be_writable feature
2022-07-07 15:45:19 +01:00
Brooks Prumo f8bdedb596
Make accounts data size tests more robust (#26466) 2022-07-07 00:01:13 -05:00
carllin 90ef2cd02a
Parse snapshot for bank fields (#26016) 2022-07-06 17:30:30 -05:00
behzad nouri d7201a8d1a
names fields in RentResullt::CollectRent enum variant (#26449)
Avoiding ambiguous raw tuple:
    CollectRent((Epoch, u64))

Using named fields instead:
    CollectRent {
        new_rent_epoch: Epoch,
        rent_due: u64,
    },
2022-07-06 20:01:16 +00:00
Justin Starry f4718be22f
Clean up `leave_nonce_on_success` feature (#26447)
Clean up leave_nonce_on_success feature
2022-07-06 17:59:34 +00:00
Justin Starry ff1e6fcbed
Clean up `nonce_must_be_advanceable` feature (#26446)
Clean up nonce_must_be_advanceable feature
2022-07-06 17:36:33 +00:00
Alexander Meißner 06ebfa1eb2
Replicates `AccountsDataMeter` in `TransactionContext` (#26438)
Replicates AccountsDataMeter in TransactionContext.
2022-07-06 19:27:42 +02:00
Justin Starry 611ac33718
Clean up `nonce_must_be_authorized` feature (#26445)
Clean up nonce_must_be_authorized feature
2022-07-06 17:17:31 +00:00
Jeff Washington (jwash) 17a99d98dd
Revert "avoid adding to 'uncleaned_roots' when generating index and c… (#26441)
Revert "avoid adding to 'uncleaned_roots' when generating index and caller passes accounts-db-skip-shrink (#25936)"

This reverts commit e24cc537a4.
2022-07-06 11:32:45 -05:00
Justin Starry f8dccd4602
Clean up `max_tx_account_locks` feature (#26440)
Clean up max_tx_account_locks feature
2022-07-06 15:06:03 +00:00
behzad nouri 6f5857a5db
removes feature gate code separating durable nonce from blockhash domain (#26055) 2022-07-06 12:03:13 +00:00
carllin ce39c14025
Add end-to-end replay slot metrics (#25752) 2022-07-05 13:58:51 -05:00
Jeff Washington (jwash) 5f3b7bdd16
prevent ledger tool from calculating hash on non-rooted slots (#26355) 2022-07-02 11:50:01 -05:00
Jack May 4563bf40f6
cleanup feature: tx-wide-compute-cap (#26326) 2022-06-29 23:54:45 -07:00
behzad nouri d053ce79d4
removes RwLock+Once in favor of OnceCell in caching staked-nodes (#26313)
VoteAccounts uses std::sync::{RwLock, Once} to lazily compute and cache
staked_nodes:
https://github.com/solana-labs/solana/blob/032bee13a/runtime/src/vote_account.rs#L89-L104

This commit instead switches to using once_cell::sync::OnceCell which
provides this exact intended functionality by design.
2022-06-29 22:22:22 +00:00
Jeff Washington (jwash) 557bf6e656
allow initial hash calc to occur in bg (#26271)
* allow initial hash calc to occur in bg

* validator_initialized -> startup_verification_complete

* add infos for leader and vote

* rework snapshot for startup verification

* change to assert
2022-06-29 16:48:33 -05:00
Jeff Washington (jwash) 2deb396490
remove noisy and useless 'error!' and add test (#26138) 2022-06-29 16:26:23 -05:00
behzad nouri af7f08eba4
uses OnceCell instead of RwLock+Once to cache vote-state in vote-account (#26257)
RwLock seems excessive since only the very 1st call to VoteAccount::vote_state
will write-lock the inner field. Future calls would also incur overhead of an
RwLockReadGuard.
once_cell::sync::OnceCell provides a matching api to the desired functionality.
2022-06-29 11:45:53 +00:00
Jeff Washington (jwash) d8516b5c88
comment and expand on test (#26231) 2022-06-27 11:35:46 -05:00
Brooks Prumo 662818ef0d
Use `VoteAccount::node_pubkey()` (#26207) 2022-06-27 09:09:06 -05:00
Jeff Washington (jwash) cbefc581c0
test_rent_collect_rent_from_accounts (#26204) 2022-06-25 19:04:28 -05:00
Justin Starry 0ca963a869
Refactor: Add separate methods for retrieving stake info from VoteAccounts (#26224) 2022-06-25 20:03:15 +00:00
Justin Starry 44d1e62007
Refactor: No need to return stake in Bank::get_vote_account (#26220) 2022-06-25 16:27:43 +00:00
Jeff Washington (jwash) 18397527ad
retain prior metric behavior for invalid_cached_stake_accounts (#26181) 2022-06-24 14:12:16 -05:00
Jeff Washington (jwash) 054b25729d
eliminate vec creation in stake rewards (#26191) 2022-06-24 13:40:53 -05:00
HaoranYi fbcb4d8216
extract get_stake_reward fn from StakeReward (#26183) 2022-06-24 08:44:48 -05:00
Brooks Prumo 877fedadac
Remove StatusCacheRc type and use StatusCache directly (#26184) 2022-06-24 08:38:56 -05:00
Jeff Washington (jwash) a36abfda28
don't skip rewrite when account was written IN the current slot already (#26197) 2022-06-24 07:28:37 -05:00
Brooks Prumo 23c50a2389
Add StatusCache::root_slot_deltas() and use it (#26170) 2022-06-23 15:19:06 -05:00
Jeff Washington (jwash) 102fb98070
impl StorableAccounts for [StakeReward] (#26165) 2022-06-23 08:34:28 -05:00
Jeff Washington (jwash) 19b79aa764
add metrics for invalid_cached_stake_accounts_rent_epoch (#26143) 2022-06-23 08:33:24 -05:00
Jeff Washington (jwash) 9db44ce352
cleanup some AccountSharedData::from(Account (#26120) 2022-06-23 08:32:48 -05:00
Jeff Washington (jwash) aea75e82e3
Bank::store_accounts takes StorableAccounts (#26113) 2022-06-22 21:11:01 -05:00
Jeff Washington (jwash) a32523c43b
cleanup some tests (#26139) 2022-06-22 21:10:46 -05:00
HaoranYi c4efb9f19e
Stake cache size (#26071)
* reduce threadpool for stake processing

* wip

* Revert "reduce threadpool for stake processing"

This reverts commit 004a4f872ea7a3ef53e38d145b6350c3f57c680c.

* batch update stake_cache

* fix deadlock

* add test

* code review feedbacks

* more review feedbacks

* fix conflicts

* report stake account len and vote account len at epoch boundary

* report num_staked_nodes

* remove batch store, no atomic for redeem timing
2022-06-22 16:22:22 -05:00
Jeff Washington (jwash) c5c2b44ecc
adjust cached stake account compare for rent_epoch (#26135) 2022-06-22 15:11:25 -05:00
apfitzge f4189c0305
ledger-tool minimized snapshots (#25334)
* working on local snapshot

* Parallelization for slot storage minimization

* Additional clean-up and fixes

* make --minimize an option of create-snapshot

* remove now unnecessary function

* Parallelize parts of minimized account set generation

* clippy fixes

* Add rent collection accounts and voting node_pubkeys

* Simplify programdata_accounts generation

* Loop over storages to get slot set

* Parallelize minimized slot set generation

* Parallelize adding owners and programdata_accounts

* Remove some now unncessary checks on the blockstore

* Add a warning for minimized snapshots across epoch boundary

* Simplify ledger-tool minimize

* Clarify names of bank's minimization helper functions

* Remove unnecesary funciton, fix line spacing

* Use DashSets instead of HashSets for minimized account and slot sets

* Filter storages uses all threads instead of thread_pool

* Add some additional comments on functions for minimization

* Moved more into bank and parallelized

* Update programs/bpf/Cargo.lock for dashmap in ledger

* Clippy fix

* ledger-tool: convert minimize_bank_for_snapshot Measure into measure!

* bank.rs: convert minimize_bank_for_snapshot Measure into measure!

* accounts_db.rs: convert minimize_accounts_db Measure into measure!

* accounts_db.rs: add comment about use of minimize_accounts_db

* ledger-tool: CLI argument clarification

* minimization functions: make infos unique

* bank.rs: Add test_get_rent_collection_accounts_between_slots

* bank.rs: Add test_minimization_add_vote_accounts

* bank.rs: Add test_minimization_add_stake_accounts

* bank.rs: Add test_minimization_add_owner_accounts

* bank.rs: Add test_minimization_add_programdata_accounts

* accounts_db.rs: Add test_minimize_accounts_db

* bank.rs: Add negative case and comments in test_get_rent_collection_accounts_between_slots

* bank.rs: Negative test in test_minimization_add_programdata_accounts

* use new static runtime and sdk ids

* bank comments to doc comments

* Only need to insert the maximum slot a key is found in

* rename remove_pubkeys to purge_pubkeys

* add comment on builtins::get_pubkeys

* prevent excessive logging of removed dead slots

* don't need to remove slot from shrink slot candidates

* blockstore.rs: get_accounts_used_in_range shouldn't return Result

* blockstore.rs: get_accounts_used_in_range: parallelize slot loop

* report filtering progress on time instead of count

* parallelize loop over snapshot storages

* WIP: move some bank minimization functionality into a new class

* WIP: move some accounts_db minimization functionality into SnapshotMinimizer

* WIP: Use new SnapshotMinimizer

* SnapshotMinimizer: fix use statements

* remove bank and accounts_db minimization code, where possible

* measure! doesn't take a closure

* fix use statement in blockstore

* log_dead_slots does not need pub(crate)

* get_unique_accounts_from_storages does not need pub(crate)

* different way to get stake accounts/nodes

* fix tests

* move rent collection account functionality to snapshot minimizer

* move accounts_db minimize behavior to snapshot minimizer

* clean up

* Use bank reference instead of Arc. Additional comments

* Add a comment to blockstore function

* Additional clarifying comments

* Moved all non-transaction account accumulation into the SnapshotMinimizer.

* transaction_account_set does not need to be mutable now

* Add comment about load_to_collect_rent_eagerly

* Update log_dead_slots comment

* remove duplicate measure/print of get_minimized_slot_set
2022-06-22 13:17:43 -04:00
Jeff Washington (jwash) cf5ec13f59
Accounts::store_accounts_cached uses StorableAccounts (#26112) 2022-06-22 12:13:56 -05:00