diff --git a/changelog.md b/changelog.md index 1dfe34192d..41d63adac2 100644 --- a/changelog.md +++ b/changelog.md @@ -66,6 +66,7 @@ * [2233](https://github.com/zeta-chain/node/pull/2233) - fix `IsSupported` flag not properly updated in zetaclient's context * [2243](https://github.com/zeta-chain/node/pull/2243) - fix incorrect bitcoin outbound height in the CCTX outbound parameter * [2256](https://github.com/zeta-chain/node/pull/2256) - fix rate limiter falsely included reverted non-withdraw cctxs +* [2327](https://github.com/zeta-chain/node/pull/2327) - partially cherry picked the fix to Bitcoin outbound dust amount ### CI diff --git a/pkg/chains/chains.go b/pkg/chains/chains.go index 61fffece76..11c6f952f0 100644 --- a/pkg/chains/chains.go +++ b/pkg/chains/chains.go @@ -265,7 +265,8 @@ var ( } ) -func BtcDustOffset() int64 { +// BtcNonceMarkOffset is the offset satoshi amount to calculate the nonce mark output +func BtcNonceMarkOffset() int64 { return 2000 } diff --git a/pkg/chains/conversion.go b/pkg/chains/conversion.go index 6a6a6f4091..200061c3ae 100644 --- a/pkg/chains/conversion.go +++ b/pkg/chains/conversion.go @@ -11,7 +11,7 @@ import ( // A very special value to mark current nonce in UTXO func NonceMarkAmount(nonce uint64) int64 { // #nosec G701 always in range - return int64(nonce) + BtcDustOffset() // +2000 to avoid being a dust rejection + return int64(nonce) + BtcNonceMarkOffset() } // HashToString convert hash bytes to string diff --git a/pkg/constant/constant.go b/pkg/constant/constant.go index 9a81e1d8b2..62f898e85d 100644 --- a/pkg/constant/constant.go +++ b/pkg/constant/constant.go @@ -10,4 +10,7 @@ const ( // CmdMigrateTssFunds is used for CCTX of type cmd to give the instruction to the TSS to transfer its funds on a new address CmdMigrateTssFunds = "cmd_migrate_tss_funds" + + // BTCWithdrawalDustAmount is the minimum satoshis that can be withdrawn from zEVM to avoid outbound dust output + BTCWithdrawalDustAmount = 1000 )