diff --git a/changelog.md b/changelog.md index 27f2123f35..ad0deb58d3 100644 --- a/changelog.md +++ b/changelog.md @@ -38,6 +38,7 @@ * [1525](https://github.com/zeta-chain/node/pull/1525) - relax EVM chain block header length check 1024->4096 * [1522](https://github.com/zeta-chain/node/pull/1522/files) - block `distribution` module account from receiving zeta * [1528](https://github.com/zeta-chain/node/pull/1528) - fix panic caused on decoding malformed BTC addresses +* [1556](https://github.com/zeta-chain/node/pull/1556) - add emptiness check for topic array in event parsing * [1555](https://github.com/zeta-chain/node/pull/1555) - Reduce websocket message limit to 10MB ### Refactoring diff --git a/x/crosschain/keeper/evm_hooks.go b/x/crosschain/keeper/evm_hooks.go index e4c3ed5d4b..f2b9f6bc8d 100644 --- a/x/crosschain/keeper/evm_hooks.go +++ b/x/crosschain/keeper/evm_hooks.go @@ -275,6 +275,9 @@ func (k Keeper) ParseZRC20WithdrawalEvent(ctx sdk.Context, log ethtypes.Log) (*z if err != nil { return nil, err } + if len(log.Topics) == 0 { + return nil, fmt.Errorf("ParseZRC20WithdrawalEvent: invalid log - no topics") + } event, err := zrc20ZEVM.ParseWithdrawal(log) if err != nil { return nil, err @@ -306,6 +309,9 @@ func ParseZetaSentEvent(log ethtypes.Log, connectorZEVM ethcommon.Address) (*con if err != nil { return nil, err } + if len(log.Topics) == 0 { + return nil, fmt.Errorf("ParseZetaSentEvent: invalid log - no topics") + } event, err := zetaConnectorZEVM.ParseZetaSent(log) if err != nil { return nil, err