Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Startup of relay with not synced node #540

Open
cducrest opened this issue Sep 11, 2020 · 0 comments
Open

Startup of relay with not synced node #540

cducrest opened this issue Sep 11, 2020 · 0 comments

Comments

@cducrest
Copy link
Contributor

When starting a relay server, it will query information on the currency networks via calls to the node.
If the node is not synced to the point where the information is available, the relay crashes. We should make it wait and retry instead.

2020-09-11 10:46:49,519 INFO [main] relay: New network: 0x12657128d7fa4291647eC3b0147E5fA6EebD388A
Traceback (most recent call last):
File "/opt/relay/lib/python3.6/site-packages/web3/contract.py", line 1354, in call_contract_function
output_data = decode_abi(output_types, return_data)
File "/opt/relay/lib/python3.6/site-packages/eth_abi/codec.py", line 181, in decode_abi
return decoder(stream)
File "/opt/relay/lib/python3.6/site-packages/eth_abi/decoding.py", line 127, in call
return self.decode(stream)
File "/opt/relay/lib/python3.6/site-packages/eth_utils/functional.py", line 45, in inner
return callback(fn(*args, **kwargs))
File "/opt/relay/lib/python3.6/site-packages/eth_abi/decoding.py", line 173, in decode
yield decoder(stream)
File "/opt/relay/lib/python3.6/site-packages/eth_abi/decoding.py", line 127, in call
return self.decode(stream)
File "/opt/relay/lib/python3.6/site-packages/eth_abi/decoding.py", line 142, in decode
start_pos = decode_uint_256(stream)
File "/opt/relay/lib/python3.6/site-packages/eth_abi/decoding.py", line 127, in call
return self.decode(stream)
File "/opt/relay/lib/python3.6/site-packages/eth_abi/decoding.py", line 198, in decode
raw_data = self.read_data_from_stream(stream)
File "/opt/relay/lib/python3.6/site-packages/eth_abi/decoding.py", line 308, in read_data_from_stream
len(data),
eth_abi.exceptions.InsufficientDataBytes: Tried to read 32 bytes. Only got 0 bytes

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

Traceback (most recent call last):
File "/usr/local/bin/tl-relay", line 8, in
sys.exit(main())
File "/opt/relay/lib/python3.6/site-packages/relay/boot.py", line 43, in main
relay.main.main()
File "/opt/relay/lib/python3.6/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/opt/relay/lib/python3.6/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/opt/relay/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/relay/lib/python3.6/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/opt/relay/lib/python3.6/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/opt/relay/lib/python3.6/site-packages/relay/main.py", line 125, in main
trustlines.start()
File "/opt/relay/lib/python3.6/site-packages/relay/relay.py", line 366, in start
self._load_addresses()
File "/opt/relay/lib/python3.6/site-packages/relay/relay.py", line 689, in _load_addresses
self.new_network(to_checksum_address(address))
File "/opt/relay/lib/python3.6/site-packages/relay/relay.py", line 374, in new_network
self._web3, self.contracts["CurrencyNetwork"]["abi"], address
File "/opt/relay/lib/python3.6/site-packages/relay/blockchain/currency_network_proxy.py", line 41, in init
self.name: str = self._proxy.functions.name().call().strip("\0")
File "/opt/relay/lib/python3.6/site-packages/web3/contract.py", line 842, in call
**self.kwargs
File "/opt/relay/lib/python3.6/site-packages/web3/contract.py", line 1376, in call_contract_function
raise BadFunctionCallOutput(msg) from e
web3.exceptions.BadFunctionCallOutput: Could not transact with/call contract function, is contract deployed correctly and chain synced?

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

No branches or pull requests

1 participant