Add slot offset computing to be downloaded slot (#2198)

The current implementation assumes the range offset of slots downloaded on a batch to equal zero. This conflicts with the condition to consider this chain as sync. For finalized sync, it results in one extra batch being downloaded which can't be processed.

CC @wemeetagain
This commit is contained in:
Lion - dapplion 2021-02-18 08:24:46 +00:00
parent 1ab495738d
commit 613382f304

View File

@ -963,7 +963,7 @@ impl<T: BeaconChainTypes> SyncingChain<T> {
if self
.to_be_downloaded
.start_slot(T::EthSpec::slots_per_epoch())
> self.target_head_slot
>= self.target_head_slot
{
return None;
}