From cbb75b7b8d48aa06e5c02337f089e558ac4166ae Mon Sep 17 00:00:00 2001 From: beer-1 Date: Wed, 6 Nov 2024 13:17:00 +0900 Subject: [PATCH] return bridge hook early if max gas is zero --- x/opchild/keeper/deposit.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x/opchild/keeper/deposit.go b/x/opchild/keeper/deposit.go index e4433cc..bb79e29 100644 --- a/x/opchild/keeper/deposit.go +++ b/x/opchild/keeper/deposit.go @@ -11,6 +11,10 @@ import ( ) func (k Keeper) handleBridgeHook(ctx sdk.Context, data []byte, hookMaxGas uint64) (success bool, reason string) { + if hookMaxGas == 0 { + return false, "hook max gas is zero" + } + originGasMeter := ctx.GasMeter() gasForHook := originGasMeter.GasRemaining() if gasForHook > hookMaxGas {