runner/walker backfill off-by-one bugfix
This commit is contained in:
@@ -275,7 +275,7 @@ class BlockStateRunner(BlockProgressor):
|
||||
log.debug(f'discarded late-arriving head {block}')
|
||||
else:
|
||||
batches: list
|
||||
from_height = self.state.by_hash[fork.parent].height if fork.parent is not None else fork.height
|
||||
from_height = self.state.by_hash[fork.parent].height + 1 if fork.parent is not None else fork.height
|
||||
to_height = fork.height
|
||||
if fork.disjoint:
|
||||
batches = await self.get_backfill_batches(from_height, to_height, w3)
|
||||
|
||||
@@ -82,7 +82,7 @@ class BlockWalker (BlockProgressor):
|
||||
block = Block.from_data(chain_id, block_data)
|
||||
assert block.height == cur_height
|
||||
current_block.set(block)
|
||||
await self.handle(processed_height, cur_height, chain=chain, w3=w3)
|
||||
await self.handle(processed_height+1, cur_height, chain=chain, w3=w3)
|
||||
if self.flush_delay is None or \
|
||||
self.flush_type=='blocks' and last_flush + self.flush_delay <= processed_height or \
|
||||
self.flush_type=='time' and last_flush + self.flush_delay <= now():
|
||||
|
||||
Reference in New Issue
Block a user