diff --git a/Cargo.lock b/Cargo.lock index 850b2e70e4..d72e50e810 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5790,6 +5790,7 @@ dependencies = [ "frame-system", "hex", "libsecp256k1", + "log", "pallet-balances", "pallet-evm", "pallet-timestamp", diff --git a/frame/ethereum/Cargo.toml b/frame/ethereum/Cargo.toml index 634be1081d..6797ec4e40 100644 --- a/frame/ethereum/Cargo.toml +++ b/frame/ethereum/Cargo.toml @@ -14,6 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"] ethereum = { workspace = true, features = ["with-codec"] } ethereum-types = { workspace = true } evm = { workspace = true, features = ["with-codec"] } +log = { workspace = true } scale-codec = { package = "parity-scale-codec", workspace = true } scale-info = { workspace = true } # Substrate @@ -47,6 +48,7 @@ std = [ "ethereum/std", "evm/std", "ethereum-types/std", + "log/std", "rlp/std", "scale-codec/std", "scale-info/std", diff --git a/frame/ethereum/src/lib.rs b/frame/ethereum/src/lib.rs index e9aa870f11..caed34f685 100644 --- a/frame/ethereum/src/lib.rs +++ b/frame/ethereum/src/lib.rs @@ -676,7 +676,7 @@ impl Pallet { }; Pending::::append((transaction, status, receipt)); - + log::info!("**** FRONTIER, apply_validated_transaction: before ethereum.Executed event"); Self::deposit_event(Event::Executed { from: source, to: dest.unwrap_or_default(), @@ -985,6 +985,7 @@ pub struct InvalidTransactionWrapper(InvalidTransaction); impl From for InvalidTransactionWrapper { fn from(validation_error: TransactionValidationError) -> Self { + log::info!("*** FRONTIER, ethereum, validation_error={:?}", validation_error); match validation_error { TransactionValidationError::GasLimitTooLow => InvalidTransactionWrapper( InvalidTransaction::Custom(TransactionValidationError::GasLimitTooLow as u8), diff --git a/frame/evm/src/lib.rs b/frame/evm/src/lib.rs index a80149cdc4..97a8b8e3e3 100644 --- a/frame/evm/src/lib.rs +++ b/frame/evm/src/lib.rs @@ -255,9 +255,11 @@ pub mod pallet { match info.exit_reason { ExitReason::Succeed(_) => { + log::info!("***** FRONTIER evm, before evm.Executed event"); Pallet::::deposit_event(Event::::Executed { address: target }); } _ => { + log::info!("***** FRONTIER evm, before evm.ExecutedFailed event"); Pallet::::deposit_event(Event::::ExecutedFailed { address: target }); } }; @@ -334,6 +336,7 @@ pub mod pallet { value: create_address, .. } => { + log::info!("***** FRONTIER evm, before evm.Created event"); Pallet::::deposit_event(Event::::Created { address: create_address, }); @@ -343,6 +346,7 @@ pub mod pallet { value: create_address, .. } => { + log::info!("***** FRONTIER evm, before evm.CreatedFailed event"); Pallet::::deposit_event(Event::::CreatedFailed { address: create_address, }); @@ -422,6 +426,7 @@ pub mod pallet { value: create_address, .. } => { + log::info!("***** FRONTIER evm, before evm.Created 2 event"); Pallet::::deposit_event(Event::::Created { address: create_address, }); @@ -431,6 +436,7 @@ pub mod pallet { value: create_address, .. } => { + log::info!("***** FRONTIER evm, before evm.CreatedFailed 2 event"); Pallet::::deposit_event(Event::::CreatedFailed { address: create_address, }); @@ -498,6 +504,7 @@ pub mod pallet { impl From for Error { fn from(validation_error: TransactionValidationError) -> Self { + log::info!("**** FRONTIER, frame/evm/src/lib.rs validation_error={:?}", validation_error); match validation_error { TransactionValidationError::GasLimitTooLow => Error::::GasLimitTooLow, TransactionValidationError::GasLimitTooHigh => Error::::GasLimitTooHigh, diff --git a/frame/evm/src/runner/stack.rs b/frame/evm/src/runner/stack.rs index 274990137f..37c30c7425 100644 --- a/frame/evm/src/runner/stack.rs +++ b/frame/evm/src/runner/stack.rs @@ -152,12 +152,19 @@ where ) -> (ExitReason, R), R: Default, { + log::info!("****** FRONTIER: running execute_inner: weight_limit={:?}, proof_size_base_cost={:?}", weight_limit, proof_size_base_cost); + log::info!("****** FRONTIER: running execute_inner: weight_limit.proof_size={:?}", weight_limit.unwrap().proof_size()); + // Used to record the external costs in the evm through the StackState implementation let maybe_weight_info = WeightInfo::new_from_weight_limit(weight_limit, proof_size_base_cost).map_err( - |_| RunnerError { - error: Error::::Undefined, - weight, + |err| { + log::info!("**** FRONTIER, execute_inner. ERROR={:?}", err); + + RunnerError { + error: Error::::Undefined, + weight, + } }, )?; // The precompile check is only used for transactional invocations. However, here we always @@ -330,6 +337,7 @@ where log.data.len(), log.data ); + log::info!("**** FRONTIER, evm, before evm.Log event"); Pallet::::deposit_event(Event::::Log { log: Log { address: log.address,