Commit Graph

27 Commits

Author SHA1 Message Date
Yurii Rashkovskii 18802df14c
Problem: insecure RPCs are subject to MITM attacks
Solution: by default, disallow use of non-TLS RPC endpoints

For testing, there's an escape hatch of a command line
argument `--allow-insecure-rpc-endpoints` (purposefully
long) that will reduce the severity of using a non-TLS
RPC endpoint to a warning in a log file.

It was not made to be a configuration file option to reduce
the risk of this option slipping into a production configuration
file by mistake.

Closes #79
2018-06-04 14:33:32 -07: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 9a192c1e07
Problem: bridge should not deploy its contracts anymore
Bridge's contracts are now developed in a separate repository
and have their own deployment procedure:

https://github.com/poanetwork/poa-parity-bridge-contracts

However, our integration tests are not yet updated to
use this deployment procedure.

Solution: disable deployment compile-time by default
and only use it in integration tests as a stopgap measure
until the new deployment procedure (or any other viable
alternative) has been used.
2018-05-01 09:43:34 -07:00
Yurii Rashkovskii c0715dadba
Merge branch 'raw-transactions' into rpc+raw-transactions 2018-04-26 18:21:07 -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 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 4151237c54
Problem: RPC transport change conflated with keystore
As a part of the original feature request, there was a need
for the bridge to be able to sign its own transactions. However,
this didn't fully materialize in the original patch, and only
configuration parameters were implemented.

Solution: remove these last conflated bits
and make this a pure transport change patch.
2018-04-19 10:13:45 -07:00
Yurii Rashkovskii 12a44b53bd
Problem: two sets of external tests
RPC patch has introduced a separate basic test that, on the surface
of it, is not too dissimilar from the basic deposit and withdrawal
test already defined in integration tests.

Solution: make sure integration tests run and remove newly introduced test
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 732711d2d0
Problem: can't compile inyegration tests
Solution: add missing instructions for building
token
2018-03-09 08:09:27 +00: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 8ab895664a integration-tests: set home_gas_price to 0 to make it pass for now 2018-02-12 15:35:06 +01:00
Maximilian Krüger 8f1f8cae3e adapt integration tests to #112 2018-02-09 09:41:46 +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 1b454204c5 integration tests: various improvements. reduce duplication 2018-01-26 10:00:44 +01:00
Maximilian Krüger 66a45f24e2 integration tests bridge config: give deposit more gas so it succeeds 2018-01-26 10:00:44 +01:00
Maximilian Krüger b6a34c6252 integration-tests/tests/basic_deposit_then_withdraw.rs: add module docstring
[ci skip]
2018-01-22 20:56:02 +01:00
Maximilian Krüger ff7acc3f4a remove outcommented code 2018-01-22 16:48:41 +01:00
Maximilian Krüger 9aa26ea390 remove unused dependency 2018-01-22 16:48:30 +01:00
Maximilian Krüger 0db863d5de integration-tests: resolve rust compiler warnings 2018-01-22 16:30:01 +01:00
Maximilian Krüger c558ab5e63 remove home_chain.json - no longer needed. we use the dev chain now 2018-01-22 14:35:54 +01:00
Maximilian Krüger 2a65d52de2 clean up integration test a bit 2018-01-22 14:35:54 +01:00
Maximilian Krüger 9f5ff425de make integration test a proper rust test 2018-01-22 14:35:54 +01:00
Maximilian Krüger adc4a0a1eb integration-tests: indent with tabs 2018-01-19 14:45:11 +01:00
Maximilian Krüger e6f6797ac7 add first rough integration test 2018-01-19 14:43:28 +01:00