diff --git a/changelog.md b/changelog.md index c943df84bf..120b77cfd3 100644 --- a/changelog.md +++ b/changelog.md @@ -41,6 +41,7 @@ Getting the correct TSS address for Bitcoin now requires proviidng the Bitcoin c ### Fixes +* [1576](https://github.com/zeta-chain/node/pull/1576) - Fix zetaclient crash due to out of bound integer conversion and log prints. * [1575](https://github.com/zeta-chain/node/issues/1575) - Skip unsupported chain parameters by IsSupported flag * [1554](https://github.com/zeta-chain/node/pull/1554) - Screen out unconfirmed UTXOs that are not created by TSS itself * [1560](https://github.com/zeta-chain/node/issues/1560) - Zetaclient post evm-chain outtx hashes only when receipt is available diff --git a/zetaclient/bitcoin_client.go b/zetaclient/bitcoin_client.go index a316e3b4ac..a82e3a44cb 100644 --- a/zetaclient/bitcoin_client.go +++ b/zetaclient/bitcoin_client.go @@ -1326,7 +1326,7 @@ func (ob *BitcoinChainClient) LoadLastBlock() error { if ob.chain.ChainId == 18444 { // bitcoin regtest: start from block 100 ob.SetLastBlockHeightScanned(100) } - ob.logger.ChainLogger.Info().Msgf("%s: start scanning from block %d", ob.chain.String(), ob.lastBlock) + ob.logger.ChainLogger.Info().Msgf("%s: start scanning from block %d", ob.chain.String(), ob.GetLastBlockHeightScanned()) return nil } diff --git a/zetaclient/zetacore_observer.go b/zetaclient/zetacore_observer.go index 51078aefd2..aff055c74f 100644 --- a/zetaclient/zetacore_observer.go +++ b/zetaclient/zetacore_observer.go @@ -2,6 +2,7 @@ package zetaclient import ( "fmt" + "math" "strings" "time" @@ -158,7 +159,7 @@ func (co *CoreObserver) startCctxScheduler() { co.logger.ZetaChainWatcher.Error().Err(err).Msgf("couldn't get operator balance") } else { diff := co.lastOperatorBalance.Sub(balance) - if diff.GT(sdkmath.NewInt(0)) { + if diff.GT(sdkmath.NewInt(0)) && diff.LT(sdkmath.NewInt(math.MaxInt64)) { co.ts.AddFeeEntry(bn, diff.Int64()) co.lastOperatorBalance = balance } @@ -355,7 +356,7 @@ func (co *CoreObserver) getUpdatedChainOb(chainID int64) (ChainClient, error) { curParams := chainOb.GetChainParams() if common.IsEVMChain(chainID) { evmCfg, found := co.cfg.GetEVMConfig(chainID) - if found && curParams != evmCfg.ChainParams { + if found && curParams.String() != evmCfg.ChainParams.String() { chainOb.SetChainParams(evmCfg.ChainParams) co.logger.ZetaChainWatcher.Info().Msgf( "updated chain params for chainID %d, new params: %v", @@ -365,7 +366,7 @@ func (co *CoreObserver) getUpdatedChainOb(chainID int64) (ChainClient, error) { } } else if common.IsBitcoinChain(chainID) { _, btcCfg, found := co.cfg.GetBTCConfig() - if found && curParams != btcCfg.ChainParams { + if found && curParams.String() != btcCfg.ChainParams.String() { chainOb.SetChainParams(btcCfg.ChainParams) co.logger.ZetaChainWatcher.Info().Msgf( "updated chain params for Bitcoin, new params: %v",