Skip to content

Commit

Permalink
fix: cherry pick hotfix v12.2.5 (#1727)
Browse files Browse the repository at this point in the history
* provide bitcoin_chain_id when query tss address

* update changelog

* added comment for readibility
  • Loading branch information
ws4charlie authored Feb 8, 2024
1 parent 4d47d4f commit f65dc1c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* [1690](https://github.com/zeta-chain/node/issues/1690) - double watched gas prices and fix btc scheduler
* [1687](https://github.com/zeta-chain/node/pull/1687) - only use EVM supported chains for gas stability pool
* [1692](https://github.com/zeta-chain/node/pull/1692) - fix get params query for emissions module
* [1721](https://github.com/zeta-chain/node/issues/1721) - zetaclient should provide bitcoin_chain_id when querying TSS address

### Tests

Expand Down
2 changes: 1 addition & 1 deletion zetaclient/bitcoin_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ func GetBtcEvent(
return nil, err
}
if wpkhAddress.EncodeAddress() != targetAddress {
return nil, err
return nil, nil // irrelevant tx to us, skip
}
// deposit amount has to be no less than the minimum depositor fee
if out.Value < BtcDepositorFeeMin {
Expand Down
4 changes: 2 additions & 2 deletions zetaclient/inbound_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (ob *BitcoinChainClient) CheckReceiptForBtcTxHash(txHash string, vote bool)
if err != nil {
return "", err
}
tss, err := ob.zetaClient.GetBtcTssAddress()
tss, err := ob.zetaClient.GetBtcTssAddress(ob.chain.ChainId)
if err != nil {
return "", err
}
Expand All @@ -116,7 +116,7 @@ func (ob *BitcoinChainClient) CheckReceiptForBtcTxHash(txHash string, vote bool)
if err != nil {
ob.logger.WatchInTx.Error().Err(err).Msg("error posting to zeta core")
return "", err
} else if ballot == "" {
} else if zetaHash != "" {
ob.logger.WatchInTx.Info().Msgf("BTC deposit detected and reported: PostVoteInbound zeta tx: %s ballot %s", zetaHash, ballot)
}
return msg.Digest(), nil
Expand Down
2 changes: 1 addition & 1 deletion zetaclient/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ type ZetaCoreBridger interface {
GetCrosschainFlags() (observertypes.CrosschainFlags, error)
GetObserverList() ([]string, error)
GetKeyGen() (*observertypes.Keygen, error)
GetBtcTssAddress() (string, error)
GetBtcTssAddress(chainID int64) (string, error)
GetInboundTrackersForChain(chainID int64) ([]crosschaintypes.InTxTracker, error)
GetLogger() *zerolog.Logger
ZetaChain() common.Chain
Expand Down
6 changes: 4 additions & 2 deletions zetaclient/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,11 @@ func (b *ZetaCoreBridge) GetEthTssAddress() (string, error) {
return resp.Eth, nil
}

func (b *ZetaCoreBridge) GetBtcTssAddress() (string, error) {
func (b *ZetaCoreBridge) GetBtcTssAddress(chainID int64) (string, error) {
client := observertypes.NewQueryClient(b.grpcConn)
resp, err := client.GetTssAddress(context.Background(), &observertypes.QueryGetTssAddressRequest{})
resp, err := client.GetTssAddress(context.Background(), &observertypes.QueryGetTssAddressRequest{
BitcoinChainId: chainID,
})
if err != nil {
return "", err
}
Expand Down

0 comments on commit f65dc1c

Please sign in to comment.