Commit Graph

3032 Commits

Author SHA1 Message Date
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 7cd7173b71
Refactor: Add get_delegated_stake method to VoteAccounts (#26221) 2022-06-25 16:41:35 +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
behzad nouri 2efdb965dd
encapsulates AuthorizeNonceAccount implementation in the nonce module (#26202)
Follow up commit removes feature gate code separating durable nonce from
blockhash domain. This commit allows to encapsulate any logic
distinguishing legacy vs current nonce versions in the nonce module
after removing the feature gate.
2022-06-25 12:17:39 +00:00
Jeff Washington (jwash) a3395a786a
vote_account uses AccountSharedData to avoid copies (#23687)
* vote_account uses AccountSharedData to avoid copies

* simpler deserialize
2022-06-24 15:08:01 -05:00
Nicholas Rempel 2b21c1da29 Sort Cargo.toml files 2022-06-24 12:41:38 -07: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
apfitzge 4a729effff
Bugfix/test get rent collection accounts remove random account (#26178)
* Use default GenisisConfig so we don't have a random account

* Formatting
2022-06-24 09:22:50 -04: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 5b842669e7
Remove InMemAccountsIndex::map() and use map_internal directly (#26189) 2022-06-23 15:55:35 -05:00
Brooks Prumo 23c50a2389
Add StatusCache::root_slot_deltas() and use it (#26170) 2022-06-23 15:19:06 -05:00
apfitzge 7efd05f7b3
Change get_pubkeys to match the new enum (#26177) 2022-06-23 11:56:09 -05:00
Boqin Qin(秦 伯钦) 355e09e1fb
runtime: fix possible deadlock in in_mem_accounts_index (#26046) 2022-06-23 11:35:47 -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
Brooks Prumo 7d29c26315
Remove auto traits from ICE work-around (#26098) 2022-06-23 07:22:30 -05:00
Brooks Prumo a5cf72e446
StatusCache::roots() returns `Slot`s not `u64`s (#26164) 2022-06-23 07:03:09 +00:00
github-actions[bot] 5c2f819f99
Bump Version to 1.11.2 (#26159) 2022-06-22 21:16:18 -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
ivandzen 1ea6a2cb91
Extended interface for AccountOverrides (#25964)
* Extended interface for AccountOverrides

* fix checker issue

* make accounts private

Co-authored-by: Ivan Loboda <lobodatell@yandex.ru>
2022-06-22 15:22:31 -04: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
Michael Vines f3639b76ce Remove some clippy lints 2022-06-22 09:23:22 -07:00
HaoranYi 5624ab0d4c
Optimize stake accounts store (#26004)
* 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

* clippy

* update comments

* fix conflicts

* remove batch store, no atomic for redeem timing

* refactor stake_reward struct
2022-06-22 10:45:58 -05:00
Jeff Washington (jwash) 8e2bae7bf9
batch insert updates stat count correctly (#26107) 2022-06-22 08:45:42 -05:00
Jeff Washington (jwash) d3829b1a76
store_cached takes StorableAccounts to eliminate collect (#26109) 2022-06-22 08:45:03 -05:00
Brooks Prumo 8a18e02f80
Call StatusCache::append() directly (#26125) 2022-06-22 07:42:01 -05:00
Brooks Prumo 31c9b03049
Remove unused SignatureConfirmationStatus (#26124) 2022-06-22 07:41:22 -05:00
Brooks Prumo 97bd81a32b
Add bench for StatusCache::slot_deltas() (#26123) 2022-06-22 07:41:06 -05:00
Brooks Prumo d35c1a7d04
Use BankStatusCache in bank.rs (#26114) 2022-06-21 23:16:16 +00:00
Jeff Washington (jwash) 43e0d29b18
Revert "fix double count of account index del stats (#25797)" (#26103)
This reverts commit 05cb25d8da.
2022-06-21 14:05:26 -05:00
Jeff Washington (jwash) 7a3dc3a57b
remove unused param (#26096) 2022-06-21 13:10:41 -05:00
Will Hickey 51f26dc96e
Bump version to 1.11.1 (#26104) 2022-06-21 12:07:46 -05:00
Boqin Qin(秦 伯钦) 95ea506d75
runtime: fix double-readlock in in_mem_accounts_index.rs (#26047) 2022-06-20 15:44:19 +01:00
Tyera Eulberg 752c851070
Clean up feature preventing new rent-paying accounts (#26000)
* Clean up require_rent_exempt_accounts feature

* Fix tests in bank_client, system_instruction_processor

* Fix tests in snapshot_utils

* Fix bank tests

* Ignore rent tests

* Fix stake-accounts tests
2022-06-16 15:35:25 -06:00
Alexander Meißner bf9ca9827e
Refactor: instruction account index (#25825)
* Adds methods based on instruction_account_index to InstructionContext.
Removes methods which are based on index_in_instruction.

* Adjusts program-runtime.

* Adjusts runtime.

* Adjusts bpf loader.

* Adjusts built-in programs.

* Adjusts program-test and bpf tests.
2022-06-16 18:46:17 +02:00
Brooks Prumo 54675b2dd6
Add bank tests for accounts_data_size and resize transactions / rent collection (#25884) 2022-06-15 19:40:43 -05:00
Jeff Washington (jwash) b02c412d5b
generate_index straight to disk and batched (#25947)
* generate_index straight to disk and batched

* renames and comments

* handle in-mem case correctly

* use mutex
2022-06-15 18:14:39 -05:00
Jeff Washington (jwash) 631ea93259
parallel rent collection avoids overlapping ranges (#25991) 2022-06-15 16:04:38 -05:00
Tyera Eulberg 99cf1e280e
Clean up warp-timestamp features (#25994) 2022-06-15 14:11:41 -06:00
Jeff Washington (jwash) 80f90d6e96
disable logging per thread on rent collection load (#25982) 2022-06-15 13:16:00 -05:00
apfitzge e1efc5bebb
append_vec.rs: remove new_empty_map (unused) (#25885) 2022-06-15 08:59:46 -05:00
Jeff Washington (jwash) ae37359b6b
AcctIdx: only advance age on thread 0 (#25943) 2022-06-14 21:43:42 -05:00
Alexander Meißner 4652377e5b
Removes the feature gate of reject_empty_instruction_without_program. (#25870) 2022-06-14 18:00:12 +02:00
Jeff Washington (jwash) 8c6455022f
remove dead code marker (#25945) 2022-06-14 10:47:26 -05:00
Jeff Washington (jwash) e24cc537a4
avoid adding to 'uncleaned_roots' when generating index and caller passes accounts-db-skip-shrink (#25936) 2022-06-14 10:10:44 -05:00
Jeff Washington (jwash) 01f41b8c76
get rid of dead code marker (#25944) 2022-06-14 08:44:40 -05:00
Steven Luscher 45d11f3d26
Implement `VoteInstruction::AuthorizeWithSeed` & `VoteInstruction::AuthorizeWithSeedChecked` (#25928)
* [vote_authorize_with_seed] Add `VoteInstruction::AuthorizeWithSeed`

* [vote_authorize_with_seed] You can now update a vote account's authority if it's a derived key for which you control the base key

* [vote_authorize_with_seed] Add test helper to create a vote account whose authorities are derived keys

* [vote_authorize_with_seed] Write tests to assert the behavior of `VoteInstruction::AuthorizeWithSeed`

* [vote_authorize_with_seed] Feature gate the `VoteInstruction::AuthorizeWithSeed` processor

* [vote_authorize_with_seed] Add `VoteInstruction::AuthorizeWithSeed` to transaction status parser

* [vote_authorize_with_seed] Add `VoteInstruction::AuthorizeWithSeed` to docs

* [vote_authorize_with_seed] Add `VoteInstruction::AuthorizeCheckedWithSeed`

* [vote_authorize_with_seed] You can now update a vote account's authority (while checking that the new authority has signed) if it's a derived
key for which you control the base key

* [vote_authorize_with_seed] Add `VoteInstruction::AuthorizeCheckedWithSeed` to transaction status parser

* [vote_authorize_with_seed] Write tests to assert the behavior of `VoteInstruction::AuthorizeCheckedWithSeed`
2022-06-13 20:36:44 -07:00
Jeff Washington (jwash) 306faed3a8
update comment (#25949) 2022-06-13 17:43:29 -05:00
apfitzge d56a706b20
Add static vector to get all static ids in runtime (#25909)
* Add function to get all static ids in runtime

* static_ids.rs: use a lazy_static ref instead of a function
2022-06-13 13:21:16 -05:00
apfitzge 3e1fd4dad0
snapshot_utils.rs: remove unnecessary sort (#25893) 2022-06-13 11:12:33 -05:00
apfitzge 04969a2282
serialize snapshots dir first (#25889) 2022-06-13 09:33:32 -05:00
Jeff Washington (jwash) 3eff7648ff
collect rent from multiple partitions in parallel (#25774) 2022-06-13 07:53:49 -05:00
Michael Vines b4237f3f2c Do not exclude failed simple vote transactions from consensus 2022-06-12 22:11:23 -07:00
Brooks Prumo a2c180dc0b
Add EvictionsGuard to InMemAccountsIndex (#25847) 2022-06-12 17:31:58 -05:00
Brooks Prumo 53695ecd21
Remove SlotT type alias (#25908) 2022-06-10 22:04:56 -05:00
Jack May 9fb0e76dc2
cleanup feature; do_support_realloc (#25882) 2022-06-10 15:33:19 -07:00
apfitzge 0fffccb4a3
account_info.rs: docs offset is reduced_offset * ALIGN_BOUNDARY_OFFSET (#25848) 2022-06-10 16:19:53 -05:00
ivandzen 2251aa2809
Report transaction signature on update account (#25726)
There's no direct linkage between account-update events and transaction-events

Issue is linked with geyser plugin interface
Currently, there's no straightforward way to determine what notify_transaction call is related to particular update_account call. So, there's no simple way to determine what transaction caused what changes in accounts. This issue is especially valuable in case when several transactions modifies single account in the same slot.

Add txn_signature field to ReplicaTransactionInfo structure

This additional field will contain the signature of transaction which caused this account update event. This modification is not bringing significant overhead because all necessary information for such linkage already available inside Accounts::collect_accounts_to_store method
2022-06-10 10:24:35 -07:00
Brooks Prumo bea35d5fbe
Add ApplyFeatureActivationsCaller enum (#25858) 2022-06-10 10:15:13 -05:00
Brooks Prumo fedd3f26d0
Fix new cost tracker with accounts data size limit (#25843) 2022-06-10 07:39:43 -05:00
behzad nouri b4190319a1
feat(nonce): adds system instruction to upgrade legacy nonce versions (#25789)
https://github.com/solana-labs/solana/pull/25788
permanently disables durable transactions with legacy nonce versions
which are within chain blockhash domain.

This commit adds a new system instruction for a one-time idempotent
upgrade of legacy nonce accounts in order to bump them out of chain
blockhash domain.
2022-06-10 00:04:29 +00:00
behzad nouri 3c1ce3cc93
permanently disables durable nonces with chain blockhash domain (#25788)
https://github.com/solana-labs/solana/pull/25744
separated durable nonce and blockhash domains, which will stop double
execution going forward. However it is possible that a durable
transaction has *already* been executed once as a normal transaction and
it is now a valid durable transaction. #25744 cannot stop such
transactions to be re-executed until the nonce accounts are advanced.

This commit adds a new nonce version indicating that the nonce is moved
out of the blockhash domain, and permanently disables durable
transactions for legacy nonces which are in the blockhash domain.
2022-06-09 15:28:37 +00:00
Brooks Prumo e5f36aa371
Change `WaitableCondvar`'s mutex to hold `()` (#25857) 2022-06-09 09:03:22 -05:00
Justin Starry 6a7edc02c6
Reject durable nonce txs that don't use an advanceable nonce (#25832)
* Reject durable nonce txs that use the latest durable nonce hash

* feedback
2022-06-08 21:34:57 +00:00
Justin Starry b2b426d4bf
Reject durable nonce transactions not signed by authority (#25831) 2022-06-08 14:43:09 -05:00
HaoranYi 40b1655eb5
fix intermittent bucket age test failure (#25841)
* fix double count of account index del stats

* refactor to seperate delete and insert account index stats

* fix test

* increase test timing tolerance for bucket age

* Revert "increase test timing tolerance for bucket age"

This reverts commit 2b91cf902208e4585d25dff1d4298d412c9da516.

* Revert "Revert "increase test timing tolerance for bucket age""

This reverts commit 8f07367b64ddc45a9a693729ea2725895627d14c.
2022-06-08 16:15:49 +00:00
HaoranYi 28142f8a6d
Refactor: separate delete and insert account index stats (#25800)
* fix double count of account index del stats

* refactor to seperate delete and insert account index stats

* fix test

* increase test timing tolerance for bucket age

* Revert "increase test timing tolerance for bucket age"

This reverts commit 2b91cf902208e4585d25dff1d4298d412c9da516.
2022-06-08 09:05:37 -05:00
Brooks Prumo d4e4871c47
Add tests to Bank for accounts data size (#25816) 2022-06-07 18:28:53 +00:00
HaoranYi 05cb25d8da
fix double count of account index del stats (#25797) 2022-06-07 11:50:57 -05:00
apfitzge e6c21a3036
Convert Measure::this to measure! and remove Measure::this (#25776)
* Remove the args param from Measure::this since we don't ever use it

* banking_stage.rs: convert to measure!

* poh_recorder.rs: convert to measure!

* cost_update_service.rs: convert to measure!

* poh_service.rs: convert to measure!

* bank.rs: convert to measure!

* measure.rs: Remove Measure::this now that all have been converted to measure!
2022-06-06 20:21:05 -05:00
Ashwin Sekar 8caced68ce
Serialize lamports per signature (#25364)
* Serialize lamports per signature

* Add full snapshot archive test, enable features in previous tests
2022-06-06 13:07:02 -07:00
Brooks Prumo ec64d5261f
Avoid RMWs on shared data inside parallel loops: collect_rent_from_accounts() (#25790) 2022-06-06 13:32:22 -05:00
Justin Starry 61ad8fcc55
Fix bank executor stats and remove copy-on-write semantics (#25621)
* Fix bank executor stats and remove copy-on-write semantics

* Remove clone implementation for CachedExecutors

* feedback
2022-06-04 13:54:26 +00:00
behzad nouri 9851774133 adds feature gate enabling durable nonce
Previous commit separates durable nonce and blockhash domains with a
feature gate. A 2nd feature added in this commit enables durable nonce
at least one epoch after the 1st feature.
By the time 2nd feature is activated, some nonce accounts will have an
old blockhash, but no nonce account can have a recent blockhash.
As a result no transaction (durable or normal) can be executed twice.
2022-06-04 12:39:31 +00:00
behzad nouri 5ee157f43d separates durable nonce and blockhash domains
AdvanceNonceAccount instruction updates nonce to blockhash. This makes it
possible that a durable transaction is executed twice both as a normal
transaction and a nonce transaction if it uses blockhash (as opposed to nonce)
for its recent_blockhash field.

The commit prevents this double execution by separating nonce and blockhash
domains; when advancing nonce account, blockhash is hashed with a fixed string.
As a result a blockhash cannot be a valid nonce value; and if transaction was
once executed as a normal transaction it cannot be re-executed as a durable
transaction again and vice-versa.
2022-06-04 12:39:31 +00:00
Jeff Washington (jwash) 8b0d5b2485
parallelize rent collection (#25767) 2022-06-03 18:00:02 -05:00
Brooks Prumo edebd7e495
Grab read-lock instead of write-lock in From<PreAllocatedAccountMapEntry<T>> for (Slot, T) (#25770) 2022-06-03 20:48:32 +00:00
Christian Kamm 0da0e0da63
Bank: Batch account stores in collect_rent_eagerly (#25707)
* Bank: Batch account stores in collect_rent_eagerly

Previously store() calls were done one-by-one, which leads to suboptimal
performance.

* Accounts: Remove store_slow_cached()

* clippy

Co-authored-by: Jeff Washington (jwash) <wash678@gmail.com>
2022-06-03 15:00:39 -05:00
Jeff Washington (jwash) 646bd2e488
extract prefix_from_pubkey (#25766) 2022-06-03 14:03:15 -05:00
Jeff Washington (jwash) a9a94166ef
load_account_into_read_cache (#25760) 2022-06-03 13:34:17 -05:00
sakridge e6e2058758
Increase accounts stack size to 8mb (#25592) 2022-06-03 19:46:01 +02:00
Jeff Washington (jwash) 779ec564e4
add data to assert (#25749) 2022-06-03 09:32:43 -05:00
Jeff Washington (jwash) 7c95ae341d
disk idx: reduce lock calls (#25734)
* disk idx: reduce lock calls

* adjust ordering for count_buckets_flushed
2022-06-02 18:26:08 -05:00
Justin Starry 6fc057c1d9
Remove activated evict_invalid_stakes_cache_entries feature (#25739) 2022-06-02 21:04:54 +00:00
apfitzge ed68c0b889
epoch_stakes_reation -> epoch_stakes_creation in Bank::_new_from_parent (#25660) 2022-06-02 12:26:01 -05:00
carllin eeec3fb9c9
Remove unwrap (#25538) 2022-06-02 12:18:46 -05:00
Jeff Washington (jwash) e8df90c34b
rename count_buckets_flushed (#25733) 2022-06-02 12:16:01 -05:00
Jeff Washington (jwash) ddd0ed0af1
fix ordering in disk idx (#25735) 2022-06-02 11:50:44 -05:00
Jeff Washington (jwash) 96f71c7d4d
add metrics on rent collection pieces (#25713) 2022-06-02 09:08:53 -05:00
Jeff Washington (jwash) d1a6cebaa2
u64 -> duration (#25708) 2022-06-02 07:56:47 -05:00
apfitzge 369ff0858d
Helper functions for getting rent partitions between slots (#25669) 2022-06-01 20:20:44 -05:00
Jeff Washington (jwash) 149a54b786
remove par_iter on update index below threshold (#25699) 2022-06-01 17:41:56 -05:00
Jeff Washington (jwash) 891dcb2084
move rent collection time into datapoint (#25714) 2022-06-01 17:28:47 -05:00
Jeff Washington (jwash) dd0bf4ff4b
add filler accounts gradually with cache flush (#25678) 2022-06-01 15:47:21 -05:00
Trent Nelson b80a82a9e5 runtime: gate nonce disable at restart slot 2022-06-01 12:00:10 -06:00
Trent Nelson 635bd40f09 runtime: disable durable nonces 2022-06-01 11:15:16 -06:00
Jeff Washington (jwash) 905fef29cb
add filter to AppendVecScan (#25664) 2022-06-01 11:55:18 -05:00
Jeff Washington (jwash) 94b0ce5d43
remove_old_historical_roots uses accounts_hash_complete_one_epoch_old (#25673) 2022-06-01 10:45:26 -05:00
Jeff Washington (jwash) c91fbd289f
set active state to shrink_ancient when doing intersting work (#25677) 2022-06-01 10:36:58 -05:00
Jeff Washington (jwash) 8bb76fcd87
add ancient metrics (#25656)
* add ancient metrics

* review feedback
2022-06-01 10:36:23 -05:00
Jeff Washington (jwash) 07958fd8ed
use self.init_accum (#25663) 2022-06-01 08:38:37 -05:00
dependabot[bot] 27978c4d0c
chore: bump flate2 from 1.0.23 to 1.0.24 (#25636)
* chore: bump flate2 from 1.0.23 to 1.0.24

Bumps [flate2](https://github.com/rust-lang/flate2-rs) from 1.0.23 to 1.0.24.
- [Release notes](https://github.com/rust-lang/flate2-rs/releases)
- [Commits](https://github.com/rust-lang/flate2-rs/commits)

---
updated-dependencies:
- dependency-name: flate2
  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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2022-05-31 23:15:46 -06:00
Tyera Eulberg 8584a3a331
Add feature to increase timestamp bounding on the slow side to 150% of poh estimate (1s/slot) (#25666) 2022-05-31 16:53:06 -06:00
Jeff Washington (jwash) 5994b4f53f
use object for hash scanning (#25418) 2022-05-31 11:51:56 -05:00
apfitzge 56d38e4954
Add lz4 to snapshot filename regex for matching files on load (#25633)
* Add lz4 to snapshot filename regex for matching files on load

* Add tests for lz4 archive format filenames
2022-05-31 11:06:41 -05:00
steviez 6b2f58152b
Ignore rocksdb directories when unpacking genesis archive (#25575)
Unpacking the rocksdb directory from genesis archive can have unintended
consequences, such as clobbering files in pre-existing rocksdb
directory.
2022-05-31 00:38:45 -05:00
Wei Hu 4b1dd0f921
Fix a possible test hang in runtime::test_shared_buffer_sweep (#25545)
* Fix a possible test hang in runtime::test_shared_buffer_sweep

The test may hang if the total number of threads it wants to start
is greater than the number of threads configured in the rayon
threadpool. Check to avoid this situation from happening.

* Incorporate comment from Xiang Zhu, using std::cmp::min() to simplify the code
2022-05-30 23:39:32 +08:00
Christian Kamm 387d9d9c77 Store missing unupdated executors earlier 2022-05-28 13:42:35 +10:00
carllin 740ee0c502
Fix datapoint name (#25614) 2022-05-28 01:01:29 +00:00
Trent Nelson 4e6b276f6c
bump executor cache max entries (#25600)
* executor-cache: unify `remove` calls

* executor-cache: metrics - add one-hit-wonder counter

* executor-cache: bump max entries to 256
2022-05-28 01:54:10 +10:00
Justin Starry ce14c63bf0
fix: stop double counting execution timings (#25605) 2022-05-28 00:06:29 +10:00
buffalu e58de2c233
Check fee payer before loading all accounts (#25371)
* fix vote account loading

* fix clippy and rename some stuff

* fix bug

Co-authored-by: Justin Starry <justin@solana.com>
2022-05-27 13:44:29 +10:00
Brooks Prumo 7384c41ea7
Speed up bank::tests::test_max_accounts_data_size_exceeded() (#25523) 2022-05-25 22:22:30 -04:00
Justin Starry 26a02f6f59
Add invoke logging to builtin programs that don't have it yet (#25230)
* Refactor process_executor_chain

* Enable builtin program invoke logs by default

* feedback
2022-05-26 07:27:00 +08:00
Alexander Meißner f10c80b49f
Refactor: Rebase offset of `index_in_caller` (#25531)
* Removes the offset InstructionContext::get_number_of_program_accounts() from InstructionAccount::index_in_caller.

* Removes unreachable SyscallError::InvalidLength in orig_data_lens.get().
2022-05-25 13:43:20 +02:00
buffalu 7b98ff1929
Refactor: pull out fee payer balance check (#25519) 2022-05-25 20:44:03 +10:00
Brooks Prumo b7149f7f54
Add helper fn to set accounts_data_size_initial for tests (#25522) 2022-05-25 02:43:54 +00:00
Brooks Prumo 0dd3c6bf1f
Split up accounts data size field (#25495) 2022-05-24 20:26:32 -04:00
Alexander Meißner 2fb096c486
Refactor: Adds `index_in_callee` to `InstructionAccount` (#25490)
* Adds InstructionAccount::index_in_callee

* Adjusts tests and benches.

* Adds documentation for InstructionAccount.

* Adds InstructionContext::is_duplicate()
2022-05-25 00:04:46 +02:00
Justin Starry e66ea7cb6a Clean up Bank::commit_transactions parameters 2022-05-24 20:24:42 +08:00
dependabot[bot] 3566fb5660
chore: bump regex from 1.5.5 to 1.5.6 (#25488)
* chore: bump regex from 1.5.5 to 1.5.6

Bumps [regex](https://github.com/rust-lang/regex) from 1.5.5 to 1.5.6.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.5.5...1.5.6)

---
updated-dependencies:
- dependency-name: regex
  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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2022-05-23 13:45:43 -06:00
Jeff Washington (jwash) bac05dc55a
calc slot info on max slot once per hash calc (#25422) 2022-05-23 10:11:00 -05:00
Jeff Washington (jwash) 41f30a2383
stop logging misleading bank hash mismatch (#25427) 2022-05-23 08:43:25 -05:00
Michael Vines b05c7d91ed Fix derive_partial_eq_without_eq clippy lint 2022-05-22 22:22:21 -07:00
Brooks Prumo f8842032c6
clippy: fix "this let-binding has unit value" warnings (#25429) 2022-05-22 12:17:59 -04:00
Alexander Meißner 7eae98c6d9
Introduces `Result` return types to mutable accessors of `BorrowedAccount` (#25380)
* Introduces result return types to get_data_mut(), set_data() and set_data_length() of BorrowedAccount.

* Introduces result return types to set_owner(), set_lamports() and set_executable() of BorrowedAccount.
2022-05-21 17:47:09 +02:00
Brooks Prumo e9a6d1ecef
clippy: is_digit(10) -> is_ascii_digit() (#25428) 2022-05-21 07:03:11 -05:00
Jeff Washington (jwash) f584b249dd
special case for common case of 1 storage on append vec scan (#25414) 2022-05-20 17:36:30 -05:00
Jack May 851958f77a
Disallow deployment of deprecated _sol_alloc_free syscall (#25179) 2022-05-20 13:19:41 -07:00
Jeff Washington (jwash) cfcc18f7f4
apply AccountsInAppendVec to more places (#25408) 2022-05-20 14:25:46 -05:00
Brooks Prumo a25212b087
Move append_vec::test_utils into its own file (#25407) 2022-05-20 13:37:45 -05:00
Jeff Washington (jwash) 9ef0acdf5d
allow hash calc to use all threads at startup (#25369) 2022-05-20 11:45:01 -05:00
Jeff Washington (jwash) 467431de89
add ledger-tool accounts-db-skip-initial-hash-calc (#25354) 2022-05-20 10:27:00 -05:00
Jeff Washington (jwash) 950245c29b
simulate filler account hash calc time at delta hash (#25387) 2022-05-20 10:20:44 -05:00
Jeff Washington (jwash) 1b4e4ef548
impl squash to ancient append vecs (#24538)
* squash to ancient append vecs

* pr feedback

* clippy
2022-05-20 10:20:17 -05:00
Jeff Washington (jwash) de03a3d3aa
filler accounts get a non-zero rent_epoch (#25386)
* fill accounts get a non-zero rent_epoch

* use snapshot_slot

* get rid of perf simulation code
2022-05-20 09:03:55 -05:00
Jeff Washington (jwash) 3fe7655378
use iterator instead of vec to iterate accounts (#25370)
* user iterator instead of vec to iterate accounts

* rename
2022-05-20 08:50:24 -05:00
Jeff Washington (jwash) 36ed36edf0
use previous epoch's # slots per epoch (#25382) 2022-05-20 08:47:55 -05:00
Michael Vines c54e06355f
voteSubscribe pubsub notification now includes the vote transaction signature (#25291) 2022-05-19 18:28:46 -07:00
Brooks Prumo 021276c955
Move updating accounts data len from execute to commit (#25256) 2022-05-19 12:24:13 -05:00
Jeff Washington (jwash) 0f703b71cc
minor test renaming (#25297) 2022-05-18 12:53:55 -05:00
Jeff Washington (jwash) fe91f40f8a
use previous epoch rent collector in expected rent collection (#25289) 2022-05-18 12:53:45 -05:00
dependabot[bot] 542bd0ec3c
chore: bump rayon from 1.5.2 to 1.5.3 (#25242)
* chore: bump rayon from 1.5.2 to 1.5.3

Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.5.2 to 1.5.3.
- [Release notes](https://github.com/rayon-rs/rayon/releases)
- [Changelog](https://github.com/rayon-rs/rayon/blob/master/RELEASES.md)
- [Commits](https://github.com/rayon-rs/rayon/compare/v1.5.2...v1.5.3)

---
updated-dependencies:
- dependency-name: rayon
  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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2022-05-18 09:39:57 -06:00
Justin Starry a1522d0024
Use consistent naming for compute unit limit (#25229)
* Use consistent naming for compute unit limit

* feedback
2022-05-18 13:14:31 +08:00
Jon Cinque 0820065c98
rpc: Support token-2022 in token-specific calls (#25150)
* rpc: Support token-2022 in token-specific calls

* Address feedback
2022-05-17 21:02:43 +02:00
HaoranYi 85a2e599bb
revert memory map for reading snapshot (#25259) 2022-05-17 09:32:18 -05:00
Jeff Washington (jwash) 2cf7c73ced
cleanup types in tests (#25254) 2022-05-16 15:54:40 -05:00
Jack May 21e066ef26
Merge pull request from GHSA-wxrh-ff9f-fc6w 2022-05-16 12:30:37 -07:00
HaoranYi 3e44046a73
Support lz4 for snapshot archives (#25089)
* add lz4

* add cargo package file

* fix tests

* use fast lz4 compression

* report snapshot archive format

* add test

* code review feedback

* add cargo.lock

* fix var name

* refactor archive format parsing and add default compress cli arg

* clippy

* add from_cli_arg test

* update cargo.lock

* add lz4 support for mmap

* cargo.lock

* clippy
2022-05-16 12:44:15 -05:00
Justin Starry f81c5df1f0
Include account index in rent paying account tx error (#25189) 2022-05-16 23:35:34 +08:00
HaoranYi 389d78e424
Don't use mmarinus package (#25177)
* Revert "Revert "Use memory map to speed up snapshot untar (#24889)" (#25174)"

This reverts commit fc793de2dd.

* not use mmarinus

* enable secondary build

* Revert "enable secondary build"

This reverts commit 5aa43a94bbad59497506f02235597e7adc0dc47b.

* macbuild

* Revert "macbuild"

This reverts commit 0da92945a40dc5431eff4bd91054b407e22418fb.
2022-05-16 08:49:17 -05:00
Tao Zhu b1b3702e6d
Prioritize transactions in banking stage by their compute unit price (#25178)
* - get prioritization fee from compute_budget instruction;
- update compute_budget::process_instruction function to take instruction iter to support sanitized versioned message;
- updated runtime.md

* update transaction fee calculation for prioritization fee rate as lamports per 10K CUs

* review changes

* fix test

* fix a bpf test

* fix bpf test

* patch feedback

* fix clippy

* fix bpf test

* feedback

* rename prioritization fee rate to compute unit price

* feedback

Co-authored-by: Justin Starry <justin@solana.com>
2022-05-16 12:06:33 +08:00
Justin Starry 6c10515ccf
Revert "Serialize lamports per signature in snapshots (#25181)" (#25228)
This reverts commit 35d2a0fd69.
2022-05-15 12:04:17 +00:00
Ashwin Sekar 35d2a0fd69
Serialize lamports per signature in snapshots (#25181)
* Serialize lamports per signature

* pr comments
2022-05-14 10:57:51 -07:00
Ryo Onodera 592aa4c21b
Improve hard fork message with more detail (#25214) 2022-05-15 01:14:23 +09:00
sakridge 3d96a1ab76
Block packets in vote-only mode (#24906) 2022-05-14 17:53:37 +02:00
Jeff Washington (jwash) 7826fef120
clippy (#25206) 2022-05-13 21:03:54 -05:00
Jeff Washington (jwash) 9ccdc8a050
populate ancient append vec metrics (#25204)
* populate ancient append vec metrics

* count ancient storages while enumerating storages anyway.
2022-05-13 18:20:15 -05:00
Jeff Washington (jwash) d7dcb62fe1
ancient_append_vec refactoring (#25203) 2022-05-13 16:40:26 -05:00
Jeff Washington (jwash) cb037e49ea
is_candidate_for_shrink respects ancient append vecs (#25205) 2022-05-13 16:26:46 -05:00
apfitzge 5eeb07fead
coalesce purge stats and reclaim result (#25183) 2022-05-13 12:34:11 -05:00
dependabot[bot] 295df294de
chore: bump zstd from 0.11.1+zstd.1.5.2 to 0.11.2+zstd.1.5.2 (#25156)
* chore: bump zstd from 0.11.1+zstd.1.5.2 to 0.11.2+zstd.1.5.2

Bumps [zstd](https://github.com/gyscos/zstd-rs) from 0.11.1+zstd.1.5.2 to 0.11.2+zstd.1.5.2.
- [Release notes](https://github.com/gyscos/zstd-rs/releases)
- [Commits](https://github.com/gyscos/zstd-rs/commits/v0.11.2)

---
updated-dependencies:
- dependency-name: zstd
  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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2022-05-12 20:28:50 -06:00
Jeff Washington (jwash) 6f1cc5a2a7
assert we haven't squashed to ancient after hash calc (#25168) 2022-05-12 18:26:01 -05:00
Jeff Washington (jwash) fc793de2dd
Revert "Use memory map to speed up snapshot untar (#24889)" (#25174)
This reverts commit 3367e44671.
2022-05-12 14:48:29 -05:00
Jason 08da486c05
additional costs in block capacity calc (#25059)
* Added additional costs to block capacity computation, and pushed alloc of CostModel all the way to the top of the call chain, instead of reallocing

* Fix two compiler errors

* Update block processing to propagate computed costs, rather than re-computing deeper in the call stack

* Clippy fix

* Reformatting fix after merge

* Add CostModel::sum_without_bpf
2022-05-12 13:52:20 -05:00
HaoranYi 3367e44671
Use memory map to speed up snapshot untar (#24889)
* mmap

* add no_os_memory_reporting_args to ledger-tool

* use safe memory map package for unix. use regular file for windows

* fallback to untaring with filebuf when mmap fails

* update comments
2022-05-12 13:35:19 -05:00
Jack May cde15ff687
support 64-bit prioritization fee (#25027) 2022-05-12 11:07:36 -07:00
Jeff Washington (jwash) 896729f25e
keep track of oldest slot used by last hash calculation (#25152) 2022-05-12 11:18:08 -05:00
Jeff Washington (jwash) abb4993a3b
SortedStorages::max_slot_inclusive() (#25153) 2022-05-12 10:24:03 -05:00
Jeff Washington (jwash) 849cbe93aa
add AccountsToStore::has_overflow (#25143) 2022-05-12 10:14:27 -05:00
Jeff Washington (jwash) c56d978cb1
minor cleanup (#25144) 2022-05-11 14:58:43 -05:00
Justin Starry 68800982ea
Add size_of const fns for upgradeable loader states (#25131) 2022-05-11 22:22:59 +08:00
Jeff Washington (jwash) a8930ee14b
add --accounts-db-ancient-append-vecs (#25125) 2022-05-11 08:47:07 -05:00
Jon Cinque 542a14d9b7
test-validator: Always use overridden compute budget in bank (#25128) 2022-05-11 15:46:51 +02:00
Jeff Washington (jwash) 11fa0db850
more ancient append vec fns (#25127) 2022-05-11 08:02:05 -05:00
Jeff Washington (jwash) 3ce877d1ab
add metric for ancient append vec count (#25126) 2022-05-11 08:01:04 -05:00
Jeff Washington (jwash) c4506269a6
add ancient_append_vecs (#25119) 2022-05-10 16:41:04 -05:00
Pankaj Garg c838e15234
Unset needs_unlock for rebatched transactions batches (#25095)
* Unset needs_unlock for rebatched transactions batches

* address review comments
2022-05-10 13:39:08 -07:00
DimAn 2fa9bc3e70
Add options to store full and/or incremental snapshots in separate locations (#24247) 2022-05-10 16:37:41 -04:00
Jeff Washington (jwash) dc6e28099b
mark_dirty_dead_stores (#25114) 2022-05-10 15:08:29 -05:00
Jeff Washington (jwash) e9e267947e
simplify storage_finder -> storage (#25109) 2022-05-10 14:18:51 -05:00
Jeff Washington (jwash) e9a9604ca7
avoid zeroing out root stats with empty data (#25111) 2022-05-10 13:56:30 -05:00
Jeff Washington (jwash) b91cc87680
assert when rewrites skipped (#25110) 2022-05-10 13:55:48 -05:00
Jeff Washington (jwash) 8e5bb0a1e2
check file size of accounts cache mmap before indexing (#25077) 2022-05-10 13:33:22 -05:00
Jeff Washington (jwash) 2d7ce2a6c2
Revert "uses designated thread-pools for account db parallel ops (#24954)" (#25053)
This reverts commit e8bdc27080.
2022-05-06 15:20:50 -05:00
Justin Starry 082502d4f3
Fail tx sanitization when ix program id uses lookup table (#25035)
* Fail tx sanitization when ix program id uses lookup table

* feedback
2022-05-07 03:19:50 +08:00
Jeff Washington (jwash) df9a4a0c9d
Bank::new_for_benches uses bench config (#25017) 2022-05-06 13:35:18 -05:00
Jeff Washington (jwash) 7401bc0fa5
remove_old_historical_roots uses correct epoch schedule (#25020)
* remove_old_historical_roots uses correct epoch schedule

* Update runtime/src/accounts_db.rs

Co-authored-by: apfitzge <apfitzge@users.noreply.github.com>

Co-authored-by: apfitzge <apfitzge@users.noreply.github.com>
2022-05-06 12:38:09 -05:00
Jason 47cd0d9061
Speed up get-data-cost function (#25013)
* Combine data_bytes_cost into the get_transaction_cost function, for speedup

* Remove a dead function, fix a value in a test

* Respond to comments by changing call signature to take a &mut struct rather than return a tuple
2022-05-06 11:39:00 -05:00
behzad nouri 492f89a170
checks account owner when initializing a vote-account (#25018)
A VoteAccount may only wrap an account if the account owner is
solana_vote_program:id or equivalently this check returns true:
solana_vote_program::check_id(account.owner())
2022-05-06 16:22:49 +00:00
behzad nouri 3fff34a65f
explicitly removes accounts with zero lamports from stakes cache (#25015)
Zero lamport accounts are not stored in accounts-db:
https://github.com/solana-labs/solana/blob/7b5835ddf/runtime/src/accounts_db.rs#L5007-L5014
https://github.com/solana-labs/solana/blob/7b5835ddf/runtime/src/accounts_db.rs#L4481-L4483

However, in order to purge the account from cache, stakes cache update
partially relies on accounts data to be also zeroed out :
https://github.com/solana-labs/solana/blob/7b5835ddf/runtime/src/bank.rs#L3471-L3478

This can be error-prone and introduce inconsistency between accounts-db
and vote/stake cache. This commit instead explicitly removes accounts
from cache if lamports == 0.
2022-05-06 14:04:49 +00:00