mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-04 11:03:48 +00:00
* feat: add EIP-7702 * fix goimport * add unit tests * add api test * sync txpool update * update generated code * make code readable * fix goimport * fix TestAsyncChecker unit test * add AuthorizationList in fuzz tests for completeness sake * add EuclidV2 test, EIP-7702 transaction in TestT8n * clean up logs * bump version * fix TestAsyncChecker * Revert "fix TestAsyncChecker" This reverts commit 314478303d4a504a3948bd6595568916ba7d82f0. * accept eip-7702 txns only after enabling eip-7702 * revert IntrinsicGas param name from setCodeAuthorizations to authList * fix a bug * align upstream implementation in Encoding Receipts * fix one test case * fix tracer * return precode copy * support setcode tx in EstimateGas and add unit tests * add TestValidateAuthorizations * poseidon hash fix * migrate a fix before the fix pr is merged * support setcode type transactions in TransactionData * chore: auto version bump [bot] * add a nonce-gapped-auth-does-not-block-pending-tx unit test * make the auth invalid * Apply suggestions from code review * change usedAndLeftSlots and knownConflicts to util functions * add comments about different return of applyAuthorization * remove gencodec:required in transaction signatures * fix goimport * update StructLogger and AccessListTracer * fix a bug * fix flaky test --------- Co-authored-by: colinlyguo <colinlyguo@users.noreply.github.com> Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
79 lines
3.1 KiB
Go
79 lines
3.1 KiB
Go
// Copyright 2021 The go-ethereum Authors
|
|
// This file is part of the go-ethereum library.
|
|
//
|
|
// The go-ethereum library is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU Lesser General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// The go-ethereum library is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU Lesser General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
package native
|
|
|
|
import (
|
|
"encoding/json"
|
|
"math/big"
|
|
"time"
|
|
|
|
"github.com/scroll-tech/go-ethereum/common"
|
|
"github.com/scroll-tech/go-ethereum/core/types"
|
|
"github.com/scroll-tech/go-ethereum/core/vm"
|
|
"github.com/scroll-tech/go-ethereum/eth/tracers"
|
|
)
|
|
|
|
func init() {
|
|
register("noopTracerNative", newNoopTracer)
|
|
}
|
|
|
|
// noopTracer is a go implementation of the Tracer interface which
|
|
// performs no action. It's mostly useful for testing purposes.
|
|
type noopTracer struct{}
|
|
|
|
// newNoopTracer returns a new noop tracer.
|
|
func newNoopTracer(ctx *tracers.Context) tracers.Tracer {
|
|
return &noopTracer{}
|
|
}
|
|
|
|
// CaptureStart implements the EVMLogger interface to initialize the tracing operation.
|
|
func (t *noopTracer) CaptureStart(env *vm.EVM, from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int, authorizationResults []types.AuthorizationResult) {
|
|
}
|
|
|
|
// CaptureEnd is called after the call finishes to finalize the tracing.
|
|
func (t *noopTracer) CaptureEnd(output []byte, gasUsed uint64, _ time.Duration, err error) {
|
|
}
|
|
|
|
// CaptureState implements the EVMLogger interface to trace a single step of VM execution.
|
|
func (t *noopTracer) CaptureState(pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, rData []byte, depth int, err error) {
|
|
}
|
|
|
|
// CaptureStateAfter for special needs, tracks SSTORE ops and records the storage change.
|
|
func (t *noopTracer) CaptureStateAfter(pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, rData []byte, depth int, err error) {
|
|
}
|
|
|
|
// CaptureFault implements the EVMLogger interface to trace an execution fault.
|
|
func (t *noopTracer) CaptureFault(pc uint64, op vm.OpCode, gas, cost uint64, _ *vm.ScopeContext, depth int, err error) {
|
|
}
|
|
|
|
// CaptureEnter is called when EVM enters a new scope (via call, create or selfdestruct).
|
|
func (t *noopTracer) CaptureEnter(typ vm.OpCode, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) {
|
|
}
|
|
|
|
// CaptureExit is called when EVM exits a scope, even if the scope didn't
|
|
// execute any code.
|
|
func (t *noopTracer) CaptureExit(output []byte, gasUsed uint64, err error) {
|
|
}
|
|
|
|
// GetResult returns an empty json object.
|
|
func (t *noopTracer) GetResult() (json.RawMessage, error) {
|
|
return json.RawMessage(`{}`), nil
|
|
}
|
|
|
|
// Stop terminates execution of the tracer at the first opportune moment.
|
|
func (t *noopTracer) Stop(err error) {
|
|
}
|