diff --git a/frame/evm/src/runner/stack.rs b/frame/evm/src/runner/stack.rs index 3193b1c049..deeb569a8d 100644 --- a/frame/evm/src/runner/stack.rs +++ b/frame/evm/src/runner/stack.rs @@ -27,7 +27,7 @@ use evm::{ executor::stack::{Accessed, StackExecutor, StackState as StackStateT, StackSubstateMetadata}, ExitError, ExitReason, Transfer, }; -use fp_evm::{CallInfo, CreateInfo, ExecutionInfo, Log, PrecompileSet, Vicinity}; +use fp_evm::{CallInfo, CreateInfo, ExecutionInfo, Log, Vicinity}; use frame_support::traits::{Currency, ExistenceRequirement, Get}; use sp_core::{H160, H256, U256}; use sp_runtime::traits::UniqueSaturatedInto; @@ -136,14 +136,7 @@ where // // EIP-3607: https://eips.ethereum.org/EIPS/eip-3607 // Do not allow transactions for which `tx.sender` has any code deployed. - // - // We extend the principle of this EIP to also prevent `tx.sender` to be the address - // of a precompile. While mainnet Ethereum currently only has stateless precompiles, - // projects using Frontier can have stateful precompiles that can manage funds or - // which calls other contracts that expects this precompile address to be trustworthy. - if is_transactional - && (!>::get(source).is_empty() || precompiles.is_precompile(source)) - { + if is_transactional && !>::get(source).is_empty() { return Err(RunnerError { error: Error::::TransactionMustComeFromEOA, weight, diff --git a/frame/evm/src/tests.rs b/frame/evm/src/tests.rs index 65fc0e033b..44b31c8f9b 100644 --- a/frame/evm/src/tests.rs +++ b/frame/evm/src/tests.rs @@ -605,49 +605,3 @@ fn eip3607_transaction_from_contract() { .is_ok()); }); } - -#[test] -fn eip3607_transaction_from_precompile() { - new_test_ext().execute_with(|| { - // external transaction - match ::Runner::call( - // Precompile address. - H160::from_str("0000000000000000000000000000000000000001").unwrap(), - H160::from_str("1000000000000000000000000000000000000001").unwrap(), - Vec::new(), - U256::from(1u32), - 1000000, - None, - None, - None, - Vec::new(), - true, // transactional - false, // not sure be validated - &::config().clone(), - ) { - Err(RunnerError { - error: Error::TransactionMustComeFromEOA, - .. - }) => (), - _ => panic!("Should have failed"), - } - - // internal call - assert!(::Runner::call( - // Contract address. - H160::from_str("0000000000000000000000000000000000000001").unwrap(), - H160::from_str("1000000000000000000000000000000000000001").unwrap(), - Vec::new(), - U256::from(1u32), - 1000000, - None, - None, - None, - Vec::new(), - false, // non-transactional - true, // must be validated - &::config().clone(), - ) - .is_ok()); - }); -}