Commit Graph

2933 Commits

Author SHA1 Message Date
Brooks Prumo f8bdedb596
Make accounts data size tests more robust (#26466) 2022-07-07 00:01:13 -05:00
Xiang Zhu 134303714b
Fix the order assumption of the pubkeys created by Pubkey::new_unique() (#26451)
new_unique() does not gurantee the increment order due to the bytes
array storage and its eq-partial trait interpreting the bytes in the
big-endian way.
2022-07-06 15:35:32 -07:00
carllin 90ef2cd02a
Parse snapshot for bank fields (#26016) 2022-07-06 17:30:30 -05:00
Jeff Washington (jwash) 16219e300e
generating index sets uncleaned_roots correctly (#26431)
* generating index sets uncleaned_roots correctly

* fix test failures

* rename

* update comments
2022-07-06 16:12:47 -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
Xiang Zhu 44f499cff3
Refactor account index scan function parameters (#26428)
* Refactor account index scan function parameters

F: FnMut(bool, &SlotList<T>, &'a Pubkey, RefCount) -> AccountsIndexScanResult,
Refactor to take  (&'a Pubkey, Option<(&SlotList<T>, RefCount))

* Update comments based on review feedback

* cargo fmt --all fixes
2022-07-06 09:49:11 -07: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
Jeff Washington (jwash) ab164fc975
simplify code (#26443) 2022-07-06 11:22:26 -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
Jeff Washington (jwash) 5afe4d938d
combine lookup in calc_delete_dependencies (#26429) 2022-07-06 08:50:14 -05:00
Jeff Washington (jwash) 71c7b4f9cb
use append vec iter in construct_candidate_clean_keys (#26426) 2022-07-06 08:49:35 -05:00
behzad nouri 6f5857a5db
removes feature gate code separating durable nonce from blockhash domain (#26055) 2022-07-06 12:03:13 +00:00
dependabot[bot] 37f4621c06
chore: bump serde from 1.0.137 to 1.0.138 (#26421)
* chore: bump serde from 1.0.137 to 1.0.138

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.137 to 1.0.138.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.137...v1.0.138)

---
updated-dependencies:
- dependency-name: serde
  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-07-05 23:18:08 -06:00
Tao Zhu c1d89ad749
forward packets by prioritization in desc order (#25406)
- Forward packets by prioritization in desc order
- Add support of cost-tracking by transaction requested compute units
- Hook up account buckets to forwarder
- Add metrics for forwardable batches count
- Remove redundant invalid packets filtering at end of slot since forwarder will do the same when batch forwardable packets
- Add bench test for forwarding
2022-07-05 23:24:58 -05:00
Jeff Washington (jwash) 38216aa781
update comment for the next weary traveller (#26413) 2022-07-05 23:12:35 -05:00
Jeff Washington (jwash) 75149fd624
move mark_old_slots_as_dirty to be called from ahv (#26411) 2022-07-05 23:11:32 -05:00
Jeff Washington (jwash) 2aafef38f9
is_shrinking_productive calls avoid arc clone (#26422) 2022-07-05 17:53:29 -05:00
Jeff Washington (jwash) b7e34aea15
refactor calculate_rent_result (#26416)
reactor calculate_rent_result
2022-07-05 16:45:59 -05:00
Brooks Prumo 53b9420562
Remove `INTO!` macros in serde_snapshot (#26409) 2022-07-05 16:37:20 -05:00
carllin ce39c14025
Add end-to-end replay slot metrics (#25752) 2022-07-05 13:58:51 -05:00
Jeff Washington (jwash) 0ab521d5f1
inc counter when append vec drop fails (#26396) 2022-07-05 11:27:01 -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
Jeff Washington (jwash) 88b5b7e30a
improve log (#26360) 2022-07-01 13:12:52 -05:00
HaoranYi 728986ddf4
Spell correction and add remove slot in AccountDB purge assert message (#26358)
nit spell. add remove slots in accoutdb purge assert message
2022-07-01 17:39:35 +00:00
Michael Vines fdb186ba3b pacify nightly clippy 2022-06-30 21:31:49 -07:00
Alexander Meißner 72a968fbe8
Fix/system instruction processor tests (#26338)
* Make mock_process_instruction() stricter by invoking the verify() method.

* Fixes broken test cases.
2022-07-01 00:06:24 +02:00
Jack May 4563bf40f6
cleanup feature: tx-wide-compute-cap (#26326) 2022-06-29 23:54:45 -07:00
Brooks Prumo 36d13af015
Add stats for Accounts Background Service (#26298)
* Add stats for Accounts Background Service

* pr
2022-06-30 02:21:30 +00: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) 608191352f
track # roots added/removed since last clean (#26319) 2022-06-29 16:47:57 -05:00
Jeff Washington (jwash) 2deb396490
remove noisy and useless 'error!' and add test (#26138) 2022-06-29 16:26:23 -05:00
Alexander Meißner c01a8f271e
Prepare built-in program tests to deal with stricter account modification checks (#26314)
* Fixes test_vote_state_withdraw().

* Set is_writable to true where needed.
2022-06-29 19:29:12 +02:00
Jeff Washington (jwash) e241906db2
remove outdated, confusing comment (#26315) 2022-06-29 10:42:34 -05:00
Jeff Washington (jwash) ca83f143aa
load_accounts_index_for_shrink uses scan (#26260) 2022-06-29 09:02:27 -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
Justin Starry 50631e274d
Ensure that staked nodes is populated before returning length (#26293) 2022-06-28 19:15:42 +00:00
Jeff Washington (jwash) 89e5640c63
AccountsIndex::Scan takes iter (#26268) 2022-06-28 12:47:17 -05:00
Jeff Washington (jwash) d07b079850
make test_age_time less intermittent (#26280) 2022-06-28 09:13:01 -05:00
Jeff Washington (jwash) bfc390f9ed
refactor acct idx scan func for reuse (#26252) 2022-06-28 09:01:04 -05:00
Jeff Washington (jwash) 4b591d7b59
AccountsDb::load_accounts_index_for_shrink takes slice (#26267) 2022-06-28 08:59:57 -05:00
Alexander Meißner e8fed88669
Both kinds of LamportsError are turned into InstructionError::ArithmeticOverflow anyway. (#26273) 2022-06-28 10:04:54 +02:00
Jeff Washington (jwash) e164879f20
load_accounts_index_for_shrink uses &item instead of (&item.0, &item.1) (#26266) 2022-06-27 22:40:45 -05:00
Jeff Washington (jwash) d6a28cb7a8
load_accounts_index_for_shrink unrefed_pubkeys is optional (#26265) 2022-06-27 17:23:46 -05:00
apfitzge 50eb9965ab
fix test_new_from_file_crafted_executable for m1 (#26009)
* fix test_new_from_file_crafted_executable for m1

* re-add old assert/comment, but disable for aarch64
2022-06-27 12:03:52 -05:00
Jeff Washington (jwash) d8516b5c88
comment and expand on test (#26231) 2022-06-27 11:35:46 -05:00