You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
estimateFee:=0.0001// 10,000 sats, should be good for testnet
However, in the bitcoin ZRC20 contract we read a GAS_LIMIT value to determine the tokens to burn for the fees.
There might be a discrepancy and if the value paid in the contract is lower than the value used for the actual tx, then it becomes a net loss for the tss signer.
After having a look, we actually only use estimateFee for selecting UTXOs and not the effective fees.
However, in the code we use txSize*gasPrice for the fees which may result in a lower fees paid on ZetaChain if the ZRC20 GasLimit is not set high compared to the tx size.
We also adjust the fees if too low:
if fees.Int64() < int64(minFee*1e8) {
fmt.Printf("fees %d is less than minFee %f; use minFee", fees, minFee*1e8)
fees = big.NewInt(int64(minFee * 1e8))
}
Which can result in the same problem, a lower fee paid on ZetaChain
yeah, gas fee in bitcoin might be tricky. I can see two problems:
our bitcoin outbound tx can be of variable size--zetacored does not know current UTXOs and cannot know exact size of the tx when scheduling. We could set a high size here as we have maximum 20 input UTXOs.
Activity
lubtd commentedon Sep 8, 2023
After having a look, we actually only use
estimateFeefor selecting UTXOs and not the effective fees.However, in the code we use
txSize*gasPricefor the fees which may result in a lower fees paid on ZetaChain if the ZRC20GasLimitis not set high compared to the tx size.We also adjust the fees if too low:
Which can result in the same problem, a lower fee paid on ZetaChain
brewmaster012 commentedon Sep 8, 2023
yeah, gas fee in bitcoin might be tricky. I can see two problems:
cc @ws4charlie
lubtd commentedon Oct 16, 2023
Can be closed as we now use the gas limit for max tx size