mirror of
https://github.com/sigp/lighthouse.git
synced 2026-06-30 19:34:37 +00:00
Gloas cold DB (#8991)
Closes: - https://github.com/sigp/lighthouse/issues/8958 - Update the `HotColdStore` to handle storage of cold states. - Update `BeaconSnapshot` to hold the execution envelope. This is required to make `chain_dump`-related checks sane, and will be generally useful (see: https://github.com/sigp/lighthouse/issues/8956). - Bug fix in the `BlockReplayer` for the case where the starting state is already `Full` (we should not try to apply another payload). This happens on the cold DB path because we try to replay from the closest cached state (which is often full). - Update `test_gloas_hot_state_hierarchy` to cover the cold DB migration. Co-Authored-By: Michael Sproul <michael@sigmaprime.io> Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>
This commit is contained in:
@@ -5599,6 +5599,7 @@ async fn test_gloas_block_and_envelope_storage_generic(
|
||||
"slot = {slot}"
|
||||
);
|
||||
}
|
||||
check_db_invariants(&harness);
|
||||
}
|
||||
|
||||
/// Test that Pending and Full states have the correct payload status through round-trip
|
||||
@@ -5666,6 +5667,7 @@ async fn test_gloas_state_payload_status() {
|
||||
|
||||
state = full_state;
|
||||
}
|
||||
check_db_invariants(&harness);
|
||||
}
|
||||
|
||||
/// Test block replay with and without envelopes.
|
||||
@@ -5805,6 +5807,7 @@ async fn test_gloas_block_replay_with_envelopes() {
|
||||
replayed_full, expected_full,
|
||||
"replayed full state should match stored full state"
|
||||
);
|
||||
check_db_invariants(&harness);
|
||||
}
|
||||
|
||||
/// Test the hot state hierarchy with Full states stored as ReplayFrom.
|
||||
@@ -5822,7 +5825,7 @@ async fn test_gloas_hot_state_hierarchy() {
|
||||
// 40 slots covers 5 epochs.
|
||||
let num_blocks = E::slots_per_epoch() * 5;
|
||||
// TODO(gloas): enable finalisation by increasing this threshold
|
||||
let some_validators = (0..LOW_VALIDATOR_COUNT / 2).collect::<Vec<_>>();
|
||||
let some_validators = (0..LOW_VALIDATOR_COUNT).collect::<Vec<_>>();
|
||||
|
||||
let (genesis_state, _genesis_state_root) = harness.get_current_state_and_root();
|
||||
|
||||
@@ -5886,6 +5889,7 @@ async fn test_gloas_hot_state_hierarchy() {
|
||||
// Verify chain dump and iterators work with Gloas states.
|
||||
check_chain_dump(&harness, num_blocks + 1);
|
||||
check_iterators(&harness);
|
||||
check_db_invariants(&harness);
|
||||
}
|
||||
|
||||
/// Check that the HotColdDB's split_slot is equal to the start slot of the last finalized epoch.
|
||||
|
||||
Reference in New Issue
Block a user