Closed akolotov closed 6 years ago
Seems the bridge hangs till the request timeout exceed and crashes after that with the message:
Request eth_sendTransaction timed out
Generally speaking, would it make sense to make an assumption that if we sent a transaction and got one confirmation, then we're good?
Should we define the per-transaction cost in the config or infer it dynamically?
You already have this info in the configuration file: gas * gas_limit
True. Then I just need to multiply this by the number of transactions I want to send.
correct
What should we do if balance check times out?
can we cache it and use such kind of "expected" value if we got no responce on eth.getBalance()
call?
We can.
Addressed in https://github.com/poanetwork/parity-bridge/pull/36
Currently there are two possible situations related to low balance on the account which is used for bridge operations:
ForeignBridge
contract has low balance. So, the bridge is not able to dodeposit_relay
andwithdraw_confirm
.HomeBridge
contract has low balance. So, the bridge is not able to dowithdraw_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
, sodeposit_relay
cannot be performed either).Proposal for changes
Fix the issue - the bridge should not hang if the account has low balance. It should proceed with operations in the opposite direction. It can be achieved by preventing sending transaction if such situation occurs. The error message should be appear in the bridge logs as soon as low balance issue discovered.