Commit Graph

15 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
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 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 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
Maximilian Krüger 1b454204c5 integration tests: various improvements. reduce duplication 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 0db863d5de integration-tests: resolve rust compiler warnings 2018-01-22 16:30:01 +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