Commit Graph

286 Commits

Author SHA1 Message Date
carllin 55be8d4016
Move dropping AppendVecs outside lock (#12408)
* Move drop outside lock

Co-authored-by: Carl Lin <carl@solana.com>
2020-09-23 14:17:49 -07:00
sakridge 3930cb865a
Add keccak-secp256k1 instruction (#11839)
* Implement keccak-secp256k1 instruction

Verifies eth addreses with ecrecover function

* Move secp256k1 test
2020-09-15 18:23:21 -07:00
Ryo Onodera de4a613610
Check bank capitalization (#11927)
* Check bank capitalization

* Simplify and unify capitalization calculation

* Improve and add tests

* Avoid overflow and inhibit automatic restart

* Fix test

* Tweak checked sum for cap. and add tests

* Fix broken build after merge conflicts..

* Rename to ClusterType

* Rename confusing method

* Clarify comment

* Verify cap. in rent and inflation tests

Co-authored-by: Stephen Akridge <sakridge@gmail.com>
2020-09-12 01:48:06 +09:00
Ryo Onodera c274e26eb8
Prevent unbound memory growth by blockstore_processor (#12110)
* Prevent unbound memory growth by blockstore_processor

* Promote log to info! considering infrequency

* Exclude the time of freeing from interval...

* Skip not-shrinkable slots even if forced

* Add comment
2020-09-09 12:05:10 +09:00
Ryo Onodera 53b8ea4464
Rename to ClusterType and restore devnet compat. (#12068)
* Rename to ClusterType and restore devnet compat.

* De-duplicate parse code and add comments

* Adjust default Devnet genesis & reduce it in tests
2020-09-08 23:55:09 +09:00
carllin a13efc52b3
Add unlock epochs for blake3 (#12054)
Co-authored-by: Carl <carl@solana.com>
2020-09-04 15:21:15 -07:00
carllin af08221aec
Switch account hashing to blake3 (#11969)
* Switch account hashing to blake3

Co-authored-by: Carl <carl@solana.com>
2020-09-02 00:37:36 -07:00
sakridge 770d3d383c
Accounts hash calculation metrics (#11433) 2020-08-06 21:39:10 -07:00
Michael Vines eefcf484cb clippy 2020-08-03 18:35:15 +00:00
Ryo Onodera 3e4f49f9c9
Fix race condition between shrinking and cleaning (#11235)
* Fix race condition between shrinking and cleaning

* Minor formatting

* fix ci

* Update comments

* More update comment

* Adjust fn naming
2020-07-29 06:06:14 +09:00
Michael Vines e5d8c4383f Add Bank support for "upgrade epochs" where all non-vote transactions will be rejected 2020-07-17 08:48:42 -07:00
sakridge 8bf3a0aa05
accounts_clean: Convert stack dependency calculation with iterative (#11067)
* accounts_clean: Convert stack dependency calculation with iterative

* optimize clean with by creating a reverse-lookup hashset of the affected
keys

* Add dependency bench

reduce bench

* Huge clean
2020-07-15 06:49:22 -07:00
Kristofer Peterson ed5a2f2a90
Fold bank serialisation into serde snapshot (#10581)
* Move bank (de)serialisation logic from bank and snapshot_utils to serde_snapshot.
Add sanity assertions between genesis config and bank fields on deserialisation.
Atomically update atomic bool in quote_for_specialization_detection().
Use same genesis config when restoring snapshots in test cases.

* Tidy up namings and duplicate structs to version

* Apply struct renames to tests

* Update abi hashes

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2020-07-13 23:00:59 +09:00
sakridge edf2b1ee85
Check for deleting key, make sure list is empty again (#11007) 2020-07-11 20:38:34 -07:00
sakridge 631f051c68
Add jitter to cleanup to prevent all nodes cleaning at the same time (#10936) 2020-07-10 11:54:45 -07:00
sakridge 6429042b6e
Add --print-account-stats/--snapshot-archive-path arguments to ledger-tool (#10945)
Allows for seeing how the accounts are being stored
and specifying a different snapshot source directory.
2020-07-08 09:32:11 -07:00
Ryo Onodera 39b3ac6a8d
Introduce automatic ABI maintenance mechanism (2/2; rollout) (#8012)
* Introduce automatic ABI maintenance mechanism (2/2; rollout)

* Fix stable clippy

* Change to symlink

* Freeze abi of Tower

* fmt...

* Improve dev-experience!

* Update BankSlotDelta

$ diff -u /tmp/abi8/*7dg6BreYxTuxiVz6aLvk3p2Z7GQk2cJqfGvC9h4FAoSj* /tmp/abi8/*9chBcbXVJ4fK7uGgydQzam5aHipaAKFw6V4LDFpjbE4w*
--- /tmp/abi8/bank__BankSlotDelta_frozen_abi__test_abi_digest_7dg6BreYxTuxiVz6aLvk3p2Z7GQk2cJqfGvC9h4FAoSj      2020-06-18 18:01:22.831228087 +0900
+++ /tmp/abi8/bank__BankSlotDelta_frozen_abi__test_abi_digest_9chBcbXVJ4fK7uGgydQzam5aHipaAKFw6V4LDFpjbE4w      2020-07-03 15:59:58.430695244 +0900
@@ -140,7 +140,7 @@
                                                         field u8
                                                             primitive u8
                                                         field solana_sdk::instruction::InstructionError
-                                                            enum InstructionError (variants = 34)
+                                                            enum InstructionError (variants = 35)
                                                                 variant(0) GenericError (unit)
                                                                 variant(1) InvalidArgument (unit)
                                                                 variant(2) InvalidInstructionData (unit)
@@ -176,6 +176,7 @@
                                                                 variant(31) CallDepth (unit)
                                                                 variant(32) MissingAccount (unit)
                                                                 variant(33) ReentrancyNotAllowed (unit)
+                                                                variant(34) MaxSeedLengthExceeded (unit)
                                                     variant(9) CallChainTooDeep (unit)
                                                     variant(10) MissingSignatureForFee (unit)
                                                     variant(11) InvalidAccountIndex (unit)

* Fix some merge conflicts...
2020-07-06 20:22:23 +09:00
sakridge 832d47317e
Move clean accounts to background service (#10898) 2020-07-02 22:25:17 -07:00
Greg Fitzgerald 0550b893b0
Fix typos (#10675)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-06-17 20:54:52 -07:00
carllin 8bd62d78eb
Fix race in remove_unrooted_slot (#10607)
* Fix race

* clippy fixes

* Rename and add comment

Co-authored-by: Carl <carl@solana.com>
2020-06-15 19:41:26 -07:00
Ryo Onodera dfe72d5242
Optimize stale slot shrinking for previously cleaned roots (#10099)
* Prioritize shrinking of previously cleaned roots

* measure time of stale slot shrinking

* Disable shrink for test

* shrink: budgeting, store count, force for snapshot

* Polish implementation and fix tests

* Fix ci..

* Clean up a bit

* Further polish implementation and fix/add tests

* Rebase fixes

* Remove unneeded Default for AccountStorageEntry

* Address review comments

* More cleanup

* More cleanup
2020-06-12 14:51:43 +09:00
Boqin Qin 0a638a8f17
runtime: fix possible deadlock in accounts_db (#10469) 2020-06-10 19:37:15 +09:00
Kristofer Peterson e23340d89e
Clippy cleanup for all targets and nighly rust (also support 1.44.0) (#10445)
* address warnings from 'rustup run beta cargo clippy --workspace'

minor refactoring in:
- cli/src/cli.rs
- cli/src/offline/blockhash_query.rs
- logger/src/lib.rs
- runtime/src/accounts_db.rs

expect some performance improvement AccountsDB::clean_accounts()

* address warnings from 'rustup run beta cargo clippy --workspace --tests'

* address warnings from 'rustup run nightly cargo clippy --workspace --all-targets'

* rustfmt

* fix warning stragglers

* properly fix clippy warnings test_vote_subscribe()
replace ref-to-arc with ref parameters where arc not cloned

* Remove lock around JsonRpcRequestProcessor (#10417)

automerge

* make ancestors parameter optional to avoid forcing construction of empty hash maps

Co-authored-by: Greg Fitzgerald <greg@solana.com>
2020-06-09 09:38:14 +09:00
Michael Vines e3b444834f
Add more logging while unpacking snapshots (#10266) 2020-05-27 10:41:05 -07:00
Kristofer Peterson b7a32f01c0
Multi-version snapshot support (#9980)
* Multi-version snapshot support

* rustfmt

* Remove CLI options and runtime support for selection output snapshot version.
Address some clippy complaints.

* Muzzle clippy type complexity warning.

Despite clippy's suggestion, it is not currently possible to create type aliases
for traits and so everything within the 'Box<...>' cannot be type aliased.

This then leaves creating full blown traits, and either implementing
said traits by closure (somehow) or moving the closures into new structs
implementing said traits which seems a bit of a palaver.

Alternatively it is possible to define and use the type alias 'type ResultBox<T> = Result<Box<T>>'
which does seems rather pointless and not a great reduction in complexity but is enough to keep clippy happy.

In the end I simply went with squelching the clippy warning.

* Remove now unused Serialize/Deserialize trait implementations for AccountStorageEntry and AppendVec

* refactor versioned de/serialisers

* rename serde_utils to serde_snapshot

* move call to accounts_db.generate_index() back down to context_accountsdb_from_stream()

* update version 1.1.1 to 1.2.0
remove nested use of serialize_bytes

* cleanups

* Add back measurement of account storage entry serialization.
Remove construction of Vec and HashMap temporaries during serialization.

* consolidate serialisation test cases into serde_snapshot.
clean up leakage of implementation details in serde_snapshot.

* move short term / legacy snapshot code into child module

* add serialize_iter_as_tuple

* preliminary integration of following commit

commit 6d58b73c47294bfb93465d5a83cd2175660b6e6d
Author: Ryo Onodera <ryoqun@gmail.com>
Date:   Wed May 20 14:02:02 2020 +0900

    Confine snapshot 1.1 relic to versioned codepath

* refactored serde_snapshot, rustfmt
legacy accounts_db format now "owns" both leading u64s, legacy bank_rc format has none

* reduce type complexity (clippy)
2020-05-23 02:54:24 +09:00
Kristofer Peterson 58ef02f02b
9951 clippy errors in the test suite (#10030)
automerge
2020-05-15 09:35:43 -07:00
Ryo Onodera 1eb40c3fe0
Introduce eager rent collection (#9527)
* Switch AccountsIndex.account_maps from HashMap to BTreeMap

* Introduce eager rent collection

* Start to add tests

* Avoid too short eager rent collection cycles

* Add more tests

* Add more tests...

* Refacotr!!!!!!

* Refactoring follow up

* More tiny cleanups

* Don't rewrite 0-lamport accounts to be deterministic

* Refactor a bit

* Do hard fork, restore tests, and perf. mitigation

* Fix build...

* Refactor and add switch over for testnet (TdS)

* Use to_be_bytes

* cleanup

* More tiny cleanup

* Rebase cleanup

* Set Bank::genesis_hash when resuming from snapshot

* Reorder fns and clean ups

* Better naming and commenting

* Yet more naming clarifications

* Make prefix width strictly uniform for 2-base partition_count

* Fix typo...

* Revert cluster-dependent gate

* kick ci?

* kick ci?

* kick ci?
2020-05-13 16:22:14 +09:00
Justin Starry 5cc252d471
Remove hash field from account (#9915) 2020-05-12 23:39:46 +08:00
Ryo Onodera 2ac50177a6
Include account.owner into account hash (#9917)
automerge
2020-05-07 13:01:11 -07:00
carllin 3442f36f8a
Repair alternate versions of dead slots (#9805)
Co-authored-by: Carl <carl@solana.com>
2020-05-05 14:07:21 -07:00
Michael Vines 230df0ec0c
Upgrade to Rust 1.43.0 (#9754) 2020-04-29 18:02:05 -07:00
Ryo Onodera 9918539229
Introduce type alias Ancestors (#9699)
* Introduce type alias AncestorList

* Rename AncestorList => Ancestors
2020-04-27 11:07:03 +09:00
sakridge 217828a849
Reduce accounts_db prints (#9469) 2020-04-15 09:05:54 -07:00
sakridge 99655206c8
Calculate account refs fix (#9447) 2020-04-11 12:52:10 -07:00
Ryo Onodera b28ec430e4
Introduce background stale AppendVec shrink mechanism (#9219)
* Introduce background AppendVec shrink mechanism

* Support ledger tool

* Clean up

* save

* save

* Fix CI

* More clean up

* Add tests

* Clean up yet more

* Use account.hash...

* Fix typo....

* Add comment

* Rename accounts_cleanup_service
2020-04-06 17:30:23 +09:00
sakridge b1771b92ec
Calculate ref counts earlier to prevent bad clean (#9147) 2020-03-29 14:42:34 -07:00
Ryo Onodera 2623c71ed3
Use type aliases/resulting var names consistently (#9060) 2020-03-26 13:08:56 +09:00
Justin Starry ef3af104ae
Return appropriate error for invalid program account (#9047)
automerge
2020-03-25 13:23:05 -07:00
sakridge 45348b2c83
Remove accounts unwrap (#9062)
automerge
2020-03-25 10:21:30 -07:00
sakridge c530fbd22b
Remove thread-priority crate which is not cross-platform (#9023) 2020-03-23 12:18:52 -07:00
sakridge 4b397d15b3
Accounts cleanup service and perf improvements (#8799)
* Use atomic for ref count instead of taking rwlock

* Accounts cleanup service

* Review comments
2020-03-23 08:50:23 -07:00
Michael Vines 88ba8439fc
Add frozen account support (#8989)
automerge
2020-03-22 11:10:04 -07:00
sakridge 4dd0367136
Rwlock storage opt (#9006)
* Remove unecessary account paths rwlock

* Remove path rwlock in accounts_db and optimize storage critical section
2020-03-22 10:04:03 -07:00
sakridge 3ea556bc24
Drop storage lock (#8997) 2020-03-21 13:37:52 -07:00
Ryo Onodera 4bbf09f582
Enable conservative out-of-bound snapshot cleaning (#8811)
* Enable conservative out-of-bound snapshot cleaning

* Add tests
2020-03-13 14:44:00 +09:00
Ryo Onodera 952cd38b7b
Avoid early clean and bad snapshot by ref-counting (#8724)
* Avoid early clean and bad snapshot by ref-counting

* Add measure

* Clean ups

* clean ups
2020-03-13 14:14:37 +09:00
Michael Vines f146c92e88
Always and fully normalize stored 0-lamport accts. (#8657) 2020-03-05 09:14:40 -07:00
sakridge b084c1d437
Remove accounts hack and correctly restore accounts store counts (#8569)
* Remove accounts hack and correctly restore append-vec counts

* Add test
2020-03-03 20:48:55 -08:00
sakridge 4f05f08f5d
Use fs::rename which is much faster than move_items (#8579) 2020-03-03 10:03:17 -08:00
Ryo Onodera d86103383a
Do periodic inbound cleaning for rooted slots (#8436)
* Do periodic inbound compaction for rooted slots

* Add comment

* nits

* Consider not_compacted_roots in cleanup_dead_slot

* Renames in AccountsIndex

* Rename to reflect expansion of removed accounts

* Fix a comment

* rename

* Parallelize clean over AccountsIndex

* Some niceties

* Reduce locks and real chunked parallelism

* Measure each step for sampling opportunities

* Just noticed par iter is maybe lazy

* Replace storage scan with optimized index scan

* Various clean-ups

* Clear uncleared_roots even if no updates
2020-03-03 14:57:25 +09:00
Ryo Onodera 5d9130a3c4 Hack to skip cleanup_dead_slots upon snapshot load 2020-03-02 10:24:12 -07:00
Ryo Onodera 0b48c8eb35
Promote dangerous cond. from just warning to panic (#8439) 2020-02-26 05:09:57 +09:00
sakridge 947a339714
Add snapshot hash of full accounts state (#8295)
* Add snapshot hash of full accounts state

* Use normal hashing for the accounts delta state

* Add merkle
2020-02-22 13:46:40 -08:00
Ryo Onodera d238371b0c
Correct missing entry handling to avoid bad warns (#8339)
* Correct missing entry handling to avoid bad warns

* Pass storage entries to AccountStorageSerialize

* Fix CI.....

* Add tests and reorder condition for cheapest first

* Remove unneeded reference
2020-02-21 15:27:55 +09:00
Tyera Eulberg ab361a8073
Rename KeypairUtil to Signer (#8360)
automerge
2020-02-20 13:28:55 -08:00
Ryo Onodera 027ec71aa9
Remove AccountInfo's (De)Serialize (#8313)
automerge
2020-02-17 03:07:36 -08:00
Ryo Onodera 58727463e1
Remove needless last_root for better reclaims (#8148)
* Restore last_root to fix unintended storage delete

* Remove last_root thing altogether

* Remove unneeded test...
2020-02-13 08:19:53 +09:00
sakridge a8028fbb93
Fix accounts_db store counts in purging accounts logic (#8218)
* Show insufficient purge_zero_lamport_account logic

* Add another pass to detect non-deleted values and increment the count

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2020-02-12 08:51:03 -08:00
Michael Vines 3ac0192d40 Better surface bank hash verification failures 2020-02-05 11:39:47 -07:00
sakridge 78f6ddc5b7
Fix spelling of verification in accounts_db (#8117)
automerge
2020-02-04 11:45:47 -08:00
Jack May 83718a3b3e
Cleanup runtime use syntax (#8002) 2020-01-28 17:03:20 -08:00
Ryo Onodera 2c7447b73e
Secure sysvars under hash by freezing all strictly (#7892)
* Secure sysvars under hash by freezing all strictly

* Fix hash's non-idempotnet and add new test

* Clean up

* More cleanups
2020-01-24 16:10:32 +09:00
Michael Vines 8b8033c72b Set BankRc slot correctly when restoring a bank snapshot 2020-01-23 13:37:13 -07:00
Justin Starry 87598c7612 Consolidate tx error counters and update metrics dashboard (#7724)
automerge
2020-01-16 23:26:50 -08:00
Ryo Onodera b16c30b4c6
Fix cluster collapse due to no proper shifted read (#7797)
* Fix cluster collapse due to no proper shifted read

* Add test for bank hash mismatch

Co-authored-by: sakridge <sakridge@gmail.com>
2020-01-15 11:45:19 +09:00
sakridge 3b78be83cf Add hash stats information to check hashes between validators (#7780)
automerge
2020-01-14 11:57:29 -08:00
Ryo Onodera 865c42465a
Cap file size for snapshot data files (#7182)
* save limit deserialize

* save

* Save

* Clean up

* rustfmt

* rustfmt

* Just comment out to please CI

* Fix ci...

* Move code

* Rustfmt

* Crean up control flow

* Add another comment

* Introduce predetermined constant limit on snapshot data files (deserialize side)

* Introduce predetermined constant limit on snapshot data files (serialize side)

* rustfmt

* Tweak message

* Revert dynamic memory limit

* Limit size of snapshot data file (de)serialization

* Fix test breakage

* Clean up

* Fix uses formatting

* Rename: deserialize_{for,from}_snapshot

* Simplify comment

* Use Slot

* Provide slot for status cache

* Align variable name with snapshot_status_cache_file_path

* Define serialize_snapshot_data_file_with_metrics

* Fix build.......

* De-marco serialize_snapshot_data_file_with_metrics

* Revert u64 => Slot
2020-01-10 09:49:36 +09:00
Michael Vines 9720c894f1 Use commas to make a log message more readable 2020-01-06 22:31:01 -07:00
Ryo Onodera c8fe4043b6
Rename slot_hash => bank_hash in AcoountsDB (#7579)
* Rename slot_hash => bank_hash in AcoountsDB
2019-12-23 10:50:31 +09:00
Ryo Onodera 3c361eb759
Check account hashes in snapshot (#7559)
* Check for incorrect hash value

* Finish up checking for incorrect hash value

* Fix comment a bit

Co-authored-by: sakridge <sakridge@gmail.com>
2019-12-20 09:39:30 +09:00
sakridge 9d5a07bac4
Move create_dir_all to AccountsDB::new (#7465)
AppendVec create doesn't need to try and create
paths every time and it can stall while snapshot
create is happening.
2019-12-13 16:46:16 -08:00
Ryo Onodera a1ab81a896
Include rent_epoch and executable into account hash (#7415)
* Clean a bit

* Add rent_epoch and executable into account hashing

* Remove comment and instead create an issue
2019-12-12 13:03:33 +09:00
sakridge 0aa4dc904e
Accounts index updates, remove pubkey when dead account (#7408) 2019-12-11 11:11:31 -08:00
Justin Starry b7d4330dd4
Fail fast if account paths cannot be canonicalized (#7300)
* Canonicalize account paths to avoid symlink issues

* fixes
2019-12-05 21:41:29 -05:00
sakridge cfc21e1225
Only serialize rooted append vecs (#7281) 2019-12-05 14:27:46 -08:00
sakridge 887bff572a
More conservative purge_zero_lamport_accounts purge logic (#7157) 2019-12-02 09:51:05 -08:00
sakridge 6c89226ccf
Purge zero lamport accounts on snapshot ingestion (#7010)
Snapshots do not load the original index, so they must
purge zero lamport accounts again.
2019-11-22 18:22:28 -08:00
anatoly yakovenko b150da837a Use epoch as the gossip purge timeout for staked nodes. (#7005)
automerge
2019-11-20 11:25:18 -08:00
Jack May d184d3a732
Merge native programs parts into one unit (#7047) 2019-11-20 10:12:43 -08:00
Sagar Dhawan 42da1ce4e2
Fix bank hash not changing when no internal state has changed (#7052)
* Fix bank hash not changing when no internal state has changed

* Fix unnecessary call to hash_internal_state

* Add blockhash into the bank_hash

* Add blockhash into the bank_hash and update tests

* Refactor accounts_db slot_hashes

* More clarity in comments

* Add clippy suggestion

* Grammar

* Fix compile after clippy made me break it

* Schooled by clippy
2019-11-19 20:19:43 -08:00
Michael Vines 50a17fc00b Use Slot and Epoch type aliases instead of raw u64 (#6693)
automerge
2019-11-02 00:38:30 -07:00
Jack May 5264fded00
Avoid alloc due to vector pushes (#6632) 2019-10-30 21:55:17 -07:00
Rob Walker b4119c454a
credit_only credits forwarding (#6509)
* credit_only_credits_forwarding

* whack transfer_now()

* fixup

* bench should retry the airdrop TX

* fixup

* try to make bench-exchange a bit more robust, informative
2019-10-23 22:01:22 -07:00
sakridge f1172617cc
Purge accounts with lamports=0 on rooted forks (#6315) 2019-10-23 12:46:48 -07:00
Greg Fitzgerald fb39bd45d7
Revert "Rename solana-runtime to sealevel (#6239)" (#6247)
This reverts commit 2e921437cd.
2019-10-04 19:33:29 -06:00
Greg Fitzgerald 2e921437cd Rename solana-runtime to sealevel (#6239)
automerge
2019-10-04 15:02:44 -07:00
Michael Vines f9f5bc2eb5
More clippy 2019-10-02 21:21:07 -07:00
carllin 35365974bf
Remove serializing all ForkHashes (#6110) 2019-09-26 02:01:25 -07:00
carllin 701d90a41d
Remove some AccountStorage Serialization (#6047)
* Remove serialization of AccountStorageEntry fields

* Add metric for evaluating BankRc serialization time

* Serialize AppendVec current len

* Add dashboard metrics

* Move flush of AppendVecs to packaging thread
2019-09-25 18:07:41 -07:00
sakridge 093b5b5267
Prune fork_hashes with dead forks (#6085) 2019-09-25 11:16:14 -07:00
Rob Walker 72fb52ec60
rename balance (#5984) 2019-09-23 15:20:45 -07:00
sakridge 19ae556857
hash account state on store (#5573) 2019-09-20 13:21:12 -07:00
Sagar Dhawan c1d788880d
Limit Rayon threadpool threads (#5871) 2019-09-12 11:39:39 -07:00
Michael Vines 4e827af392
Remove unnecessary trailing semicolons (#5636) 2019-08-23 22:47:54 -07:00
Rob Walker 0ffe7a9c8f
plumb some rent (#5610)
* plumb some rent

* nits

* fixups

* fixups

* fixups
2019-08-23 14:04:53 -07:00
Michael Vines 3fc5009ef2
Snapshot pipefitting through the validator cli (#5617)
* Handle 404 errors better

* Snapshot pipefitting through the validator cli

* Add download progress bar

* Log the current entrypoint slot
2019-08-23 13:02:07 -07:00
carllin 087c43b9ef
Add snapshotting integration test (#5519)
* Add snapshotting integration test

* Update ContactInfo on restart in local cluster nodes
2019-08-21 23:59:11 -07:00
Rob Walker a8b82a0b68
optimize store_accounts (#5557) 2019-08-19 13:00:37 -07:00
carllin 58d4e32c97
Remove serialization of future AppendVecs and serialize AccountStorage correctly (#5510) 2019-08-13 16:05:37 -07:00
sakridge e30ca01999
Only create more append_vecs when the account number grows (#5454)
We only need many append_vecs if the number of accounts is high,
so only create opportunistic ones as accounts are created.
2019-08-07 16:43:52 -07:00
carllin 1dbb5c8647
Deserialize snapshots (#5417)
* Deserialize snapshots
2019-08-05 22:53:19 -07:00
carllin 6cb2040a1b
Snapshot Packaging Service (#5262)
* Snapshot serialization and packaging
2019-07-31 17:58:10 -07:00
Rob Walker 8537da19bb
groom accounts_db (#5283) 2019-07-25 22:59:28 -07:00
Rob Walker 8a12ed029c
make accounts_db own the directory paths (#5230)
* change paths to something accounts_db (the singleton) owns, fixes SIGILL

* fail deserialize if paths don't work
serialize paths, too

* test that paths are populated from a bank snapshot
2019-07-23 13:47:48 -07:00
sakridge 595017499e
accounts_index: RwLock per-account (#5198)
* accounts_index: RwLock per-account

Lots of lock contention on the accounts_index lock,
only take write-lock on accounts_index if we need to insert/remove an
account.
For updates, take a read-lock and then write-lock on the individual
account.

* Remove unneeded enumerate and add comments.
2019-07-20 17:58:39 -07:00
Rob Walker 027ebb6670
no more OUT_DIR (#5139)
* no more OUT_DIR

* no more OUT_DIR

* more information about failure
2019-07-17 14:27:58 -07:00
sakridge b505a0df22
Throw more threads at hash_internal_state (#5023) 2019-07-16 16:58:30 -07:00
Rob Walker 0d27515d09
tmp dirs target to farf (#5079) 2019-07-12 18:28:42 -07:00
Tyera Eulberg 08f6de0acd
Plumb scan_accounts into accounts_db, adding load from storage (#5029) 2019-07-11 12:16:02 -06:00
Rob Walker 727c15ef8a
start from random point in fork stores (#5010) 2019-07-10 18:44:49 -07:00
sakridge a89589a1d5
Add Measure abstraction over measuring time intervals (#4851)
Allows one to swap in different implementations. This provides
the normal Insant::now() -> .elapsed() path.
2019-06-29 15:34:49 +02:00
Tyera Eulberg 66552d7047
Credit-Only Accounts: Cache account balance for thread-safe load/store (#4691)
* Implement CreditOnlyLocks

* Update credit-only atomic on account load

* Update credit-only atomic after bank.freeze_lock; store credits if all credit-only lock references are dropped

* Commit credit-only credits on bank freeze

* Update core to CreditAccountLocks

* Impl credit-only in System Transfer

* Rework CreditAccountLocks, test, and fix bugs

* Review comments: Pass CreditAccountLocks by reference; Tighten up insert block

* Only store credits on completed slot

* Check balance in bench_exchange funding to ensure commit_credits has completed

* Add is_debitable info to KeyedAccount meta to pass into programs

* Reinstate CreditOnlyLocks check on lock_account

* Rework CreditAccountLocks to remove strong_count usage

* Add multi-threaded credit-only locks test

* Improve RwLocks usage

* Review comments: panic if bad things happen; tighter code

* Assert lock_accounts race does not happen

* Revert panic if bad things happen; not a bad thing
2019-06-27 17:25:10 -04:00
Sathish 9e7f618cff Set proper count value for account stores (#4797)
* set count values for store accounts

* Use AppendVecId type
2019-06-25 07:21:45 -07:00
Sathish Ambley 2562e48b9d Check for non zero count value 2019-06-19 08:47:12 -07:00
Sathish Ambley 44967abd1c update storage len 2019-06-17 22:48:27 -07:00
Sathish Ambley 8b41a5d725 periodically save config in separate folders 2019-06-17 22:48:27 -07:00
Sathish Ambley 7fd879b417 Restart validator nodes from snapshots 2019-06-17 22:48:27 -07:00
sakridge 9e3758983d
Find max root and purge roots below it. (#4645)
* Test for forking accounts

* Find max root and purge roots below it.
2019-06-13 17:35:16 -07:00
Tyera Eulberg 0da9ac1a47
Remove unnecessary parameter element (#4666)
* Stop passing pubkey ref unnecessarily

* Cargo.lock
2019-06-12 16:18:27 -06:00
Tyera Eulberg 807c69d97c
Slimmer implementation of credit-only accounts (#4592)
* Add credit-only debit/data check to verify_instruction

* Store credits and pass to accounts_db

* Add InstructionErrors and tests

* Relax account locks for credit-only accounts

* Collect credit-only account credits before passing to accounts_db to store properly

* Convert System Transfer  accounts to credit-only, and fixup test

* Functionalize collect_accounts to unit test

* Review comments

* Rebase
2019-06-10 20:50:02 -06:00
sakridge 966b6999d1
Accounts index opt (#4621)
* Add accounts_index bench

* Don't take the accounts index lock unless needed

* Accounts_index remove insert return vec and add capacity stats

* Use hashbrown hashmap for accounts_index
2019-06-10 18:15:39 -07:00
Rob Walker e7129757c9
store_accounts to use try_available (#4523)
* store_accounts to use try_available

* tighter

* clippy
2019-06-04 11:21:12 -07:00
sakridge dea663d509
Storage arranged by fork (#4518) 2019-06-03 15:34:32 -07:00
Sathish 182096dc1a
Create bank snapshots (#4244)
* Revert "Revert "Create bank snapshots (#3671)" (#4243)"

This reverts commit 81fa69d347.

* keep saved and unsaved copies of status cache

* fix format check

* bench for status cache serialize

* misc cleanup

* remove appendvec storage on purge

* fix accounts restore

* cleanup

* Pass snapshot path as args

* Fix clippy
2019-05-30 21:31:35 -07:00
Pankaj Garg b5324063f1
Use thread pools for rayon par_iter (#4473)
* Use thread pools for rayon par_iter

* address review comments

* cleanup
2019-05-29 17:16:36 -07:00
Michael Vines 9843c3a5cb Restrict transaction fee payers to system accounts (#4198)
automerge
2019-05-24 13:06:55 -07:00
Michael Vines cfe5afd34c
_id => _pubkey variable renaming (#4419)
* wallet: rename *_account_id to *_account_pubkey

* s/from_id/from_pubkey/g

* s/node_id/node_pubkey/g

* s/stake_id/stake_pubkey/g

* s/voter_id/voter_pubkey/g

* s/vote_id/vote_pubkey/g

* s/delegate_id/delegate_pubkey/g

* s/account_id/account_pubkey/g

* s/to_id/to_pubkey/g

* s/my_id/my_pubkey/g

* cargo fmt

* s/staker_id/staker_pubkey/g

* s/mining_pool_id/mining_pool_pubkey/g

* s/leader_id/leader_pubkey/g

* cargo fmt

* s/funding_id/funding_pubkey/g
2019-05-23 23:20:04 -07:00
Rob Walker 81fa69d347
Revert "Create bank snapshots (#3671)" (#4243)
This reverts commit abf2b300da.
2019-05-09 19:27:27 -07:00
Sathish abf2b300da Create bank snapshots (#3671)
* Be able to create bank snapshots

* fix clippy

* load snapshot on start

* regenerate account index from the storage

* Remove rc feature dependency

* cleanup

* save snapshot for slot 0
2019-05-09 19:27:06 -07:00
Tyera Eulberg 71f9b44687
Add Confirmations parameter to RPC Subscriptions (#4154)
* Add optional depth parameter to pubsub, and store in subscriptions

* Pass bank_forks into rpc_subscription; add method to check depth before notify and impl for account subscriptions

* Impl check-depth for signature subscriptions

* Impl check-depth for program subscriptions

* Plumb fork id through accounts

* Use fork id and root to prevent repeated account notifications; also s/Depth/Confirmations

* Write tests in terms of bank_forks

* Fixup accounts tests

* Add pubsub-confirmations tests

* Update pubsub documentation
2019-05-06 08:31:50 -06:00
Rob Walker cb528af4e2
fix accounts_db storage.reset() (#4094)
* fix accounts_db storage.reset()

* fix compilation errors, remove unused, fix test_accounts_grow() failure
2019-05-01 09:27:13 -07:00
anatoly yakovenko c969975fde
lockfree storage (#3963) 2019-04-24 11:51:57 -05:00
Rob Walker 5406d82d89
fix race in get_exclusive_storage() and load() (#3941)
* Revert "Revert "account storage is not in sync with the index after gc (#3914)" (#3936)"

This reverts commit 4f47fc00bc.

* fix get_exclusive_storage

* clippy
2019-04-23 09:56:36 -07:00
Pankaj Garg 4f47fc00bc
Revert "account storage is not in sync with the index after gc (#3914)" (#3936)
This reverts commit 101d6b92ee.
2019-04-22 17:14:41 -07:00
anatoly yakovenko 101d6b92ee
account storage is not in sync with the index after gc (#3914)
* account storage is not in sync with the index after gc

* builds

* clippy fmt

* test

* purge dead forks on store

* rm println

* also fixed count_stores

* comments
2019-04-20 20:50:50 -05:00
anatoly yakovenko f73d38739a
Split AccountsDB from Accounts (#3808)
Split AccountsDB from Accounts
2019-04-16 13:32:22 -07:00