Exemplo n.º 1
0
 async def _serve_bytecode(self, event: CollectMissingBytecode) -> None:
     await self._state_downloader.ensure_nodes_present(
         {event.bytecode_hash},
         event.block_number,
         event.urgent,
     )
     await self._event_bus.broadcast(MissingBytecodeResult(), event.broadcast_config())
Exemplo n.º 2
0
 async def _hang_until_bytecode_served(self, event: CollectMissingBytecode) -> None:
     try:
         await self.wait(self._serve_bytecode(event))
     except OperationCancelled:
         await self._event_bus.broadcast(
             MissingBytecodeResult(is_retry_acceptable=False),
             event.broadcast_config(),
         )
         raise
Exemplo n.º 3
0
 async def _hang_until_bytecode_served(self, event: CollectMissingBytecode) -> None:
     try:
         await asyncio.wait_for(
             self._serve_bytecode(event),
             timeout=BLOCK_IMPORT_MISSING_STATE_TIMEOUT,
         )
     except asyncio.CancelledError:
         await self._event_bus.broadcast(
             MissingBytecodeResult(is_retry_acceptable=False),
             event.broadcast_config(),
         )
         raise
     except asyncio.TimeoutError:
         pass
Exemplo n.º 4
0
 async def collect_bytecodes(event: CollectMissingBytecode):
     replace_missing_node(event.bytecode_hash)
     await event_bus.broadcast(
         MissingBytecodeResult(), event.broadcast_config()
     )
Exemplo n.º 5
0
 async def _serve_bytecode(self, event: CollectMissingBytecode) -> None:
     await self._state_downloader.ensure_node_present(event.bytecode_hash)
     await self._event_bus.broadcast(MissingBytecodeCollected(),
                                     event.broadcast_config())