diff --git a/Cargo.lock b/Cargo.lock index a8933c7271..9451f57489 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2907,7 +2907,6 @@ version = "3.0.0-dev" dependencies = [ "evm", "frame-support", - "log", "num_enum", "parity-scale-codec", "scale-info", @@ -3278,7 +3277,6 @@ dependencies = [ "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", - "log", "pallet-aura", "pallet-balances", "pallet-base-fee", diff --git a/client/rpc/src/eth/execute.rs b/client/rpc/src/eth/execute.rs index bb518c8cb3..1c9b937b2a 100644 --- a/client/rpc/src/eth/execute.rs +++ b/client/rpc/src/eth/execute.rs @@ -84,7 +84,6 @@ where number_or_hash: Option, state_overrides: Option>, ) -> RpcResult { - log::info!(target: "rpc", "bear: --- Call request: {:?}", request); let CallRequest { from, to, @@ -176,7 +175,6 @@ where }; let data = data.map(|d| d.0).unwrap_or_default(); - log::debug!(target: "rpc", "bear: --- Call request: to {:?}", to); match to { Some(to) => { if api_version == 1 { @@ -272,7 +270,6 @@ where error_on_execution_failure(&info.exit_reason, &info.value)?; info.value } else if api_version == 5 { - log::info!(target: "rpc", "bear: --- Ready for call api 5"); let info = self .client .call_api_at(params) @@ -288,7 +285,6 @@ where .map_err(|err| internal_err(format!("runtime error: {err}")))? .map_err(|err| internal_err(format!("execution fatal: {err:?}")))?; - log::debug!(target: "rpc", "bear: --- Call request: result {:?}", info); error_on_execution_failure(&info.exit_reason, &info.value)?; info.value } else { @@ -377,7 +373,6 @@ where .map_err(|err| internal_err(format!("runtime error: {err}")))?; Ok(Bytes(code)) } else if api_version == 5 { - log::info!(target: "rpc", "bear: --- Ready for call api 5"); // Post-london + access list support let access_list = access_list.unwrap_or_default(); let info = api @@ -401,7 +396,6 @@ where .map_err(|err| internal_err(format!("runtime error: {err}")))? .map_err(|err| internal_err(format!("execution fatal: {err:?}")))?; - log::debug!(target: "rpc", "bear: --- Call request: result {:?}", info); error_on_execution_failure(&info.exit_reason, &[])?; let code = api diff --git a/frame/evm/src/runner/stack.rs b/frame/evm/src/runner/stack.rs index 4b18cc3098..4e9930dbc1 100644 --- a/frame/evm/src/runner/stack.rs +++ b/frame/evm/src/runner/stack.rs @@ -193,35 +193,33 @@ where }); } - log::info!(target: "rpc", "bear: --- Before withdraw, max_fee_per_gas: {:?}, max_priority_fee_per_gas: {:?}, is_transactional: {:?}", max_fee_per_gas, max_priority_fee_per_gas, is_transactional); - let (total_fee_per_gas, _actual_priority_fee_per_gas) = - match (max_fee_per_gas, max_priority_fee_per_gas, is_transactional) { + let total_fee_per_gas = if is_transactional { + match (max_fee_per_gas, max_priority_fee_per_gas) { // Zero max_fee_per_gas for validated transactional calls exist in XCM -> EVM // because fees are already withdrawn in the xcm-executor. - (Some(max_fee), _, true) if max_fee.is_zero() => (U256::zero(), U256::zero()), + (Some(max_fee), _) if max_fee.is_zero() => U256::zero(), // With no tip, we pay exactly the base_fee - (Some(_), None, _) => (base_fee, U256::zero()), + (Some(_), None) => base_fee, // With tip, we include as much of the tip on top of base_fee that we can, never // exceeding max_fee_per_gas - (Some(max_fee_per_gas), Some(max_priority_fee_per_gas), true) => { + (Some(max_fee_per_gas), Some(max_priority_fee_per_gas)) => { let actual_priority_fee_per_gas = max_fee_per_gas .saturating_sub(base_fee) .min(max_priority_fee_per_gas); - ( - base_fee.saturating_add(actual_priority_fee_per_gas), - actual_priority_fee_per_gas, - ) + + base_fee.saturating_add(actual_priority_fee_per_gas) } - // Gas price check is skipped for non-transactional calls or creates - (_, _, false) => (Default::default(), U256::zero()), - // Unreachable, previously validated. Handle gracefully. _ => { return Err(RunnerError { error: Error::::GasPriceTooLow, weight, }) } - }; + } + } else { + // Gas price check is skipped for non-transactional calls or creates + Default::default() + }; // After eip-1559 we make sure the account can pay both the evm execution and priority fees. let total_fee = @@ -233,10 +231,8 @@ where })?; // Deduct fee from the `source` account. Returns `None` if `total_fee` is Zero. - log::info!(target: "rpc", "bear: --- Before withdraw, total_fee: {:?}", total_fee); let fee = T::OnChargeTransaction::withdraw_fee(&source, total_fee) .map_err(|e| RunnerError { error: e, weight })?; - log::info!(target: "rpc", "bear: --- After withdraw"); // Execute the EVM call. let vicinity = Vicinity { @@ -426,7 +422,6 @@ where config: &evm::Config, ) -> Result> { if validate { - log::info!(target: "rpc", "bear: --- Ready to validate"); Self::validate( source, Some(target), @@ -443,7 +438,6 @@ where config, )?; } - log::info!(target: "rpc", "bear: --- Pass validation"); let precompiles = T::PrecompilesValue::get(); Self::execute( source, @@ -476,7 +470,6 @@ where config: &evm::Config, ) -> Result> { if validate { - log::info!(target: "rpc", "bear: --- Ready to validate"); Self::validate( source, None, @@ -492,7 +485,6 @@ where proof_size_base_cost, config, )?; - log::info!(target: "rpc", "bear: --- Pass validation"); } let precompiles = T::PrecompilesValue::get(); Self::execute( diff --git a/primitives/evm/Cargo.toml b/primitives/evm/Cargo.toml index 330755c052..9cbbd2c6de 100644 --- a/primitives/evm/Cargo.toml +++ b/primitives/evm/Cargo.toml @@ -15,7 +15,6 @@ evm = { workspace = true, features = ["with-codec"] } num_enum = { workspace = true, default-features = false } scale-codec = { package = "parity-scale-codec", workspace = true } scale-info = { workspace = true } -log = { workspace = true } serde = { workspace = true, optional = true } # Substrate frame-support = { workspace = true } @@ -27,7 +26,6 @@ sp-std = { workspace = true } default = ["std"] std = [ "evm/std", - "log/std", "evm/with-serde", "num_enum/std", "serde/std", diff --git a/primitives/evm/src/validation.rs b/primitives/evm/src/validation.rs index 6c21b792ff..405f09a4b3 100644 --- a/primitives/evm/src/validation.rs +++ b/primitives/evm/src/validation.rs @@ -154,7 +154,6 @@ impl<'config, E: From> CheckEvmTransaction<'config, if self.config.is_transactional || fee > U256::zero() { let total_payment = self.transaction.value.saturating_add(fee); if who.balance < total_payment { - log::info!(target: "rpc", "bear: --- balance too low, is_transactional: {:?}, fee: {:?}, balance: {:?}, total_payment: {:?}", self.config.is_transactional ,fee, who.balance, total_payment); return Err(TransactionValidationError::BalanceTooLow.into()); } } diff --git a/template/node/overridden-runtimes/frontier_template_runtime.compact.wasm b/template/node/overridden-runtimes/frontier_template_runtime.compact.wasm deleted file mode 100644 index 771c62898a..0000000000 Binary files a/template/node/overridden-runtimes/frontier_template_runtime.compact.wasm and /dev/null differ diff --git a/template/runtime/Cargo.toml b/template/runtime/Cargo.toml index 3c4a4dae2e..5547dee3b9 100644 --- a/template/runtime/Cargo.toml +++ b/template/runtime/Cargo.toml @@ -14,7 +14,6 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] scale-codec = { package = "parity-scale-codec", workspace = true } scale-info = { workspace = true } -log = { workspace = true } # Substrate sp-api = { workspace = true } @@ -69,7 +68,6 @@ with-paritydb-weights = [] std = [ "scale-codec/std", "scale-info/std", - "log/std", # Substrate "sp-api/std", "sp-block-builder/std", diff --git a/template/runtime/src/lib.rs b/template/runtime/src/lib.rs index 2fc63a3a54..5995ec780a 100644 --- a/template/runtime/src/lib.rs +++ b/template/runtime/src/lib.rs @@ -702,10 +702,6 @@ impl_runtime_apis! { ); let (weight_limit, proof_size_base_cost) = pallet_ethereum::Pallet::::transaction_weight(&transaction_data); - log::info!(target: "rpc", "bear: --- Ready to call the runner"); - sp_std::if_std! { - println!("bear: --- Ready to call the runner"); - } ::Runner::call( from, to, @@ -757,7 +753,6 @@ impl_runtime_apis! { ); let (weight_limit, proof_size_base_cost) = pallet_ethereum::Pallet::::transaction_weight(&transaction_data); - log::info!(target: "rpc", "bear: --- Ready to create the runner"); ::Runner::create( from, data, diff --git a/ts-tests/package.json b/ts-tests/package.json index 5bf8264624..7ed4d45ac7 100644 --- a/ts-tests/package.json +++ b/ts-tests/package.json @@ -8,8 +8,7 @@ "fmt": "prettier ./tests --write", "build": "truffle compile", "test": "mocha -r ts-node/register 'tests/**/*.ts'", - "test-sql": "FRONTIER_BACKEND_TYPE='sql' mocha -r ts-node/register 'tests/**/*.ts'", - "test-s": "FRONTIER_BACKEND_TYPE='sql' mocha -r ts-node/register 'tests/**/test-contract.ts'" + "test-sql": "FRONTIER_BACKEND_TYPE='sql' mocha -r ts-node/register 'tests/**/*.ts'" }, "author": "", "license": "ISC", diff --git a/ts-tests/tests/test-contract.ts b/ts-tests/tests/test-contract.ts index b68e4dcf75..dcdb8b80fa 100644 --- a/ts-tests/tests/test-contract.ts +++ b/ts-tests/tests/test-contract.ts @@ -57,7 +57,6 @@ describeWithFrontier("Frontier RPC (Contract)", (context) => { }); it("eth_call contract create should return code", async function () { - console.log("bear: --- this is the second test case"); expect( await context.web3.eth.call({ data: TEST_CONTRACT_BYTECODE, @@ -66,7 +65,6 @@ describeWithFrontier("Frontier RPC (Contract)", (context) => { }); it("eth_call at missing block returns error", async function () { - console.log("bear: --- this is the third test case"); const nonExistingBlockNumber = "999999"; return expect( context.web3.eth.call( diff --git a/ts-tests/tests/util.ts b/ts-tests/tests/util.ts index 46823a915e..d31e3e68c0 100644 --- a/ts-tests/tests/util.ts +++ b/ts-tests/tests/util.ts @@ -77,7 +77,6 @@ export async function startFrontierNode(provider?: string): Promise<{ `--no-prometheus`, `--sealing=Manual`, `--no-grandpa`, - `--wasm-runtime-overrides=/home/bear/coding/rust-space/frontier/template/node/overridden-runtimes/`, `--force-authoring`, `-l${FRONTIER_LOG}`, `--port=${PORT}`,