Commit Graph

20 Commits

Author SHA1 Message Date
Yurii Rashkovskii 072291813c
Problem: withdraw_confirm failure
If a node configured as Foreign for the bridge and it has no validator
account unlocked the bridge crashes and produces the following message:

```
INFO:bridge::bridge::withdraw_confirm: got 1 new withdraws to sign
INFO:bridge::bridge::withdraw_confirm: withdraw is ready for signature
submission. tx hash 0x6493…4fa8
INFO:bridge::bridge::withdraw_confirm: signing
WARN:bridge: Bridge crashed with Error(Transport("Unexpected response
status code: 405 Method Not Allowed"), State { next_error: None,
backtrace: None })
Error(Transport("Unexpected response status code: 405 Method Not
Allowed"), State { next_error: None, backtrace: None })
```

Solution: sign messages locally

Closes #49
2018-04-28 15:50:25 -07:00
Yurii Rashkovskii 94b1343594
Problem: sending unsigned transactions over API
This means that the node has to sign the transaction itself.
It might be acceptable in a localized setup, but can't be used
with untrusted setups. For example, once HTTP RPC is supported,
we can't really use infrastructure like INFURA to send transactions.

Solution: switch to signing transactions in bridge

This absolutely requires separating the accounts used by validators
and administrative tasks as this will otherwise interfere with
management of nonces.
2018-04-26 17:50:07 -07:00
Yurii Rashkovskii 618d3bcb00
Problem: bridge crashes with insufficient balance
Currently there are two possible situations related to low balance on
the account which is used for bridge operations:

1. The account which is used to sign transactions to be addressed by
ForeignBridge contract has low balance. So, the bridge is not able to do
deposit_relay and withdraw_confirm.
2. The account which is used to sign transactions to be addressed by
HomeBridge contract has low balance. So, the bridge is not able to do
withdraw_relay.

In both cases bridges hangs silently at the moment of sending
transactions and does not proceed with further actions even the
operation is intended to be performed in opposite direction (e.g. the
bridge hangs at the moment to perform withdraw_relay, so deposit_relay
cannot be performed either).

Solution: make bridge track its balance and hande insufficient

Bridge will crash with ERR_INSUFFICIENT_FUNDS (code 4) so that
supervisor can decide what should happen next. It will also log the
condition.

P.S.Make sure to run the tests with `--test-threads=1` to avoid
other test conflicting with this one. A better solution to this
issue must be devised later, however.
2018-04-04 10:42:16 +04:00
Maximilian Krüger 107141e0b7 remove unused imports 2018-02-14 12:13:11 +01:00
Maximilian Krüger c887668eda remove tests for withdraw confirm payloads
- they test against raw hex strings
  - hard to modify
  - if we me it easier to modify by using ethabi to assemble data
    the tests essentially become useless
- logic should already be covered by both integration test and RPC tests
2018-02-12 15:24:23 +01:00
Maximilian Krüger 42993089f5 adapt to ethabi version bump 2018-02-12 10:11:39 +01:00
Maximilian Krüger 5000043930 extract code dealing with Withdraw message
remove ignoring of messages with insufficient value
because no longer needed.

use user specified gas price on withdraw.
2018-02-09 09:44:55 +01:00
Maximilian Krüger c0d87f19c0 magic numbers -> constants 2018-02-09 09:41:46 +01:00
Maximilian Krüger 41543ca40e user explicitely specifies homeGasPrice on withdraw. resolves #112 2018-02-09 09:41:45 +01:00
debris f0dcb70cf3 remove redundant conversions between types 2018-02-07 14:58:50 +01:00
debris 5e90f850fd updated web3 to latest version and resolved build issues 2018-02-07 14:50:49 +01:00
debris cc2c3fea9b bump ethabi and ethereum-types to latest versions 2018-02-06 22:57:06 +01:00
Maximilian Krüger 798755db89 withdraw_confirm.rs: withdraw -> withdraw_message 2018-01-19 14:48:18 +01:00
Maximilian Krüger e07485a792 withdraw_confirm.rs: fn withdraw_submit_signature_payload: assert lengths 2018-01-19 14:47:54 +01:00
Maximilian Krüger 0a27da3c33 withdraw_confirm.rs: add some info level logging 2018-01-19 14:47:29 +01:00
debris 59403966fc rename to home/foreign, closes #46 2017-10-10 11:02:58 +02:00
debris 6286a76708 timeouts 2017-08-31 17:32:34 +02:00
debris d9c6773185 withdraw_confirm unit tests 2017-08-25 17:58:55 +02:00
debris ddd68c1f4f typos 2017-08-25 16:27:55 +02:00
debris fa962565ad repo overhaul, separated binary from library, closes #10, added tests crate 2017-08-25 00:36:13 +02:00