mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 22:56:43 +00:00
parent
d91c8c799e
commit
15f94b93ea
2 changed files with 6 additions and 7 deletions
|
|
@ -89,6 +89,7 @@ type Message interface {
|
|||
// ExecutionResult includes all output after executing given evm
|
||||
// message no matter the execution itself is successful or not.
|
||||
type ExecutionResult struct {
|
||||
L1Fee *big.Int
|
||||
UsedGas uint64 // Total used gas but include the refunded gas
|
||||
Err error // Any error encountered during the execution(listed in core/vm/errors.go)
|
||||
ReturnData []byte // Returned data from evm(function result or data supplied with revert opcode)
|
||||
|
|
@ -381,6 +382,7 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
|
|||
}
|
||||
|
||||
return &ExecutionResult{
|
||||
L1Fee: st.l1Fee,
|
||||
UsedGas: st.gasUsed(),
|
||||
Err: vmerr,
|
||||
ReturnData: ret,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/big"
|
||||
"runtime"
|
||||
"sync"
|
||||
|
||||
|
|
@ -15,7 +14,6 @@ import (
|
|||
"github.com/scroll-tech/go-ethereum/core/types"
|
||||
"github.com/scroll-tech/go-ethereum/core/vm"
|
||||
"github.com/scroll-tech/go-ethereum/log"
|
||||
"github.com/scroll-tech/go-ethereum/rollup/fees"
|
||||
"github.com/scroll-tech/go-ethereum/rollup/rcfg"
|
||||
"github.com/scroll-tech/go-ethereum/rollup/withdrawtrie"
|
||||
"github.com/scroll-tech/go-ethereum/rpc"
|
||||
|
|
@ -330,17 +328,16 @@ func (api *API) getTxResult(env *traceEnv, state *state.StateDB, index int, bloc
|
|||
}
|
||||
}
|
||||
|
||||
l1Fee := big.NewInt(0)
|
||||
if vmenv.ChainConfig().UsingScroll {
|
||||
l1Fee, _ = fees.CalculateL1MsgFee(msg, vmenv.StateDB)
|
||||
var l1Fee uint64
|
||||
if result.L1Fee != nil {
|
||||
l1Fee = result.L1Fee.Uint64()
|
||||
}
|
||||
|
||||
env.executionResults[index] = &types.ExecutionResult{
|
||||
From: sender,
|
||||
To: receiver,
|
||||
AccountCreated: createdAcc,
|
||||
AccountsAfter: after,
|
||||
L1Fee: l1Fee.Uint64(),
|
||||
L1Fee: l1Fee,
|
||||
Gas: result.UsedGas,
|
||||
Failed: result.Failed(),
|
||||
ReturnValue: fmt.Sprintf("%x", returnVal),
|
||||
|
|
|
|||
Loading…
Reference in a new issue