[BUG] Reset MaxGas when reschedule tx out item , even original MaxGas is larger than current
Issue 1
It was reported at https://discord.com/channels/838986635756044328/970341122561953873 , that outbound transaction
{
"chain": "ETH",
"to_address": "0x31e0e2f2a3c6e8203b4f61c2cf59d3723dde9557",
"vault_pub_key": "thorpub1addwnpepqv5kmrk54zzqhvnjmh5xsmmnely55l45cqsmhx4du5wahg3v7gyswrgl0ta",
"coin": {
"asset": "ETH.ETH",
"amount": "334330424"
},
"memo": "OUT:494530B02B25A0591943C893F053BFF9A069FEE0070BB46E1339B26718A982FD",
"max_gas": [
{
"asset": "ETH.ETH",
"amount": "120960000",
"decimals": 8
}
],
"gas_rate": 13,
"in_hash": "494530B02B25A0591943C893F053BFF9A069FEE0070BB46E1339B26718A982FD"
}
has not been sent out for a long time , upon investigation find out MaxGas specified in this tx out item is 120960000 , which is 1.2 ETH
The ETH Daemon run by thornode has a hard upper bound of transaction fee , which is 1 ETH, thus the transaction has been signed but failed to be broadcast
The reason the MaxGas is 1.2 ETH is because there is a huge gas spike yesterday due to NFT https://ethereumprice.org/gas/
When a transaction get rescheduled, it's MaxGas field get updated , but only when current gas is larger than the original one , this issue should update max gas regardless when reschedule an outbound
Issue 2
In thorchain , there is a hard gas limit for any outbound transaction, the gas fee should not more than 0.5 ETH, if it is more than 0.5 ETH , then vault that send out the transaction will be slashed with the whole transaction amount. Given the assumption that under no circumstance thornode should spend more than 0.5 ETH on transaction fee.
However , as we see on 2022-05-01, ETH gas fee can go ridiculous some times , so if during this time some one willingly to spend a lot fee on transaction , thornode should not slash the vault.