2497 Commits

Author SHA1 Message Date
446816de52 Remove redundant is_stake check (#19185) 2021-08-11 18:38:03 +00:00
5970083b4d Use last_valid_block_height in services and client apps (#19163)
* Add deprecated tag to Bank::get_blockhash_last_valid_slot

* Update SendTransactionService to use last_valid_block_height

* Update solana-tokens to use last_valid_block_height

* Remove dangling file

* Update solana program to use last_valid_block_height

* Update Banks crates to use last_valid_block_height
2021-08-11 01:04:00 -06:00
00e5e12906 renames solana_runtime::vote_account::VoteAccount
Rename:
  VoteAccount    -> VoteAccountInner  # the private type
  ArcVoteAccount -> VoteAccount       # the public type
2021-08-10 22:54:17 +00:00
1403eaeefc makes solana_runtime::vote_account::VoteAccount private
VoteAccount is an implementation detail, and should not be public.
Only ArcVoteAccount is the public type.
2021-08-10 22:54:17 +00:00
faf99f4760 Move Bank::get_incremental_snapshot_storages() into snapshot_utils (#19155)
Filtering out storages for incremental snapshots will be needed by the
background services for incremental snapshot support, but there is not a
Bank at that point.  Since the filtering doesn't apply only to Bank, and
more to snapshots, move the functionality into snapshot_utils.
2021-08-10 14:04:11 -05:00
536b763751 chore: bump libc from 0.2.98 to 0.2.99 (#19142)
* chore: bump libc from 0.2.98 to 0.2.99

Bumps [libc](https://github.com/rust-lang/libc) from 0.2.98 to 0.2.99.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.98...0.2.99)

---
updated-dependencies:
- dependency-name: libc
  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>
2021-08-10 10:54:54 -06:00
651343688d Use option for account index bucket parameter (#19150) 2021-08-10 11:32:25 -05:00
05d92402f1 Simplify AccountsPackagePre::new() and friends (#19134) 2021-08-10 11:10:15 -05:00
f302774cf7 implements copy-on-write for staked-nodes (#19090)
Bank::staked_nodes and Bank::epoch_staked_nodes redundantly clone
staked-nodes HashMap even though an immutable reference will suffice:
https://github.com/solana-labs/solana/blob/a9014cece/runtime/src/vote_account.rs#L77

This commit implements copy-on-write semantics for staked-nodes by
wrapping the underlying HashMap in Arc<...>.
2021-08-10 12:59:12 +00:00
c18bd08021 calculate store info while generating index (#19107)
* calculate store info while generating index

* update store info during index generation pass
2021-08-10 07:39:59 -05:00
47e0d9aa95 plumb more accounts_index bins (#19123) 2021-08-10 05:45:46 -05:00
f506da5e19 introduce StorageSizeAndCount (#19137) 2021-08-09 22:20:03 -05:00
5874f75a26 restore name: Bank::new_with_paths (#19122) 2021-08-09 17:30:37 -05:00
c56bccdf32 clean up types on account index generation (#19105) 2021-08-09 17:29:36 -05:00
c7b986220e Accounts::new_with_config_for_tests (#19104) 2021-08-09 09:01:12 -05:00
1951fe4e80 accounts default stragglers (#19101) 2021-08-09 09:00:30 -05:00
db14bcc43b AccountsIndex RefCount() returns u64 instead of atomic (#19088) 2021-08-09 08:59:56 -05:00
9616ae0f2c signal to upsert whether reclaims are important (#18900)
* signal to upsert whether reclaims are important

* reclaims_must_be_empty -> previous_slot_entry_was_cached

* UPSERT_RECLAIMS_MUST_BE_EMPTY_FALSE -> UPSERT_PREVIOUS_SLOT_ENTRY_WAS_CACHED_FALSE
2021-08-09 08:58:59 -05:00
fd937548a0 Move SnapshotArchiveInfo and friends into its own module (#19114) 2021-08-08 07:57:06 -05:00
00890957ee Add snapshot_utils::bank_from_latest_snapshot_archives() (#18983)
While reviewing PR #18565, as issue was brought up to refactor some code
around verifying the bank after rebuilding from snapshots.  A new
top-level function has been added to get the latest snapshot archives
and load the bank then verify.  Additionally, new tests have been
written and existing tests have been updated to use this new function.

Fixes #18973

While resolving the issue, it became clear there was some additional
low-hanging fruit this change enabled.  Specifically, the functions
`bank_to_xxx_snapshot_archive()` now return their respective
`SnapshotArchiveInfo`.  And on the flip side,
`bank_from_snapshot_archives()` now takes `SnapshotArchiveInfo`s instead
of separate paths and archive formats.  This bundling simplifies bank
rebuilding.
2021-08-06 20:16:06 -05:00
7923c26939 AccountsDb::new_with_config_for_tests (#19103) 2021-08-06 17:18:16 -05:00
f771063275 get rid of Accounts new and default (#19100) 2021-08-06 15:52:27 -05:00
216a1b3d74 remove Bank::default() (#19099) 2021-08-06 13:10:13 -05:00
c12289fd1b remove AccountsDb::new() from public api (#19098) 2021-08-06 13:07:50 -05:00
41f4973f0d accounts default refactoring stragglers (#19097) 2021-08-06 12:36:42 -05:00
ca37873e16 rework bank::new_with_paths (#19087)
* rework bank::new_with_paths

* missing 1 bench
2021-08-06 09:30:40 -05:00
8878f526ce rework AccountsIndex traits (#19089) 2021-08-06 08:39:34 -05:00
592013eaf4 Clean within shrink_all_slots (#19042)
Co-authored-by: Carl Lin <carl@solana.com>
2021-08-05 23:26:38 -07:00
0028442e14 rework defaults and construction of accountsdb, accounts, bank (#19083)
* rework defaults and construction of accountsdb, accounts, bank

* merge issues
2021-08-05 17:27:13 -05:00
e368f10973 add _for_tests to new_no_wallclock_throttle (#19086) 2021-08-05 14:50:25 -05:00
a9014ceceb Bank::default_for_tests() (#19084) 2021-08-05 11:53:29 -05:00
24207a09ac remove AccountsIndex::default (#19082)
* accounts_db calls AccountsDb::new(bins)

* remove AccountsIndex::default
2021-08-05 11:38:53 -05:00
5cf28689e6 accounts_db calls AccountsDb::new(bins) (#19068) 2021-08-05 11:15:26 -05:00
67788ad206 move AccountsIndex upsert into static WriteAccountMapEntry (#18899)
* rework accounts index to push upsert deeper

* clean up return value of upsert_existing_key

* upsert_existing_key -> update_key_if_exists

* upsert_new_key -> upsert

* upsert_item -> lock_and_update_slot_list

* update_static -> update_slot_list
2021-08-05 08:45:08 -05:00
bf16b0517c add _for_tests to setup_bank_and_vote_pubkeys (#19060) 2021-08-05 08:43:35 -05:00
087db70df6 add traits required by IsCached (#19066) 2021-08-05 08:43:00 -05:00
14361906ca for all tests, bank::new -> bank::new_for_tests (#19064) 2021-08-05 08:42:38 -05:00
dfe99efa7c introduce AccountsIndex::default_for_tests() (#19067) 2021-08-04 21:58:53 -05:00
5a4979f25f Handle 0-lamport account in index generation (#19041)
* Handle 0-lamport account in index generation

* rename duplicate to dirty keys

Co-authored-by: Carl Lin <carl@solana.com>
2021-08-04 23:33:47 +00:00
bde9b4de94 Bank::new -> Bank::new_for_benches (#19063) 2021-08-04 17:30:43 -05:00
3280ae3e9f add validator option --accounts-db-skip-shrink (#19028)
* add validator option --accounts-db-skip-shrink

* typo
2021-08-04 17:28:33 -05:00
68cc71409e Do not shell out for tar (#19043)
When making a snapshot archive, we used to shell out and call `tar -S`
for sparse file support.  The tar crate supports sparse files, so no
need to do this anymore.

Fixes #10860
2021-08-04 17:07:55 -05:00
a1112254a5 Fix wrong old snapshot archives getting purged (#19061)
I introduced a bug where old snapshot archives were incorrectly purged.
Instead of purged to oldest, I was purged the newest...

The fix is to add a `reverse()` in the purge logic, and I've added a
test to catch this bug in the future.

Fixes #19057
2021-08-04 16:42:42 -05:00
0b8d14b0fc move towards account index being dynamically allocated (#19034) 2021-08-04 15:28:35 -05:00
1ed12a07ab introduce Bank::new_for_tests (#19062) 2021-08-04 15:06:57 -05:00
ca14475085 Add incremental_snapshot_archive_interval_slots to SnapshotConfig (#19026)
This commit also renames `snapshot_interval_slots` to
`full_snapshot_archive_interval_slots`, updates the comments on the
fields, and make appropriate updates where SnapshotConfig is used.
2021-08-04 14:40:20 -05:00
6a995f5dfd rename to AccountsDb::new_single_for_tests (#19039) 2021-08-04 11:47:11 -05:00
31a620c42b move towards accounts index being dynamic (#19032) 2021-08-04 09:18:05 -05:00
06e08c4840 move package_snapshots to AccountsPackagePre ctors (#18997)
This PR solves #18815. Note that I had to make the snapshot prefix
constants inside `snapshot_utils.rs` public at the crate level in order
to make this work. I'm not sure whether or not introducing this
dependency is entirely good, either way the `snapshot_utils.rs` file
needs a lot of rework so things will move around, I believe this does
the work in the meantime. Any feedback will be greatly appreciated.
2021-08-04 09:03:03 -05:00
06a7a9e544 remove superfluous collect()s 2021-08-04 07:21:55 +00:00