Skip to content

Commit

Permalink
fix: created btc dust amount constant and renaming (#2327)
Browse files Browse the repository at this point in the history
* renamed BtcDustOffset as BtcNonceMarkOffset and created constant BTCWithdrawalDustAmount

* added changelog entry
  • Loading branch information
ws4charlie authored Jun 18, 2024
1 parent 14bbf10 commit e822112
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion pkg/chains/chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/chains/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions pkg/constant/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

0 comments on commit e822112

Please sign in to comment.