Commit Graph

987 Commits

Author SHA1 Message Date
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
sakridge
ce17de7d25 Add option to wait for a specific epoch length to bench-tps (#10083) 2020-05-20 16:42:46 -07:00
Jack May
4a72c2b054 Support cross-program invocation to native programs (#10136) 2020-05-20 09:24:57 -07:00
Tyera Eulberg
9d89fb5c35 Fix another unstable test after eager rent (#10120) 2020-05-20 09:57:33 -06:00
Jack May
36627fb8b3 move builtin programs out of bank (#10132)
automerge
2020-05-19 19:45:30 -07:00
Jack May
431a228402 fix clock bankhash mismatch (#10078)
automerge
2020-05-18 19:48:06 -07:00
Michael Vines
bbc549f592 Rename program_id to owner in system instructions (#10069) 2020-05-18 12:55:41 -07:00
Kristofer Peterson
4ca352a344 Use serde provided serialization for atomics (#10096)
automerge
2020-05-18 08:30:27 -07:00
Greg Fitzgerald
5e89bd8868 Panic if no fee-payer found via Message::new() (#10050)
automerge
2020-05-15 12:23:09 -07:00
Kristofer Peterson
58ef02f02b 9951 clippy errors in the test suite (#10030)
automerge
2020-05-15 09:35:43 -07:00
Jack May
eb1acaf927 Remove archiver and storage program (#9992)
automerge
2020-05-14 18:22:47 -07:00
Ryo Onodera
13bc3f8094 Fix unstable test after eager rent collection (#10031)
automerge
2020-05-13 10:35:58 -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
Jack May
97e17f9b32 Programs can only sign their accounts 2020-05-11 09:06:05 -07:00
Tyera Eulberg
3ee702a922 Rpc: Add getCirculatingSupply endpoint, redux (#9953)
* Add Bank.clock() helper

* Add non-circulating calculations

* Plumb getSupply rpc endpoint

* Add docs for getSupply, and remove getTotalSupply from docs

* Add pubkeys! procedural macro

* Use procedural macro in non_circulating_supply
2020-05-09 12:05:29 -06:00
Ryo Onodera
00e45ec935 Maintain sysvar balances for consistent market cap. (#9936)
* Maintain sysvar balances for consistent market cap.

* Unindent
2020-05-09 02:42:32 +09:00
Ryo Onodera
2ac50177a6 Include account.owner into account hash (#9917)
automerge
2020-05-07 13:01:11 -07:00
Tyera Eulberg
754c65c066 Refactor RPC subscriptions account handling (#9888)
* Switch subscriptions to use commitment instead of confirmations

* Add bank method to return account and last-modified slot

* Add last_modified_slot to subscription data and use to filter account subscriptions

* Update tests to non-zero last_notified_slot

* Add accounts subscriptions to test; fails at higher tx load

* Pass BankForks to RpcSubscriptions

* Use BankForks on add_account_subscription to properly initialize last_notified_slot

* Bundle subscriptions

* Check for non-equality

* Use commitment to initialize last_notified_slot; revert context.slot chage
2020-05-07 00:23:06 -06: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
Tyera Eulberg
f5b0d13f08 Rpc: add getLargestAccounts endpoint (#9869)
automerge
2020-05-04 16:46:10 -07:00
sakridge
f37f83fd12 Fuzzer test and fixes (#9853) 2020-05-02 08:07:52 -07:00
sakridge
894549f002 Put empty accounts in the accounts list on load (#9840)
Indexing into accounts array does not match account_keys otherwise.
Also enforce program accounts not at index 0
Enforce at least 1 Read-write signing fee-payer account.
2020-05-01 17:23:33 -07:00
Michael Vines
8dfe0affd4 Add incinerator sysvar (#9815) 2020-04-30 22:04:08 -07:00
Michael Vines
230df0ec0c Upgrade to Rust 1.43.0 (#9754) 2020-04-29 18:02:05 -07:00
Jack May
068f12fd6f Add Cross-program invocations (#9582) 2020-04-28 14:33:56 -07:00
sakridge
aac580686f fix test compilation from add_static_program change (#9755) 2020-04-27 23:37:08 -07:00
Jack May
efad193180 Make default programs static (#9717) 2020-04-27 21:05:12 -07:00
anatoly yakovenko
8ef097bf6f Input values are not sanitized after they are deserialized, making it far too easy for Leo to earn SOL (#9706)
* sanitize gossip protocol messages
* sanitize transactions
* crds protocol sanitize
2020-04-27 11:06:00 -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
e907c0e650 Filter program ids to store (#9721)
automerge
2020-04-26 00:11:37 -07:00
Greg Fitzgerald
76b1c2baf0 One less alloc per transaction (#9705)
* One less alloc per transaction

* Fix benches

* Fix compiler warnings in bench build

* Fix move build

* Fix bench
2020-04-24 13:03:46 -06:00
Jack May
b1a0abc7a6 Bump libloading to v0.6.1 (#9615)
automerge
2020-04-20 16:46:06 -07:00
Jack May
d08517db8c Nit picks (#9580) 2020-04-18 22:39:08 -07:00
Jack May
58887c591b Add and update tests (#9566) 2020-04-18 17:04:13 -07:00
Jack May
241a05fc52 Add native loader entry points (#9486) 2020-04-15 09:41:29 -07:00
sakridge
217828a849 Reduce accounts_db prints (#9469) 2020-04-15 09:05:54 -07:00
Ryo Onodera
c77ed82caa Use same max_age regardless of leader/not-leader (#9423)
automerge
2020-04-14 00:34:41 -07:00
sakridge
99655206c8 Calculate account refs fix (#9447) 2020-04-11 12:52:10 -07:00
Jack May
ad0482be73 Revert "Add native loader entry points (#9275)" Breaks genesis_config abi (#9377)
This reverts commit ed86d8d1fc.
2020-04-08 14:36:18 -07:00
carllin
4522e85ac4 Add Metrics/Dashboards tracking block production (#9342)
* Add metric tracking blocks/dropped blocks

Co-authored-by: Carl <carl@solana.com>
2020-04-08 14:35:24 -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
Jack May
ed86d8d1fc Add native loader entry points (#9275) 2020-04-03 17:40:59 -07:00
Jack May
268e04cb4a Rename CustomError to Custom (#9207) 2020-04-01 09:01:11 -07:00
Jack May
130c0b484d Enforce an executable's rent exemption in the runtime (#9134) 2020-03-31 10:07:38 -07:00
Tyera Eulberg
50fa577af8 Use cluster confirmations in rpc and pubsub (#9138)
* Add runtime methods to simply get status and slot

* Add helper function to get slot confirmation_count from BlockCommitmentCache

* Return cluster confirmations in getSignatureStatus

* Remove use of invalid get_signature_confirmation_status

* Remove unused methods

* Update pubsub to use cluster confirmations

* Fix test_check_signature_subscribe failure

* Refactor confirmations to read commitment cache only once

* Review comments

* Use bank, root from BlockCommitmentCache

* Update docs

* Add metric for block-commitment aggregations

Co-authored-by: Justin Starry <justin@solana.com>
2020-03-30 17:53:25 -06:00
sakridge
b1771b92ec Calculate ref counts earlier to prevent bad clean (#9147) 2020-03-29 14:42:34 -07:00
Ryo Onodera
729cc4e04f Sanitize zero lamport accounts in append vecs (#9083) 2020-03-29 15:45:45 +09:00
Jack May
e2491c6322 Prevent add/subtract from executable account (#9132) 2020-03-27 16:43:25 -07:00
Justin Starry
5d9298543f Exclude all executable accounts from rent collection (#9116)
* Whitelist executable accounts for rent exemption

* nudge
2020-03-27 23:28:18 +08:00