async def preview_transactions(self, header: BlockHeader, transactions: Tuple[BaseTransaction, ...], parent_state_root: Hash32, lagging: bool = True) -> None: self.run_task( self._preview_address_load(header, parent_state_root, transactions)) # This is a hack, so that preview executions can load ancestor block-hashes self._db[header.hash] = rlp.encode(header) # Always broadcast, to start previewing transactions that are further ahead in the block old_state_header = header.copy(state_root=parent_state_root) self._event_bus.broadcast_nowait( DoStatelessBlockPreview(old_state_header, transactions))
async def preview_transactions(self, header: BlockHeader, transactions: Tuple[BaseTransaction, ...], parent_state_root: Hash32, lagging: bool = True) -> None: if not self.manager.is_running: # If the service is shutting down, we can ignore preview requests return self.manager.run_task(self._preview_address_load, header, parent_state_root, transactions) # This is a hack, so that preview executions can load ancestor block-hashes self._db[header.hash] = rlp.encode(header) # Always broadcast, to start previewing transactions that are further ahead in the block old_state_header = header.copy(state_root=parent_state_root) self._event_bus.broadcast_nowait( DoStatelessBlockPreview(old_state_header, transactions), FIRE_AND_FORGET_BROADCASTING) self._backfiller.set_root_hash(parent_state_root)