From d6a680682b8fc076a63cc625fec482f609451975 Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Thu, 16 Apr 2026 14:38:44 +0800 Subject: [PATCH] cmd/evm: fix gasUsed reporting in --create path to return gas used, not gas left In the --create path, execFunc returns gasLeft as the second return value, but the rest of the code treats this value as "gas used" (printed as such, and compared in timedExec). This makes gas reporting incorrect and can cause benchmark consistency checks to fail. --- cmd/evm/runner.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/evm/runner.go b/cmd/evm/runner.go index ebb3e04461..88c8179ea0 100644 --- a/cmd/evm/runner.go +++ b/cmd/evm/runner.go @@ -318,7 +318,7 @@ func runCmd(ctx *cli.Context) error { // don't mutate the state! runtimeConfig.State = prestate.Copy() output, _, gasLeft, err := runtime.Create(input, &runtimeConfig) - return output, gasLeft, err + return output, initialGas - gasLeft, err } } else { if len(code) > 0 {