Commit Graph

1096 Commits

Author SHA1 Message Date
Yueh-Hsuan Chiang f26a457cf5
Add comment block for DeadSlots LedgerColumn (#28341)
Add comment block for DeadSlots LedgerColumn
2022-10-20 09:47:19 -07:00
Yueh-Hsuan Chiang bf37228768
Add comment block for Root ledger column (#28358)
Add comment block for Root ledger column.
2022-10-19 17:06:21 -07:00
Yueh-Hsuan Chiang 9be7ada68d
Improve SlotColumn's code comment. (#28447)
Improve SlotColumn's code comment to include how
LedgerCleanupService manages the clean-up of a SlotColumn.
2022-10-18 23:50:22 -07:00
Yueh-Hsuan Chiang f910f2d7eb
Add comment block for Orphans column family. (#28340)
Add comment block for Orphans column family.
2022-10-16 23:47:02 -07:00
Yueh-Hsuan Chiang 6a96a4c2ee
Add comment block for ErasureMeta ledger column (#28356)
Add comment block for ErasureMeta ledger column.
2022-10-14 12:59:34 -07:00
Yueh-Hsuan Chiang 4539cb75fb
Add comment block for SlotMeta column family (#28339)
Add comment block for SlotMeta column family.
2022-10-14 12:56:56 -07:00
Yueh-Hsuan Chiang 5df10173dd
Add comment block for BankHash ledger column (#28357)
Add comment block for BankHash ledger column.
2022-10-13 11:41:58 -07:00
steviez b8acb1b350
Fix blockstore_processor::load_frozen_forks() halt_at_slot behavior II (#28367)
PR #28317 previously attempted to fix a case where blockstore processing
would create children banks for slots past the halt_at_slot.

However, the previous fix didn't handle the case where a slot could be
strictly less than the halt_at_slot, but have children that were greater
than the halt_at_slot. For example, this could happen if a child of slot
S is S+n where n > 1.

Thus, this change covers our processing logic to cover this second case
as well.
2022-10-12 17:24:27 -05:00
steviez 2929c8f7a2
Fix blockstore_processor::load_frozen_forks() halt_at_slot behavior (#28317)
load_frozen_forks() finds new slots to process by creating new Banks for
the children of the current slot in process_next_slots(). Prior to this
change, we would then immediately check if we had reached the
halt_at_slot and correctly halt processing when appropriate. As such, it
would be possible for Banks to be created for slots beyond the
halt_at_slot.

While a potential child slot that is past halt_at_slot wouldn't be
replayed, the Bank being created still alters some universal state in
AccountsDb. So, this change moves the halt_at_slot check before we
create children Banks in process_next_slots().
2022-10-10 14:37:23 -05:00
steviez 60f6e24b76
Make Blockstore::get_entries_in_data_block() use multi_get() (#28245) 2022-10-09 15:34:03 -04:00
steviez 624f5cfcd5
Add rocksdb multi_get_bytes() method (#28244) 2022-10-07 18:05:13 -04:00
behzad nouri d9ef04772d
moves merkle proof size sanity check to Shred{Code,Data}::merkle_branch (#28266) 2022-10-06 18:54:24 +00:00
steviez 9e8f21ec26
Add metric to track number of slots processed in load_frozen_forks() (#28247) 2022-10-06 12:17:49 -05:00
behzad nouri a6512016a7
uses references for MerkleBranch root and proof fields (#28243) 2022-10-06 15:41:55 +00:00
Brooks Prumo a8c6a9e5fc
Bank::freeze() waits for EAH calculation to complete (#28170) 2022-10-05 17:44:35 -04:00
Jeff Washington (jwash) 7ae7a3ff0e
after replay at validator startup don't verify hash calc (#28222) 2022-10-04 14:04:04 -07:00
Jeff Washington (jwash) 990fb68c34
add sub timings in load_frozen_forks (#28223) 2022-10-04 13:46:02 -07:00
behzad nouri 9e7a0e7420
rolls out merkle shreds to ~5% of testnet (#28199) 2022-10-04 19:36:16 +00:00
steviez 7fef7d569a
Make RocksFifo storage size API expose an Option<u64> (#28192)
A fifo rocksdb instance must be opened with max size parameter on the
fifo columns. To support this, we previously plumbed a constant up to
callers that provided a default if unbounded growth desired.

This change attempts to be more rusty by exposing an option for this
value, and converting the option to a constant at the lowest level
possible.
2022-10-04 12:38:40 -05:00
steviez 49dbae7e53
Use VecDeque as a queue instead of Vec (#28190) 2022-10-03 22:55:59 -05:00
Yueh-Hsuan Chiang 6b17bee5a8
Remove the const default for RocksFifo (#27965)
#### Summary of Changes
Removes the constant default for ShredStorageType::RocksFifo
as the shred storage size is either user-specified or derived
from --limit-ledger-size in #27459.
2022-10-01 15:10:54 -07:00
Jeff Washington (jwash) cfc124c825
acct idx can no longer use write cache (#28150) 2022-09-30 10:55:27 -07:00
steviez f38ed1c266
Use more descriptive variable names in blockstore chaining tests (#28131) 2022-09-29 10:24:09 -05:00
Yueh-Hsuan Chiang 599677f965
Derive rocksdb_fifo_shred_storage_size based on limit-ledger-size (#27459)
### Problem
When FIFO compaction is used while --rocksdb_fifo_shred_storage_size
is unspecified, the FIFO shred storage size is set to a const default based
on the default `--limit-ledger-size`.

### Summary of the Change
When --rocksdb_fifo_shred_storage_size is unspecified, it is now
derived from `--limit-ledger-size` by reserving 1500 bytes for each
shred.
2022-09-28 00:32:27 -07:00
Yueh-Hsuan Chiang fb6abac4ca
Improve code comment for delete_range_cf (#28087)
#### Summary of Changes
Improve code comment for Blockstore::delete_range_cf esp. for the corner case
where the from Slot and to Slot are the same.
2022-09-27 20:12:08 -07:00
Yueh-Hsuan Chiang a76258f276
Improve code comments for ledgerstore columns. (#28054)
### Problem
The documentation of each column family is missing

### Summary
The goal is to create a comment block that will essentially include a high-level
concept on what each column family is about and what are their key/value formats.

This PR is the first cut that includes the key/value format of each column family.
This should at least provide an easy pointer for readers to understand what this
column family stores by searching its value type and how to access the data based
on the key type.
2022-09-27 00:31:23 -07:00
behzad nouri 72537e7e07
bypasses rayon thread-pool for single entry batches (#28077)
With no parallelization, thread-pool only adds overhead.
2022-09-26 21:32:58 +00:00
behzad nouri b9849179c9
bypasses merkle proof verification for recovered merkle shreds (#28076)
Merkle proof for shreds recovered from erasure codes are generated
locally, and it is superfluous to verify them when sanitizing recovered
shreds:
https://github.com/solana-labs/solana/blob/a0f49c2e4/ledger/src/shred/merkle.rs#L727-L760
2022-09-26 21:28:15 +00:00
behzad nouri f49beb0cbc
caches reed-solomon encoder/decoder instance (#27510)
ReedSolomon::new(...) initializes a matrix and a data-decode-matrix cache:
https://github.com/rust-rse/reed-solomon-erasure/blob/273ebbced/src/core.rs#L460-L466

In order to cache this computation, this commit caches the reed-solomon
encoder/decoder instance for each (data_shards, parity_shards) pair.
2022-09-25 18:09:47 +00:00
behzad nouri 45e26574f3
removes redundant shred.sanitize() from blockstore (#28016)
Shreds received from other nodes over the socket are sanitized when the
payload is deserialized:
https://github.com/solana-labs/solana/blob/315707504/ledger/src/shred/legacy.rs#L137
https://github.com/solana-labs/solana/blob/315707504/ledger/src/shred/legacy.rs#L77
https://github.com/solana-labs/solana/blob/315707504/ledger/src/shred/merkle.rs#L355
https://github.com/solana-labs/solana/blob/315707504/ledger/src/shred/merkle.rs#L439

Similarly, shreds recovered from erasure codes are also sanitized at
deserialization:
https://github.com/solana-labs/solana/blob/f02fe9c7e/ledger/src/shredder.rs#L330
or explicitly so for Merkle shreds:
https://github.com/solana-labs/solana/blob/f02fe9c7e/ledger/src/shred/merkle.rs#L753

Shreds generated locally by the node itself during its leader slots do
not need to be sanitized.

So sanitizing shreds in blockstore is redundant and wasteful. In
particular this becomes more wasteful with Merkle shreds because
sanitizing shreds would require verifying Merkle proof.
As such the commit removes redundant shred.sanitize() from blockstore.
2022-09-24 16:31:50 +00:00
behzad nouri f02fe9c7e7
updates reed-solomon-erasure crate version to 6.0.0 (#28033)
Need to pick up:
https://github.com/rust-rse/reed-solomon-erasure/pull/104
in order to unblock:
https://github.com/solana-labs/solana/pull/27510
2022-09-24 15:00:13 +00:00
behzad nouri 9ee53e594d
patches clippy errors from new rust nightly release (#28028) 2022-09-23 20:57:27 +00:00
behzad nouri 97c9af4c6b plumbs through flag to generate merkle variant of shreds 2022-09-23 16:45:18 +00:00
behzad nouri 7d3f3b2f7d generates merkle shreds from ledger entries
The commit adds methods to convert &[Entry] to vector of Merkle shreds.
2022-09-23 16:45:18 +00:00
steviez e4affb9fea
Add Blockstore::highest_slot() method (#27981) 2022-09-23 04:53:43 -05:00
steviez eaa4787201
Cleanup blockstore test (#27999) 2022-09-22 23:37:47 +00:00
dependabot[bot] d84a7a4ce9
chore: bump futures from 0.3.23 to 0.3.24 (#27972)
* chore: bump futures from 0.3.23 to 0.3.24

Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.23 to 0.3.24.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.23...0.3.24)

---
updated-dependencies:
- dependency-name: futures
  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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2022-09-22 16:26:18 -06:00
behzad nouri 9a57c64f21
patches clippy errors from new rust nightly release (#27996) 2022-09-22 22:23:03 +00:00
Brooks Prumo 1ee595ca9c
remove AccountsDb::initial_blockstore_processing_complete (#27974) 2022-09-22 13:52:04 -04:00
dependabot[bot] c4fa849844
chore: bump itertools from 0.10.3 to 0.10.5 (#27962)
* chore: bump itertools from 0.10.3 to 0.10.5

Bumps [itertools](https://github.com/rust-itertools/itertools) from 0.10.3 to 0.10.5.
- [Release notes](https://github.com/rust-itertools/itertools/releases)
- [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-itertools/itertools/commits)

---
updated-dependencies:
- dependency-name: itertools
  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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2022-09-21 15:28:49 -06:00
Jeff Washington (jwash) 7ddacc4bb4
remove extra accounts cap call at startup (#27949) 2022-09-21 09:13:00 -07:00
Yueh-Hsuan Chiang cccade42b3
Optimize get_slots_since() using the batched version of multi_get() (#27686)
#### Problem
The current implementation of get_slots_since() invokes multiple rocksdb::get().
As a result, each get() operation may end up requiring one disk read.  This leads
to poor performance of get_slots_since described in #24878.

#### Summary of Changes
This PR makes get_slots_since() use the batched version of multi_get() instead,
which allows multiple get operations to be processed in batch so that they can
be answered with fewer disk reads.
2022-09-19 21:52:13 -07:00
Jeff Washington (jwash) f2d6a7ecea
bank.initial_blockstore_processing_complete to avoid concurrent hash calculations (#27776)
* bank.initial_blockstore_processing_complete to avoid concurrent hash calculations

* Update runtime/src/bank.rs

Co-authored-by: Brooks Prumo <brooks@prumo.org>

* Update runtime/src/bank.rs

Co-authored-by: Brooks Prumo <brooks@prumo.org>

* Rename TestValidator::set_startup_verification_complete()

* Initialize with `AtomicBool::new(false)` instead of `default()`

* snapshot tests: move where `initial_blockstore_processing_completed()` is called

* fixup bank_forks.rs calling `is_initial_blockstore_processing_complete()`

* only call initial_blockstore_processing_completed() in blockstore_processor

Co-authored-by: Brooks Prumo <brooks@prumo.org>
Co-authored-by: Brooks Prumo <brooks@solana.com>
2022-09-19 13:00:21 -07:00
steviez 4e8e0cda7e
Remove extra data copy from several Rocks get() methods (#27693)
Several of the get() methods return a deserialized object (as opposed to
a Vec<u8>) by first getting a byte array out of Rocks, and then using
bincode::deserialize() to get the underlying type. However,
deserialize() only requires a u8 slice, not an owned Vec<u8>. So, we can
use get_pinned_cf() to reference memory owned by Rocks and avoid an
unnecessary copy.
2022-09-16 18:38:28 -05:00
Yueh-Hsuan Chiang 9831e4ddad
Remove daily rewrite/compaction of each ledger file (#27571)
#### Problem
Previously before #26651, our LedgerCleanupService needs RocksDB background
compactions to reclaim ledger disk space via our custom CompactionFilter.
However, since RocksDB's compaction isn't smart enough to know which file to pick,
we rely on the 1-day compaction period so that each file will be forced to be compacted
once a day so that we can reclaim ledger disk space in time.  The downside of this is
each ledger file will be rewritten once per day.

#### Summary of Changes
As #26651 makes LedgerCleanupService actively delete those files whose entire slot-range
is older than both --limit-ledger-size and the current root, we can remove the 1-day compaction
period and get rid of the daily ledger file rewrite.

The results on mainnet-beta shows that this PR reduces ~20% write-bytes-per-second
and reduces ~50% read-bytes-per-second on ledger disk.
2022-09-16 13:12:55 -07:00
behzad nouri b183e00dcf
patches range check in shred::layout::get_signed_message_range (#27822) 2022-09-16 00:08:10 +00:00
Will Hickey c0e4379f43
Whickey/version v1.15 (#27739)
* Bump version to v1.13.0
* Bump version to v1.14.0
* Bump version to v1.15.0
2022-09-13 09:06:15 -05:00
Yueh-Hsuan Chiang ba3d9cd325
Add LedgerColumn::multi_get() (#26354)
#### Problem
Blockstore operations such as get_slots_since() issues multiple rocksdb::get()
at once which is not optimal for performance.

#### Summary of Changes
This PR adds LedgerColumn::multi_get() based on rocksdb::batched_multi_get(),
the optimized version of multi_get() where get requests are processed in batch
to minimize read I/O.
2022-09-12 15:01:22 -07:00
Jeff Washington (jwash) 765c628546
use exit signal for acct idx bg threads (#27483) 2022-09-12 11:51:12 -07:00
Jeff Washington (jwash) f0770c199e
fix ledger tool final hash calc (#27725)
fix ledger tool final hash calc
2022-09-12 11:09:34 -07:00