Skip to content
This repository has been archived by the owner on Jun 12, 2020. It is now read-only.

Validate resolve request response #1

Open
ghost opened this issue Aug 9, 2019 · 3 comments
Open

Validate resolve request response #1

ghost opened this issue Aug 9, 2019 · 3 comments
Labels
bug Something isn't working P2 mid priority

Comments

@ghost
Copy link

ghost commented Aug 9, 2019

Raiden crashes when xud's hash resolver request returns an unexpected response.

2019-08-09 11:38:30.103106 [info     ] 127.0.0.1 - - [2019-08-09 11:38:30] "GET /api/v1/channels/0x6f59245d93f6fac22b60525a9bf2ae8301c2e11a HTTP/1.1" 200 466 0.003887 [raiden.api.rest.pywsgi]
Traceback (most recent call last):
  File "/home/ar/raiden/venv/lib/python3.7/encodings/hex_codec.py", line 19, in hex_decode
    return (binascii.a2b_hex(input), len(input))
binascii.Error: Non-hexadecimal digit found

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 716, in gevent._greenlet.Greenlet.run
  File "/home/ar/raiden/raiden/raiden_service.py", line 720, in _handle_event
    raiden=self, chain_state=chain_state, event=raiden_event
  File "/home/ar/raiden/raiden/raiden_event_handler.py", line 106, in on_raiden_event
    self.handle_send_secretrequest(raiden, event)
  File "/home/ar/raiden/raiden/raiden_event_handler.py", line 174, in handle_send_secretrequest
    if reveal_secret_with_resolver(raiden, secret_request_event):
  File "/home/ar/raiden/raiden/network/resolver/client.py", line 46, in reveal_secret_with_resolver
    secret = to_bytes(hexstr=hexsecret)
  File "/home/ar/raiden/venv/lib/python3.7/site-packages/eth_utils/decorators.py", line 75, in wrapper
    return to_wrap(*args, **kwargs)
  File "/home/ar/raiden/venv/lib/python3.7/site-packages/eth_utils/conversions.py", line 88, in to_bytes
    return decode_hex(hexstr)
  File "/home/ar/raiden/venv/lib/python3.7/site-packages/eth_utils/hexadecimal.py", line 17, in decode_hex
    return codecs.decode(remove_0x_prefix(value), "hex")  # type: ignore
binascii.Error: decoding with 'hex' codec failed (Error: Non-hexadecimal digit found)
2019-08-09T11:38:58Z <Greenlet "Greenlet-6" at 0x7f969922e488: <bound method RaidenService._handle_event of <RaidenService node:efd2860f>>(<ChainState block_number:2568 block_hash:c71aa8da , <SendSecretRequest msgid:464343788158544418 paymen)> failed with Error

2019-08-09 11:38:58.805632 [error    ] Runnable subtask died!         [raiden.utils.runnable] exc=Error("decoding with 'hex' codec failed (Error: Non-hexadecimal digit found)") running=True subtask=<Greenlet "Greenlet-6" at 0x7f969922e488: <bound method RaidenService._handle_event of <RaidenService node:efd2860f>>(<ChainState block_number:2568 block_hash:c71aa8da , <SendSecretRequest msgid:464343788158544418 paymen)> this=<RaidenService node:efd2860f>
Traceback (most recent call last):
  File "/home/ar/raiden/venv/lib/python3.7/encodings/hex_codec.py", line 19, in hex_decode
    return (binascii.a2b_hex(input), len(input))
binascii.Error: Non-hexadecimal digit found

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 716, in gevent._greenlet.Greenlet.run
  File "/home/ar/raiden/raiden/raiden_service.py", line 533, in _run
    self.stop_event.wait()
  File "src/gevent/event.py", line 240, in gevent._event.Event.wait
  File "src/gevent/event.py", line 140, in gevent._event._AbstractLinkable._wait
  File "src/gevent/event.py", line 117, in gevent._event._AbstractLinkable._wait_core
  File "src/gevent/event.py", line 119, in gevent._event._AbstractLinkable._wait_core
  File "src/gevent/_greenlet_primitives.py", line 59, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
  File "src/gevent/_greenlet_primitives.py", line 59, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
  File "src/gevent/_greenlet_primitives.py", line 63, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
  File "src/gevent/__greenlet_primitives.pxd", line 35, in gevent.__greenlet_primitives._greenlet_switch
binascii.Error: decoding with 'hex' codec failed (Error: Non-hexadecimal digit found)
2019-08-09T11:39:00Z <Greenlet "RaidenService._run node:efd2860f" at 0x7f9699d1e158: <bound method RaidenService._run of <RaidenService node:efd2860f>>> failed with Error

FATAL: An unexpected exception occured. A traceback has been written to /tmp/raiden-exception-2019-08-09T11-39apz0ekgs.txt
decoding with 'hex' codec failed (Error: Non-hexadecimal digit found)
@kilrau
Copy link

kilrau commented Aug 23, 2019

@kilrau
Copy link

kilrau commented Oct 8, 2019

Closed by ExchangeUnion/xud#1172 @erkarl ?

@kilrau kilrau added the P2 mid priority label Oct 8, 2019
@ghost
Copy link
Author

ghost commented Oct 9, 2019

Not closed. This issue is about validating the request raiden receives from xud. The above mentioned issue does validations from the xud side.

Agree with the priority - not a huge deal right now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working P2 mid priority
Projects
None yet
Development

No branches or pull requests

2 participants