mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 01:41:36 +00:00
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.
This commit is contained in:
parent
0b35ad95f5
commit
d6a680682b
1 changed files with 1 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue