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
|
// ExecutionResult includes all output after executing given evm
|
||||||
// message no matter the execution itself is successful or not.
|
// message no matter the execution itself is successful or not.
|
||||||
type ExecutionResult struct {
|
type ExecutionResult struct {
|
||||||
|
L1Fee *big.Int
|
||||||
UsedGas uint64 // Total used gas but include the refunded gas
|
UsedGas uint64 // Total used gas but include the refunded gas
|
||||||
Err error // Any error encountered during the execution(listed in core/vm/errors.go)
|
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)
|
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{
|
return &ExecutionResult{
|
||||||
|
L1Fee: st.l1Fee,
|
||||||
UsedGas: st.gasUsed(),
|
UsedGas: st.gasUsed(),
|
||||||
Err: vmerr,
|
Err: vmerr,
|
||||||
ReturnData: ret,
|
ReturnData: ret,
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
|
||||||
"runtime"
|
"runtime"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
|
@ -15,7 +14,6 @@ import (
|
||||||
"github.com/scroll-tech/go-ethereum/core/types"
|
"github.com/scroll-tech/go-ethereum/core/types"
|
||||||
"github.com/scroll-tech/go-ethereum/core/vm"
|
"github.com/scroll-tech/go-ethereum/core/vm"
|
||||||
"github.com/scroll-tech/go-ethereum/log"
|
"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/rcfg"
|
||||||
"github.com/scroll-tech/go-ethereum/rollup/withdrawtrie"
|
"github.com/scroll-tech/go-ethereum/rollup/withdrawtrie"
|
||||||
"github.com/scroll-tech/go-ethereum/rpc"
|
"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)
|
var l1Fee uint64
|
||||||
if vmenv.ChainConfig().UsingScroll {
|
if result.L1Fee != nil {
|
||||||
l1Fee, _ = fees.CalculateL1MsgFee(msg, vmenv.StateDB)
|
l1Fee = result.L1Fee.Uint64()
|
||||||
}
|
}
|
||||||
|
|
||||||
env.executionResults[index] = &types.ExecutionResult{
|
env.executionResults[index] = &types.ExecutionResult{
|
||||||
From: sender,
|
From: sender,
|
||||||
To: receiver,
|
To: receiver,
|
||||||
AccountCreated: createdAcc,
|
AccountCreated: createdAcc,
|
||||||
AccountsAfter: after,
|
AccountsAfter: after,
|
||||||
L1Fee: l1Fee.Uint64(),
|
L1Fee: l1Fee,
|
||||||
Gas: result.UsedGas,
|
Gas: result.UsedGas,
|
||||||
Failed: result.Failed(),
|
Failed: result.Failed(),
|
||||||
ReturnValue: fmt.Sprintf("%x", returnVal),
|
ReturnValue: fmt.Sprintf("%x", returnVal),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue