cmd/evm: add `gasUsed` to t8n `result` (#23919)

* cmd/evm: add gas used accumulator to t8n result

* cmd/evm: update t8n tests to include gas used field
pull/23924/head
lightclient 3 years ago committed by GitHub
parent abc74a5ffe
commit b0b708bf23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      cmd/evm/internal/t8ntool/execution.go
  2. 5
      cmd/evm/testdata/1/exp.json
  3. 3
      cmd/evm/testdata/13/exp2.json
  4. 5
      cmd/evm/testdata/14/exp.json
  5. 5
      cmd/evm/testdata/14/exp2.json
  6. 5
      cmd/evm/testdata/14/exp_berlin.json
  7. 5
      cmd/evm/testdata/19/exp_arrowglacier.json
  8. 5
      cmd/evm/testdata/19/exp_london.json
  9. 3
      cmd/evm/testdata/3/exp.json
  10. 3
      cmd/evm/testdata/5/exp.json

@ -55,6 +55,7 @@ type ExecutionResult struct {
Receipts types.Receipts `json:"receipts"`
Rejected []*rejectedTx `json:"rejected,omitempty"`
Difficulty *math.HexOrDecimal256 `json:"currentDifficulty" gencodec:"required"`
GasUsed math.HexOrDecimal64 `json:"gasUsed"`
}
type ommer struct {
@ -255,6 +256,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
Receipts: receipts,
Rejected: rejectedTxs,
Difficulty: (*math.HexOrDecimal256)(vmContext.Difficulty),
GasUsed: (math.HexOrDecimal64)(gasUsed),
}
return statedb, execRs, nil
}

@ -38,6 +38,7 @@
"error": "nonce too low: address 0x8A8eAFb1cf62BfBeb1741769DAE1a9dd47996192, tx: 0 state: 1"
}
],
"currentDifficulty": "0x20000"
"currentDifficulty": "0x20000",
"gasUsed": "0x5208"
}
}
}

@ -33,6 +33,7 @@
"transactionIndex": "0x1"
}
],
"currentDifficulty": "0x20000"
"currentDifficulty": "0x20000",
"gasUsed": "0x109a0"
}
}

@ -6,6 +6,7 @@
"logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"currentDifficulty": "0x2000020000000",
"receipts": []
"receipts": [],
"gasUsed": "0x0"
}
}
}

@ -6,6 +6,7 @@
"logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"receipts": [],
"currentDifficulty": "0x1ff8020000000"
"currentDifficulty": "0x1ff8020000000",
"gasUsed": "0x0"
}
}
}

@ -6,6 +6,7 @@
"logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"receipts": [],
"currentDifficulty": "0x1ff9000000000"
"currentDifficulty": "0x1ff9000000000",
"gasUsed": "0x0"
}
}
}

@ -6,6 +6,7 @@
"logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"currentDifficulty": "0x2000000200000",
"receipts": []
"receipts": [],
"gasUsed": "0x0"
}
}
}

@ -6,6 +6,7 @@
"logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"currentDifficulty": "0x2000080000000",
"receipts": []
"receipts": [],
"gasUsed": "0x0"
}
}
}

@ -32,6 +32,7 @@
"transactionIndex": "0x0"
}
],
"currentDifficulty": "0x20000"
"currentDifficulty": "0x20000",
"gasUsed": "0x521f"
}
}

@ -17,6 +17,7 @@
"logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"receipts": [],
"currentDifficulty": "0x20000"
"currentDifficulty": "0x20000",
"gasUsed": "0x0"
}
}

Loading…
Cancel
Save