From c8043e96bd27b72885e8c6f2f9e3a39661c49872 Mon Sep 17 00:00:00 2001 From: Nilesh Gupta Date: Wed, 2 Sep 2026 11:17:02 +0530 Subject: [PATCH] fix(vm): propagate response on DerivedEVMCall VM failure Callers bill GasUsed from the receipt; returning nil made that a no-op. --- x/vm/keeper/call_evm.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x/vm/keeper/call_evm.go b/x/vm/keeper/call_evm.go index 49eac591d..6c22f12aa 100644 --- a/x/vm/keeper/call_evm.go +++ b/x/vm/keeper/call_evm.go @@ -152,7 +152,11 @@ func (k Keeper) DerivedEVMCall( resp, err := k.DerivedEVMCallWithData(ctx, from, &contract, data, commit, gasless, isModuleSender, value, gasLimit, manualNonce) if err != nil { - return nil, errorsmod.Wrapf(err, "contract call failed: method '%s', contract '%s'", method, contract) + // Propagate resp alongside the error. On a VM failure (revert / out of gas) + // DerivedEVMCallWithData still returns a response carrying GasUsed; dropping + // it here leaves callers that charge for the gas a call actually burned with + // nothing to charge against. CallEVM above propagates for the same reason. + return resp, errorsmod.Wrapf(err, "contract call failed: method '%s', contract '%s'", method, contract) } return resp, nil }