Open akolotov opened 6 years ago
Currently the bridge could send the same transactions several times if the database is not updated properly.
The following changes could be introduced:
Deposit()
deposit()
For Foreign chain it is necessary to check that
depositsSigned(sha3(ValidatorAddress, sha3(HomeDepositSender, Value, HomeTransactionHash)))
returns false and invoke deposit() in this case only.
false
Withdraw()
submitSignature()
messagesSigned(sha3(ValidatorAddress, sha3(message)))
returns false and invoke submitSignature() in this case only.
CollectedSignatures()
withdraw()
For Home chain it is necessary to check that
withdraws(ForeignTransactionHash)
returns false and invoke withdraw() in this case only.
very good explanation one more stategy to this is to run estimateGas it should succeed
estimateGas
my expectation is that estimateGas will require more time to check tx. But it needs to be measured first of course.
Currently the bridge could send the same transactions several times if the database is not updated properly.
The following changes could be introduced:
Deposit()
event and avoid invocation ofdeposit()
several times for the same origin transaction:For Foreign chain it is necessary to check that
returns
false
and invokedeposit()
in this case only.Withdraw()
event on the Foreign side and avoid invocation ofsubmitSignature()
several times for the same 'message'For Foreign chain it is necessary to check that
returns
false
and invokesubmitSignature()
in this case only.CollectedSignatures()
event on the Foreign side and avoid invocation ofwithdraw()
several times for the the same origin transactionFor Home chain it is necessary to check that
returns
false
and invokewithdraw()
in this case only.