From 63f4f6e5a8b8476abef328037f860ba4c63bea1d Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Mon, 31 Jul 2023 15:37:38 +0200 Subject: [PATCH] rm ecrecover override field --- core/vm/interpreter.go | 1 - internal/ethapi/api.go | 14 +++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index 0f11f2839a..5b2082bc9e 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -26,7 +26,6 @@ import ( // Config are the configuration options for the Interpreter type Config struct { Tracer EVMLogger // Opcode logger - DisableECRecover bool // Debug flag to remove ecrecover from precompiles. Used for call simulations. NoBaseFee bool // Forces the EIP-1559 baseFee to 0 (needed for 0 price calls) EnablePreimageRecording bool // Enables recording of SHA3/keccak preimages ExtraEips []int // Additional EIPS that are to be enabled diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 3d044d600e..3cd9529b6d 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1180,10 +1180,9 @@ func (s *BlockChainAPI) Call(ctx context.Context, args TransactionArgs, blockNrO // CallBatch is a batch of calls to be simulated sequentially. type CallBatch struct { - BlockOverrides *BlockOverrides - StateOverrides *StateOverride - ECRecoverOverride *hexutil.Bytes // Override bytecode for ecrecover precompile. - Calls []TransactionArgs + BlockOverrides *BlockOverrides + StateOverrides *StateOverride + Calls []TransactionArgs } type blockResult struct { @@ -1271,10 +1270,6 @@ func (s *BlockChainAPI) MulticallV1(ctx context.Context, opts multicallOpts, blo if err := block.StateOverrides.ApplyMulticall(state, precompiles); err != nil { return nil, err } - // ECRecover replacement code will be fetched from statedb and executed as a normal EVM bytecode. - if block.ECRecoverOverride != nil { - state.SetCode(common.BytesToAddress([]byte{1}), *block.ECRecoverOverride) - } hash := crypto.Keccak256Hash(blockContext.BlockNumber.Bytes()) results[bi] = blockResult{ Number: hexutil.Uint64(blockContext.BlockNumber.Uint64()), @@ -1291,9 +1286,6 @@ func (s *BlockChainAPI) MulticallV1(ctx context.Context, opts multicallOpts, blo txhash := common.BigToHash(big.NewInt(int64(i))) state.SetTxContext(txhash, i) vmConfig := &vm.Config{NoBaseFee: true} - if block.ECRecoverOverride != nil { - vmConfig.DisableECRecover = true - } if opts.TraceTransfers { vmConfig.Tracer = newTracer() }