From 0b1bf193225103f9fa76cfbefb19a5f4c4c49a50 Mon Sep 17 00:00:00 2001 From: Tanmay Date: Tue, 9 Sep 2025 13:45:11 -0400 Subject: [PATCH 1/2] scan gateway events by default for all inbound hashes --- cmd/zetatool/cctx/inbound.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cmd/zetatool/cctx/inbound.go b/cmd/zetatool/cctx/inbound.go index c41abcbd2a..adb17e32fa 100644 --- a/cmd/zetatool/cctx/inbound.go +++ b/cmd/zetatool/cctx/inbound.go @@ -237,13 +237,14 @@ func (c *TrackingDetails) evmInboundBallotIdentifier(ctx *context.Context) error } msg = zetatoolchains.GasVoteV1(tx, sender, receipt.BlockNumber.Uint64(), inboundChain.ChainId, zetaChainID) } - case compareAddress(tx.To().Hex(), chainParams.GatewayAddress): + default: { gatewayAddr := ethcommon.HexToAddress(chainParams.GatewayAddress) gateway, err := gatewayevm.NewGatewayEVM(gatewayAddr, evmClient) if err != nil { return fmt.Errorf("failed to get gateway contract: %w", err) } + foundLog := false for _, log := range receipt.Logs { if log == nil || log.Address != gatewayAddr { continue @@ -251,6 +252,7 @@ func (c *TrackingDetails) evmInboundBallotIdentifier(ctx *context.Context) error eventDeposit, err := gateway.ParseDeposited(*log) if err == nil { msg = zetatoolchains.DepositInboundVoteV2(eventDeposit, inboundChain.ChainId, zetaChainID) + foundLog = true break } eventDepositAndCall, err := gateway.ParseDepositedAndCalled(*log) @@ -260,21 +262,20 @@ func (c *TrackingDetails) evmInboundBallotIdentifier(ctx *context.Context) error inboundChain.ChainId, zetaChainID, ) + foundLog = true break } eventCall, err := gateway.ParseCalled(*log) if err == nil { msg = zetatoolchains.CallInboundVoteV2(eventCall, inboundChain.ChainId, zetaChainID) + foundLog = true break } } + if !foundLog { + return fmt.Errorf("no valid gateway event found for tx %s", inboundHash) + } } - default: - return fmt.Errorf( - "irrelevant transaction , not sent to any known address txHash: %s to address %s", - inboundHash, - tx.To(), - ) } c.CCTXIdentifier = msg.Digest() From 060c60ed0601ece7d1e01825a4d9425299787007 Mon Sep 17 00:00:00 2001 From: Tanmay Date: Tue, 9 Sep 2025 13:45:11 -0400 Subject: [PATCH 2/2] scan gateway events by default for all inbound hashes --- cmd/zetatool/cctx/inbound.go | 16 ++++++++-------- cmd/zetatool/cctx/inbound_test.go | 4 ++-- cmd/zetatool/config/config.go | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/zetatool/cctx/inbound.go b/cmd/zetatool/cctx/inbound.go index c41abcbd2a..a03185b267 100644 --- a/cmd/zetatool/cctx/inbound.go +++ b/cmd/zetatool/cctx/inbound.go @@ -237,13 +237,14 @@ func (c *TrackingDetails) evmInboundBallotIdentifier(ctx *context.Context) error } msg = zetatoolchains.GasVoteV1(tx, sender, receipt.BlockNumber.Uint64(), inboundChain.ChainId, zetaChainID) } - case compareAddress(tx.To().Hex(), chainParams.GatewayAddress): + default: { gatewayAddr := ethcommon.HexToAddress(chainParams.GatewayAddress) gateway, err := gatewayevm.NewGatewayEVM(gatewayAddr, evmClient) if err != nil { return fmt.Errorf("failed to get gateway contract: %w", err) } + foundLog := false for _, log := range receipt.Logs { if log == nil || log.Address != gatewayAddr { continue @@ -251,6 +252,7 @@ func (c *TrackingDetails) evmInboundBallotIdentifier(ctx *context.Context) error eventDeposit, err := gateway.ParseDeposited(*log) if err == nil { msg = zetatoolchains.DepositInboundVoteV2(eventDeposit, inboundChain.ChainId, zetaChainID) + foundLog = true break } eventDepositAndCall, err := gateway.ParseDepositedAndCalled(*log) @@ -260,23 +262,21 @@ func (c *TrackingDetails) evmInboundBallotIdentifier(ctx *context.Context) error inboundChain.ChainId, zetaChainID, ) + foundLog = true break } eventCall, err := gateway.ParseCalled(*log) if err == nil { msg = zetatoolchains.CallInboundVoteV2(eventCall, inboundChain.ChainId, zetaChainID) + foundLog = true break } } + if !foundLog { + return fmt.Errorf("no valid gateway event found for tx %s", inboundHash) + } } - default: - return fmt.Errorf( - "irrelevant transaction , not sent to any known address txHash: %s to address %s", - inboundHash, - tx.To(), - ) } - c.CCTXIdentifier = msg.Digest() c.updateInboundConfirmation(isConfirmed) return nil diff --git a/cmd/zetatool/cctx/inbound_test.go b/cmd/zetatool/cctx/inbound_test.go index 0bd98ea87f..8bd3168b3f 100644 --- a/cmd/zetatool/cctx/inbound_test.go +++ b/cmd/zetatool/cctx/inbound_test.go @@ -54,9 +54,9 @@ func Test_InboundBallotIdentifier(t *testing.T) { }, { name: chains.SolanaMainnet.Name, - inboundHash: "5oj38HmTH4k2NSsqHK9oRrLjpPNBkm17dNXHFsaT6cTuJQRPWTCGqsPpRumPEbpL2B6Wuv51M69WoJwM24864PjB", + inboundHash: "63mNGRSCUq2dYjnFGDdDQzUMyFdnpupQrbezSDStReoeRAfd32ekXRoJ4Eszq4fC3XL3xSQnSqyDBJYQQAoiYtc6", inboundChainID: chains.SolanaMainnet.ChainId, - expectedBallotIdentifier: "0xfb5f2adc2a23c301d3231613284d937f6f45cc7b1139011abbc8486de7fcbd5f", + expectedBallotIdentifier: "0x465d6d48aa027bb633b26df727bea13baa1269025b95017aa0f5826a4acd8dc8", expectError: false, }, } diff --git a/cmd/zetatool/config/config.go b/cmd/zetatool/config/config.go index 11a7c1664d..f3fa0ef4a3 100644 --- a/cmd/zetatool/config/config.go +++ b/cmd/zetatool/config/config.go @@ -61,7 +61,7 @@ func MainnetConfig() *Config { SolanaRPC: "https://api.mainnet-beta.solana.com", BaseRPC: "https://base-mainnet.public.blastapi.io", BscRPC: "https://bsc-mainnet.public.blastapi.io", - PolygonRPC: "https://polygon-bor-rpc.publicnode.com", + PolygonRPC: "https://polygon-rpc.com/", } }