Closed akolotov closed 6 years ago
@pablofullana we need to decrease priority of this issue and do it after switching to v2.1 bridge contracts.
@fvictorio @patitonar can suggest list below the set of changes needed to be done as per new contracts (refactor_v1
branch)
Addressed in #71
Depends on #37
Watchers implemented:
Currently the bridge uses
estimateGas()
JSON-RPC API to check if the transaction was already processed. This check is not always accurate. For example, the exception will be raised byestimateGas()
if the bridge instance operates with the private key which does not belong to the actual validator (e.g. the validator was removed from the contract), or if the message which is signed by the validator is corrupted etc. In such kind of cases the bridge will report that transaction was already processed but it is not true. It will slow down investigation of the issues since the log message does not reflect actual error.That's why the check used
estimateGas()
could be extended with usage of methods provided by the bridge contract to provide more accurate logs:isValidator()
:https://github.com/poanetwork/poa-bridge-contracts/blob/93969cd934190649d42691f054676d0d16a9777e/contracts/upgradeable_contracts/U_BridgeValidators.sol#L71
processDeposits
could be enhanced to check:messagesSigned
from Home Bridge contractisAlreadyProcessed
from Home Bridge contractprocessCollectedSignatures
could be enhanced to check:CollectedSignatures
event and value returned byrequiredSignatures
from the Validator contract on Foreign side.deposits
from Foreign Bridge contractprocessWithdraw
could be enhanced to check:withdrawalsSigned
from Home Bridge contractisAlreadyProcessed
from Home Bridge contract