Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: created btc dust amount constant and renaming #2327

Merged
merged 5 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
ws4charlie marked this conversation as resolved.
Show resolved Hide resolved
)
Loading