Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Validator crashes if remote peer disconnects #1113

Closed
lithp opened this issue Sep 11, 2019 · 2 comments
Closed

Validator crashes if remote peer disconnects #1113

lithp opened this issue Sep 11, 2019 · 2 comments
Labels

Comments

@lithp
Copy link
Contributor

lithp commented Sep 11, 2019

On the interop branch:

is still running, terminating as well
   DEBUG  2019-09-11 14:39:47,135             Validator  Cancelling <trinity.plugins.eth2.beacon.validator.Validator object at 0x7f1d61a1f2d0>
 WARNING  2019-09-11 14:39:47,136             Validator  Task <coroutine object Validator.handle_slot_tick at 0x7f1d619afdd0> finished unexpectedly: RuntimeError('unable to perform operation on <TCPTransport closed=True reading=False 0x562d3dd17930>; the handler is closed')
   DEBUG  2019-09-11 14:39:47,136             Validator  Task failure traceback
Traceback (most recent call last):
  File "/home/brian/ef/trinity/p2p/service.py", line 159, in _run_task_wrapper
    await awaitable
  File "/home/brian/ef/trinity/p2p/service.py", line 180, in _run_daemon_task_wrapper
    await awaitable
  File "/home/brian/ef/trinity/trinity/plugins/eth2/beacon/validator.py", line 140, in handle_slot_tick
    await self.handle_second_tick(event.slot)
  File "/home/brian/ef/trinity/trinity/plugins/eth2/beacon/validator.py", line 230, in handle_second_tick
    await self.attest(slot)
  File "/home/brian/ef/trinity/trinity/plugins/eth2/beacon/validator.py", line 381, in attest
    await self.p2p_node.broadcast_attestation(attestation)
  File "/home/brian/ef/trinity/trinity/protocol/bcc_libp2p/node.py", line 393, in broadcast_attestation
    await self._broadcast_data(PUBSUB_TOPIC_BEACON_ATTESTATION, ssz.encode(attestation))
  File "/home/brian/ef/trinity/trinity/protocol/bcc_libp2p/node.py", line 396, in _broadcast_data
    await self.pubsub.publish(topic, data)
  File "/home/brian/ef/py-libp2p/libp2p/pubsub/pubsub.py", line 366, in publish
    await self.push_msg(self.host.get_id(), msg)
  File "/home/brian/ef/py-libp2p/libp2p/pubsub/pubsub.py", line 429, in push_msg
    await self.router.publish(msg_forwarder, msg)
  File "/home/brian/ef/py-libp2p/libp2p/pubsub/gossipsub.py", line 177, in publish
    await stream.write(encode_varint_prefixed(rpc_msg.SerializeToString()))
  File "/home/brian/ef/py-libp2p/libp2p/network/stream/net_stream.py", line 45, in write
    return await self.muxed_stream.write(data)
  File "/home/brian/ef/py-libp2p/libp2p/stream_muxer/mplex/mplex_stream.py", line 128, in write
    return await self.mplex_conn.send_message(flag, data, self.stream_id)
  File "/home/brian/ef/py-libp2p/libp2p/stream_muxer/mplex/mplex.py", line 154, in send_message
    return await self.write_to_stream(_bytes)
  File "/home/brian/ef/py-libp2p/libp2p/stream_muxer/mplex/mplex.py", line 162, in write_to_stream
    await self.secured_conn.write(_bytes)
  File "/home/brian/ef/py-libp2p/libp2p/security/secio/transport.py", line 127, in write
    await self.write_msg(data)
  File "/home/brian/ef/py-libp2p/libp2p/security/secio/transport.py", line 133, in write_msg
    await self.conn.write_msg(encrypted_data + tag)
  File "/home/brian/ef/py-libp2p/libp2p/io/msgio.py", line 40, in write_msg
    await self.write_closer.write(data)
  File "/home/brian/ef/py-libp2p/libp2p/network/connection/raw_connection.py", line 26, in write
    self.writer.write(data)
  File "/home/brian/.pyenv/versions/3.7.4/lib/python3.7/asyncio/streams.py", line 305, in write
    self._transport.write(data)
  File "uvloop/handles/stream.pyx", line 671, in uvloop.loop.UVStream.write
  File "uvloop/handles/handle.pyx", line 159, in uvloop.loop.UVHandle._ensure_alive
RuntimeError: unable to perform operation on <TCPTransport closed=True reading=False 0x562d3dd17930>; the handler is closed
@lithp lithp added the eth2.0 label Sep 11, 2019
@mhchia
Copy link
Contributor

mhchia commented Sep 12, 2019

It is because we can't detect our peers' disconnection for now: libp2p/py-libp2p#281. I'm working on this issue in libp2p/py-libp2p#293.

@ChihChengLiang
Copy link
Contributor

Close in favor of #1379

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants