Resolve "[FIX] migration bug and TSS metrics bug"
Closes #699 (closed)
- For bitcoin signer , create a temporary fake tx to estimate the size of tx
- For migration , when thorchain issue the migrate tx out item , for each round migrate , thornode will deduct MaxGas amount of BTC to pay for potential gas, if when signer sign the tx , and spend less gas than
MaxGas
, it will have some dust left behind in the vault, which will prevent the vault from churning . The solution for this problem is , if the tx is migrate , and the gas need to send out tx is less than MaxGas, than add the gap to payout amount. Thus the amount will send to next vault. For example , we need to migrate 1 BTC to next vault , 0.1 had been reserved as the MaxGas fee , payout to next vault will be 0.9 When signer sign the tx , and find out it only need to spend 0.06 BTC as gas, then the payout to customer will be 0.9 + (0.1 - 0.06) = 0.94 - Fix TssKeysign metric bug , which cause panic
Invalid tx module=state code=111222 log=panic
Edited by Heimdall