diff --git a/cmd/zetaclientd/debug.go b/cmd/zetaclientd/debug.go index 3b556f3743..e772e6116d 100644 --- a/cmd/zetaclientd/debug.go +++ b/cmd/zetaclientd/debug.go @@ -97,6 +97,7 @@ func DebugCmd() *cobra.Command { return err } if isPending { + return fmt.Errorf("tx is still pending") } for _, chainCoreParams := range coreParams { @@ -148,6 +149,7 @@ func DebugCmd() *cobra.Command { } obBtc.WithZetaClient(bridge) obBtc.WithLogger(chainLogger) + obBtc.WithChain(*common.GetChainFromChainID(chainID)) connCfg := &rpcclient.ConnConfig{ Host: cfg.BitcoinConfig.RPCHost, User: cfg.BitcoinConfig.RPCUsername, diff --git a/zetaclient/bitcoin_client.go b/zetaclient/bitcoin_client.go index 441c98a5db..3bac40f411 100644 --- a/zetaclient/bitcoin_client.go +++ b/zetaclient/bitcoin_client.go @@ -99,6 +99,12 @@ func (ob *BitcoinChainClient) WithBtcClient(client *rpcclient.Client) { ob.rpcClient = client } +func (ob *BitcoinChainClient) WithChain(chain common.Chain) { + ob.Mu.Lock() + defer ob.Mu.Unlock() + ob.chain = chain +} + func (ob *BitcoinChainClient) SetCoreParams(params observertypes.CoreParams) { ob.Mu.Lock() defer ob.Mu.Unlock() @@ -177,6 +183,7 @@ func (ob *BitcoinChainClient) Start() { go ob.observeOutTx() go ob.WatchUTXOS() go ob.WatchGasPrice() + go ob.ExternalChainWatcherForNewInboundTrackerSuggestions() } func (ob *BitcoinChainClient) Stop() { @@ -564,6 +571,7 @@ func GetBtcEvent(tx btcjson.TxRawResult, targetAddress string, blockNumber uint6 } if found { + fmt.Println("found tx: ", tx.Txid) var fromAddress string if len(tx.Vin) > 0 { vin := tx.Vin[0] diff --git a/zetaclient/chainclient.go b/zetaclient/chainclient.go index 25f9e895cb..c92f29a77e 100644 --- a/zetaclient/chainclient.go +++ b/zetaclient/chainclient.go @@ -22,4 +22,5 @@ type ChainClient interface { GetPromGauge(name string) (prometheus.Gauge, error) GetPromCounter(name string) (prometheus.Counter, error) GetTxID(nonce uint64) string + ExternalChainWatcherForNewInboundTrackerSuggestions() } diff --git a/zetaclient/inbound_tracker.go b/zetaclient/inbound_tracker.go index 9a86749f22..a30fcea8d8 100644 --- a/zetaclient/inbound_tracker.go +++ b/zetaclient/inbound_tracker.go @@ -62,7 +62,7 @@ func (ob *BitcoinChainClient) ObserveTrackerSuggestions() error { if err != nil { return err } - ob.logger.WatchInTx.Info().Msgf("Vote submitted for tracker submitted via inbound Tracker |BTC Chain| Ballot Identifier : %s", ballotIdentifier) + ob.logger.WatchInTx.Info().Msgf("Vote submitted for tracker submitted via inbound Tracker,Chain : %s,Ballot Identifier : %s, coin-type %s", ob.chain.ChainName, ballotIdentifier, common.CoinType_Gas.String()) } return nil } @@ -76,7 +76,6 @@ func (ob *BitcoinChainClient) CheckReceiptForBtcTxHash(txHash string, vote bool) if err != nil { return "", err } - fmt.Println("Tx : ", tx.Txid, tx.Hash) blockHash, err := chainhash.NewHashFromStr(tx.BlockHash) if err != nil { return "", err @@ -123,19 +122,19 @@ func (ob *EVMChainClient) ObserveTrackerSuggestions() error { if err != nil { return err } - ob.logger.ExternalChainWatcher.Info().Msgf("Vote submitted for tracker submitted via inbound Tracker | Ballot Identifier : %s", ballotIdentifier) + ob.logger.ExternalChainWatcher.Info().Msgf("Vote submitted for tracker submitted via inbound Tracker,Chain : %s,Ballot Identifier : %s, coin-type %s", ob.chain.ChainName, ballotIdentifier, common.CoinType_Zeta.String()) case common.CoinType_ERC20: ballotIdentifier, err := ob.CheckReceiptForCoinTypeERC20(tracker.TxHash, true) if err != nil { return err } - ob.logger.ExternalChainWatcher.Info().Msgf("Vote submitted for tracker submitted via inbound Tracker | Ballot Identifier : %s", ballotIdentifier) + ob.logger.ExternalChainWatcher.Info().Msgf("Vote submitted for tracker submitted via inbound Tracker,Chain : %s,Ballot Identifier : %s, coin-type %s", ob.chain.ChainName, ballotIdentifier, common.CoinType_ERC20.String()) case common.CoinType_Gas: ballotIdentifier, err := ob.CheckReceiptForCoinTypeGas(tracker.TxHash, true) if err != nil { return err } - ob.logger.ExternalChainWatcher.Info().Msgf("Vote submitted for tracker submitted via inbound Tracker | Ballot Identifier : %s", ballotIdentifier) + ob.logger.ExternalChainWatcher.Info().Msgf("Vote submitted for tracker submitted via inbound Tracker,Chain : %s,Ballot Identifier : %s, coin-type %s", ob.chain.ChainName, ballotIdentifier, common.CoinType_Gas.String()) } } return nil