Commit Graph

1654 Commits

Author SHA1 Message Date
Jeff Washington (jwash) 982454a455
refactor do_shrink_slot_stores (#19560) 2021-09-07 15:10:49 -05:00
Jeff Washington (jwash) 1560d5e3c3
collect rent in parallel for partitions (#19478)
* collect rent in parallel for partitions

* combine use

* use fg accounts db thread pool
2021-09-07 11:51:59 -05:00
Brooks Prumo 9d9482b9d8
Plumb `maximum_incremental_snapshot_archives_to_retain` (#19640) 2021-09-06 18:01:56 -05:00
Sean Young 8b9e472a6c feat: add ed25519 signature verify program
Solang requires a method for verify ed25519 signatures. Add a new
builtin program at address Ed25519SigVerify111111111111111111111111111
which takes any number of ed25519 signature, public key, and message.
If any of the signatures fails to verify, an error is returned.

The changes for the web3.js package will go into another commit, since
the tests test against a released solana node. Adding web3.js ed25519
testing will break CI.
2021-09-05 18:59:37 +01:00
Sean Young d461a9ac10 verify_precompiles needs FeatureSet
Rather than pass in individual features, pass in the entire feature set
so that we can add the ed25519 program feature in a later commit.
2021-09-05 18:59:37 +01:00
Brooks Prumo 333e5a9446
Make purge_old_snapshot_archives aware of maximum_incremental_snapshot_archives_to_retain (#19615) 2021-09-04 07:37:29 -05:00
Tyera Eulberg decec3cd8b
Demote write locks on transaction program ids (#19593)
* Add feature

* Demote write lock on program ids

* Fixup bpf tests

* Update MappedMessage::is_writable

* Comma nit

* Review comments
2021-09-04 03:05:30 +00:00
Jeff Washington (jwash) 7578db7ee3
add lowest_pubkey_from_bin (#19617) 2021-09-04 02:20:55 +00:00
Jeff Washington (jwash) b3fae0a01a
move constants in functions to global space (#19622) 2021-09-03 19:46:42 -05:00
Jeff Washington (jwash) e6055010eb
accounts index iterator takes &Range (#19618) 2021-09-03 18:00:49 -05:00
Jon Cinque 2c3bdedea3
stake: Advance `credits_observed` on activation epoch (#19309)
* stake: Advance `credits_observed` on activation epoch

* Add test for merging stakes just after activation
2021-09-03 23:20:56 +02:00
Brooks Prumo 5e25ee5ebe
Add maximum_incremental_snapshot_archives_to_retain to SnapshotConfig (#19612) 2021-09-03 20:21:32 +00:00
Brooks Prumo 7ab0aec61f
Rename maximum_full_snapshot_archives_to_retain (#19610)
To prepare for adding maximum_incremental_snapshot_archives_to_retain,
rename the current field in SnapshotConfig.
2021-09-03 11:28:10 -05:00
Jeff Washington (jwash) df040c05da
get rid of unneeded mut and refactor addref (#19594) 2021-09-03 10:45:37 -05:00
Jack May 170927b7c4
nit: Move builtins types to builtins file (#19597) 2021-09-02 21:29:11 -07:00
Jeff Washington (jwash) 3936c10aa0
rename var (#19588) 2021-09-03 00:55:35 +00:00
Jeff Washington (jwash) 9cc57fb076
remove file that accidentally got added (#19586) 2021-09-03 00:15:25 +00:00
Brooks Prumo e9374d32a3
Revert "Make startup aware of Incremental Snapshots (#19550)" (#19599)
This reverts commit d45ced0a5d.
2021-09-02 19:14:41 -05:00
Brooks Prumo d45ced0a5d
Make startup aware of Incremental Snapshots (#19550) 2021-09-02 19:05:15 -05:00
Jeff Washington (jwash) 57f51352f6
refactor AccountEntry addref/unref (#19583) 2021-09-02 23:25:27 +00:00
Jeff Washington (jwash) 682daf1117
cleanup of allocate_accounts_index (#19585) 2021-09-02 22:58:07 +00:00
Jeff Washington (jwash) 78585a992b
add IsCached trait bounds to AccountsIndex (#19584) 2021-09-02 22:45:35 +00:00
Jeff Washington (jwash) 2874f6b0a2
create remove_if_slot_list_empty to define accounts index behavior (#19581) 2021-09-02 16:54:37 -05:00
Jeff Washington (jwash) 0571962776
accounts index test uses # test bins (#19580) 2021-09-02 16:32:42 -05:00
Jeff Washington (jwash) 6ab8286e8d
add logging for a handful of tests (#19582) 2021-09-02 16:32:19 -05:00
Jeff Washington (jwash) f5388cfe71
tests which assert or panic in other threads now will report an error (#19532)
* tests which assert or panic in other threads now will report an error

* rename, add assert detecting time out
2021-09-02 11:26:57 -05:00
Jeff Washington (jwash) 7eb793a55e
add debugging to test (#19563)
* add debugging to test

* update cargo
2021-09-02 02:52:16 +00:00
Jeff Washington (jwash) ed2c071fe1
remove unused is_startup (#19561) 2021-09-01 18:39:00 -05:00
Lijun Wang 8378e8790f
Accountsdb replication installment 2 (#19325)
This is the 2nd installment for the AccountsDb replication.

Summary of Changes

The basic google protocol buffer protocol for replicating updated slots and accounts. tonic/tokio is used for transporting the messages.

The basic framework of the client and server for replicating slots and accounts -- the persisting of accounts in the replica-side will be done at the next PR -- right now -- the accounts are streamed to the replica-node and dumped. Replication for information about Bank is also not done in this PR -- to be addressed in the next PR to limit the change size.

Functionality used by both the client and server side are encapsulated in the replica-lib crate.

There is no impact to the existing validator by default.

Tests:

Observe the confirmed slots replicated to the replica-node.
Observe the accounts for the confirmed slot are received at the replica-node side.
2021-09-01 14:10:16 -07:00
Jeff Washington (jwash) a5f74d86c8
make test pass with 1 bin to remove noisy failure during testing (#19554) 2021-09-01 15:58:56 -05:00
Jeff Washington (jwash) dd9481c403
parallelize index_read in shrink (#19506) 2021-09-01 15:40:59 -05:00
Jeff Washington (jwash) 82a6bbe068
add Debug trait to range for accounts index (#19531) 2021-09-01 08:13:56 -05:00
Jeff Washington (jwash) 12dc8749cf
add Copy trait to AccountInfo for fast copies to mmapped file (#19524) 2021-09-01 08:13:08 -05:00
Tyera Eulberg 0088aefa24
Fix tests that make assumptions about tx fee rate (#19537) 2021-08-31 22:02:14 -06:00
Brooks Prumo 1d5a8ebc6a
Revert "Add LastFullSnapshotSlot to SnapshotConfig (#19341)" (#19529)
This reverts commit 4d361af976.
2021-08-31 22:03:19 -05:00
Jeff Washington (jwash) 2df96cd81e
remove type specifics to make funciton more flexible (#19536) 2021-08-31 20:03:42 -05:00
Brooks Prumo fe9ee9134a
Make background services aware of incremental snapshots (#19401)
AccountsBackgroundService now knows about incremental snapshots.  It is
now also in charge of deciding if an AccountsPackage is destined to be a
SnapshotPackage or not (or just used by AccountsHashVerifier).

!!! New behavior changes !!!

Taking snapshots (both bank and archive) **MUST** succeed.

This is required because of how the last full snapshot slot is
calculated, which is used by AccountsBackgroundService when calling
`clean_accounts()`.

File system calls are now unwrapped and will result in a crash. As Trent told me:

>Well I think if a snapshot fails due to some IO error, it's very likely that the operator is going to have to intervene before it works.  We should exit error in this case, otherwise the validator might happily spin for several more hours, never successfully writing a complete snapshot, before something else brings it down.  This would leave the validator's last local snapshot many more slots behind than it would be had we exited outright and potentially force the operator to abandon ledger continuity in favor of a quick catchup

Other errors will set the `exit` flag to `true`, and the node will gracefully shutdown.

Fixes #19167 
Fixes #19168
2021-08-31 18:33:27 -05:00
Brooks Prumo 718ab7c12e Revert "Add snapshot_runtime_info module (#18199)"
This reverts commit c1b9d40a64.
2021-08-31 17:50:18 -05:00
Jack May 5cf8d8795b
Feature cleanup (#19528) 2021-08-31 14:51:26 -07:00
Jeff Washington (jwash) e1939688c2
parallel shrink (#19507) 2021-08-31 11:57:34 -05:00
Jeff Washington (jwash) 0e94b8fd4e
remove redundant cancelled_shrink (#19522) 2021-08-31 11:51:48 -05:00
Jeff Washington (jwash) 9d3afba045
Debug shrink stats (#19505)
* add some shrink metrics

* renames
2021-08-31 09:04:56 -05:00
Lijun Wang 09458cc802
Shrink mmap leakage (#19373)
* Putting stores satisfying future shrink into the candidate list.

* Fixed unit tests for select_shrink_candidates

* Added metrics on stores readded back for next round

* Ehance the metrics on accountsdb to report the total bytes and alive bytes and alive ratio

* Enhance select_shrink_candidates metrics
2021-08-31 00:55:16 -07:00
Jeff Washington (jwash) a655b01700
some basic accounts index refactoring (#19510) 2021-08-30 18:40:10 -05:00
behzad nouri 8ad52fa095
implements copy-on-write for vote-accounts (#19362)
Bank::vote_accounts redundantly clones vote-accounts HashMap even though
an immutable reference will suffice:
https://github.com/solana-labs/solana/blob/95c998a19/runtime/src/bank.rs#L5174-L5186

This commit implements copy-on-write semantics for vote-accounts by
wrapping the underlying HashMap in Arc<...>.
2021-08-30 15:54:01 +00:00
Justin Starry 2d7f036afd
Add solana-program-runtime crate (#19438) 2021-08-27 00:30:36 +00:00
Jeff Washington (jwash) 02b050e0f5
replace AccountsIndex btree with hashmap of 8k bins (#19212) 2021-08-26 18:12:43 -05:00
Jeff Washington (jwash) 98bc694606
hash calculation adds really old slots to dirty_stores (#19434) 2021-08-26 14:32:43 -05:00
Jeff Washington (jwash) 535de3b302
add test for test_clean_nonrooted (#19409) 2021-08-26 13:56:09 -05:00
Brooks Prumo 1a4bede918
Remove filter_snapshot_storages_for_incremental_snapshot() (#19349)
Now that we can get just the subset of snapshot storages we want, the extra
filtering afterwards is redundant.
2021-08-23 09:45:29 -05:00