Commit Graph

46 Commits

Author SHA1 Message Date
Yurii Rashkovskii 813a8715f9
Problem: hard to check which version the bridge is
Solution: introduce `bridge -v|--version` flag to print the version

The version is built off `git describe`, however, as a backup,
if `git describe` fails (stripped .git, etc.), this will fall back
to whatever is specified in Cargo.toml

Fixes #87
2018-05-31 14:05:19 -07:00
Yurii Rashkovskii b7d7dd3a97
Bump version to 0.3.0 2018-05-31 13:45:34 -07:00
Yurii Rashkovskii 3ea15931fb
Prepare 0.2.1 2018-05-31 11:06:12 -07:00
Peter van Nostrand d480d57a84 Problem: not enforcing a minimum required rustc version could lead to build-time errors
Solution: add a mechanism to enforce a minimum required rustc version
in the bridge's build script
2018-05-24 20:13:05 -04:00
Peter van Nostrand aaa5bee49e Problem: no functionality exists to dynamically fetch gas-prices
Currently, gas-prices are set upon bridge startup via the
Users's config TOML file; this value remains constant for the
life of the Bridge.

Solution: create a mechanism that asynchronously queries
gas-prices from an "Oracle" service on a timed interval. This
mechanism should be a stream of gas-prices that can be polled
from the Bridge.
2018-05-23 20:42:13 -04:00
Yurii Rashkovskii c513d010c7
Prepare 0.2.0 2018-05-08 11:03:33 -07:00
Yurii Rashkovskii a1269272e2
Problem: nonce reuse
Unfortunately, bridge will still reuse nonce very often.
Specifically when trying to send more than one transaction at
a time, clearly a faulty behaviour.

Solution: chain retrieving a nonce with subsequent sending
of the transaction.

However, chaining these is not enough as it'll still fail.

This is happening because bridge module is polling all its components
(deposit_relay, withdraw_confirm, withdraw_relay) sequentially,
 and some of them maybe waiting on their transactions to go through.

However, those transactions are also done as composed futures of nonce
retrieval and transaction sending. This means that it is very often
that first, these futures will go through the nonce acquisition process,
get the same values, and then submit transactions with the same nonce.

This patch makes NonceCheck future check if the transaction failed
with this specific issue of nonce reuse and effectively restarts from
the beginning in that case, repeating nonce acquisition process... until
it succeeeds.
2018-04-29 13:20:42 -07:00
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 fe28e335e0
Problem: RPC transport doesn't support HTTPS
Solution: upgrade web3 to the version which has support for TLS
2018-04-26 18:12:01 -07:00
Yurii Rashkovskii ab938e1c5a
Problem: Cargo manifest still includes test_bridge_stuff
Solution: remove it from the manifest
2018-04-19 09:51:37 -07:00
Edward Mack aacea235bb
Problem: IPC doesn't scale well
Using IPC means bridge has to run alognside the node
on the same machine. This, at times, presents problems
in terms of efficiency or coupling of deployment.

Solution: switch to RPC
2018-04-19 09:51:32 -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
Yurii Rashkovskii 38e1cac265
Problem: intentional bridge shutdowns
It is impossible to tell whether the bridge
is being shut down intentionally or because of
an error. This is particularly important
for supervising the process, both in development
and production.

Solution: handle SIGINT and SIGTERM as a special case
and designate a separate status code (3) for intentional
shutdowns.

Also, include an example supervisor for development
mode (examples/suprevisor). Simply prepend it before
the invocation of bridge to supervise it.
2018-03-15 21:14:37 +07:00
Yurii Rashkovskii d9bc432ab8
Problem: integration tests won't compile or pass
Solution: map it to the API used in bridge.sol
2018-03-05 15:23:36 +07:00
Maximilian Krüger 9753db7326 cli/Cargo.toml: bump `env_logger` to `0.4` 2018-02-15 13:13:59 +01:00
Maximilian Krüger d42f4b9590 Cargo.lock: use newest cargo which doesn't add `root`
addresses https://github.com/paritytech/parity-bridge/pull/114#discussion_r167784460
2018-02-13 09:23:48 +01:00
Maximilian Krüger dfb7fef654 bridge/src/signature.rs: 100% test coverage with quickcheck 2018-02-12 19:14:57 +01:00
Maximilian Krüger 465e2d88e8 update Cargo.lock 2018-02-12 14:51:02 +01:00
debris 0a02e461b9 bump dependencies 2018-02-07 17:23:49 +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 a2dcbecd1b Cargo.lock: update 2018-01-26 10:00:44 +01:00
Maximilian Krüger 1691841c3c use just released ethabi 5.0 which fixes the InvalidData issue 2018-01-22 14:35:54 +01:00
Maximilian Krüger a3148bc90e Cargo.lock: update 2018-01-19 15:01:51 +01:00
debris 6286a76708 timeouts 2017-08-31 17:32:34 +02:00
debris eeb08c1062 updated dependencies 2017-08-31 14:42:39 +02:00
debris ec0dcefc46 udpated futures, removed compiler warnings 2017-08-28 17:19:03 +02:00
debris 9456b5a08f tests for FileBackend 2017-08-28 17:15:10 +02:00
debris 1a2cb47124 bridge writes to backing database 2017-08-28 16:48:01 +02:00
debris 6399b1c8e5 tests for relay 2017-08-25 15:01:47 +02:00
debris 9201a19967 tests for log_stream receiving logs 2017-08-25 12:40:33 +02:00
debris b6d4834400 bridge::deposit_relay tests init 2017-08-25 11:58:47 +02:00
debris f2ccb7e8d9 jsonrpc-core is not a direct dependency of the bridge 2017-08-25 00:40:42 +02:00
debris fa962565ad repo overhaul, separated binary from library, closes #10, added tests crate 2017-08-25 00:36:13 +02:00
debris 0f4340d3f1 ethabi 4.0.0 2017-08-23 12:00:31 +02:00
debris 38befc6fc7 use use_contract! macro instead of handwriting contracts api, closes #1, closes #12, closes #13 2017-08-21 17:32:37 +02:00
debris 15d0871abb update to latest ethabi 2017-08-16 17:42:22 +02:00
debris cee4d81035 use git remotes instead of local branches 2017-08-13 19:36:42 +02:00
debris 8f125a1d70 removed unused code 2017-08-13 13:17:22 +02:00
debris 2423f2eebf new LogStream 2017-08-12 10:55:18 +02:00
debris f61da0dd06 bridge.rs 2017-08-10 17:55:46 +02:00
debris daf08e03f3 deploy finally works 2017-08-04 00:48:12 +02:00
debris a822becbb6 added error chain 2017-08-02 12:45:15 +02:00
debris 04e72293fb app 2017-08-01 11:36:48 +02:00
debris d0edf2b327 app rewrite 2017-06-25 13:21:28 +02:00
debris d4c4682cee init 2017-06-13 10:28:04 +02:00