Attempt to remove a tree hash from block replaying (#862)
* Attempt to remove a tree hash from block replaying * Add missed thing
This commit is contained in:
parent
f6f924a7a6
commit
fbb630793e
@ -575,9 +575,9 @@ impl<E: EthSpec> HotColdDB<E> {
|
|||||||
// Include the block at the end slot (if any), it needs to be
|
// Include the block at the end slot (if any), it needs to be
|
||||||
// replayed in order to construct the canonical state at `end_slot`.
|
// replayed in order to construct the canonical state at `end_slot`.
|
||||||
.filter(|block| block.message.slot <= end_slot)
|
.filter(|block| block.message.slot <= end_slot)
|
||||||
// Exclude the block at the start slot (if any), because it has already
|
// Include the block at the start slot (if any). Whilst it doesn't need to be applied
|
||||||
// been applied to the starting state.
|
// to the state, it contains a potentially useful state root.
|
||||||
.take_while(|block| block.message.slot > start_slot)
|
.take_while(|block| block.message.slot >= start_slot)
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
blocks.reverse();
|
blocks.reverse();
|
||||||
Ok(blocks)
|
Ok(blocks)
|
||||||
@ -607,6 +607,10 @@ impl<E: EthSpec> HotColdDB<E> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
for (i, block) in blocks.iter().enumerate() {
|
for (i, block) in blocks.iter().enumerate() {
|
||||||
|
if block.message.slot <= state.slot {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
while state.slot < block.message.slot {
|
while state.slot < block.message.slot {
|
||||||
let state_root = state_root_from_prev_block(i, &state);
|
let state_root = state_root_from_prev_block(i, &state);
|
||||||
per_slot_processing(&mut state, state_root, &self.spec)
|
per_slot_processing(&mut state, state_root, &self.spec)
|
||||||
|
Loading…
Reference in New Issue
Block a user