Re-schedule outbound transactions
The issue:
At the moment, THORChain has some logic to determinate whether a node operator is signing the transactions that they are supposed to sign , It is using a constant value SigningTransactionPeriod
(300 blocks).
Bifrost
When a txout item is roughly older than SigningTransactionPeriod
(300) blocks, bifrost will drop it on the floor given the assumption that THORChain will reschedule it again
Thornode
At the end of each block , it will check the tx out item , that was written to block at height( common.BlockHeight()- SigningTransactionPeriod
), check the OutHash
, if the txout item's OutHash
is still empty, which means the txout item has not been signed , and observed back. Then Thornode will instruct asgard to pick up this tx out item , and send it from asgard , assume the node account fail to sign it , and slash it.
These assumptions work well when we only integrate with Binance chain , which has almost instant finality , but it become a problem when we start to support BTC which has very long block time , roughly 10 ~15 minutes right now, and can go up to two hours in some cases. As you can imagine , in some cases , yggdrasil will sign and broadcast the tx out to BTC chain , but that tx will not be commit and observed back after 300 Thorchain blocks , as a result asgard will pick it up and send it again , which is double spending , customer get double paid , network lost money , or the node operator get slashed , it depends which outbound get observed first.
TransactionSigningPeriod
Why we have I can't remember exactly why we did this originally , but I think we were thinking node operator might go offline , which result some outbound tx get delayed
Solution
After many discussion offline, we are going to scan and observe the mempool, as soon as an outbound tx get into mempool , bifrost will report the transaction to thornode , once 2/3 majority of bifrost node done the same , the tx will be marked as completed
This will behave the same like other chains that have short block time