mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-21 22:04:44 +00:00
Delete dysfunctional fork_revert feature (#8891)
I found myself having to update this code for Gloas, and figured we may as well delete it seeing as it doesn't work. See: - https://github.com/sigp/lighthouse/issues/4198 Delete all `fork_revert` logic and the accompanying test. Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
@@ -249,7 +249,6 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> Iterator
|
||||
pub struct ParentRootBlockIterator<'a, E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> {
|
||||
store: &'a HotColdDB<E, Hot, Cold>,
|
||||
next_block_root: Hash256,
|
||||
decode_any_variant: bool,
|
||||
_phantom: PhantomData<E>,
|
||||
}
|
||||
|
||||
@@ -260,17 +259,6 @@ impl<'a, E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>>
|
||||
Self {
|
||||
store,
|
||||
next_block_root: start_block_root,
|
||||
decode_any_variant: false,
|
||||
_phantom: PhantomData,
|
||||
}
|
||||
}
|
||||
|
||||
/// Block iterator that is tolerant of blocks that have the wrong fork for their slot.
|
||||
pub fn fork_tolerant(store: &'a HotColdDB<E, Hot, Cold>, start_block_root: Hash256) -> Self {
|
||||
Self {
|
||||
store,
|
||||
next_block_root: start_block_root,
|
||||
decode_any_variant: true,
|
||||
_phantom: PhantomData,
|
||||
}
|
||||
}
|
||||
@@ -285,12 +273,10 @@ impl<'a, E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>>
|
||||
Ok(None)
|
||||
} else {
|
||||
let block_root = self.next_block_root;
|
||||
let block = if self.decode_any_variant {
|
||||
self.store.get_block_any_variant(&block_root)
|
||||
} else {
|
||||
self.store.get_blinded_block(&block_root)
|
||||
}?
|
||||
.ok_or(Error::BlockNotFound(block_root))?;
|
||||
let block = self
|
||||
.store
|
||||
.get_blinded_block(&block_root)?
|
||||
.ok_or(Error::BlockNotFound(block_root))?;
|
||||
self.next_block_root = block.message().parent_root();
|
||||
Ok(Some((block_root, block)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user