Skip to content

Commit 950862c

Browse files
committed
DEBUG: log the original validation error & one more place for Undefined
1 parent bb47ba7 commit 950862c

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed

Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frame/ethereum/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"]
1414
ethereum = { workspace = true, features = ["with-codec"] }
1515
ethereum-types = { workspace = true }
1616
evm = { workspace = true, features = ["with-codec"] }
17+
log = { workspace = true }
1718
scale-codec = { package = "parity-scale-codec", workspace = true }
1819
scale-info = { workspace = true }
1920
# Substrate
@@ -47,6 +48,7 @@ std = [
4748
"ethereum/std",
4849
"evm/std",
4950
"ethereum-types/std",
51+
"log/std",
5052
"rlp/std",
5153
"scale-codec/std",
5254
"scale-info/std",

frame/ethereum/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ impl<T: Config> Pallet<T> {
676676
};
677677

678678
Pending::<T>::append((transaction, status, receipt));
679-
679+
log::info!("**** FRONTIER, apply_validated_transaction: before ethereum.Executed event");
680680
Self::deposit_event(Event::Executed {
681681
from: source,
682682
to: dest.unwrap_or_default(),
@@ -985,6 +985,7 @@ pub struct InvalidTransactionWrapper(InvalidTransaction);
985985

986986
impl From<TransactionValidationError> for InvalidTransactionWrapper {
987987
fn from(validation_error: TransactionValidationError) -> Self {
988+
log::info!("*** FRONTIER, ethereum, validation_error={:?}", validation_error);
988989
match validation_error {
989990
TransactionValidationError::GasLimitTooLow => InvalidTransactionWrapper(
990991
InvalidTransaction::Custom(TransactionValidationError::GasLimitTooLow as u8),

frame/evm/src/lib.rs

+7
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,11 @@ pub mod pallet {
255255

256256
match info.exit_reason {
257257
ExitReason::Succeed(_) => {
258+
log::info!("***** FRONTIER evm, before evm.Executed event");
258259
Pallet::<T>::deposit_event(Event::<T>::Executed { address: target });
259260
}
260261
_ => {
262+
log::info!("***** FRONTIER evm, before evm.ExecutedFailed event");
261263
Pallet::<T>::deposit_event(Event::<T>::ExecutedFailed { address: target });
262264
}
263265
};
@@ -334,6 +336,7 @@ pub mod pallet {
334336
value: create_address,
335337
..
336338
} => {
339+
log::info!("***** FRONTIER evm, before evm.Created event");
337340
Pallet::<T>::deposit_event(Event::<T>::Created {
338341
address: create_address,
339342
});
@@ -343,6 +346,7 @@ pub mod pallet {
343346
value: create_address,
344347
..
345348
} => {
349+
log::info!("***** FRONTIER evm, before evm.CreatedFailed event");
346350
Pallet::<T>::deposit_event(Event::<T>::CreatedFailed {
347351
address: create_address,
348352
});
@@ -422,6 +426,7 @@ pub mod pallet {
422426
value: create_address,
423427
..
424428
} => {
429+
log::info!("***** FRONTIER evm, before evm.Created 2 event");
425430
Pallet::<T>::deposit_event(Event::<T>::Created {
426431
address: create_address,
427432
});
@@ -431,6 +436,7 @@ pub mod pallet {
431436
value: create_address,
432437
..
433438
} => {
439+
log::info!("***** FRONTIER evm, before evm.CreatedFailed 2 event");
434440
Pallet::<T>::deposit_event(Event::<T>::CreatedFailed {
435441
address: create_address,
436442
});
@@ -498,6 +504,7 @@ pub mod pallet {
498504

499505
impl<T> From<TransactionValidationError> for Error<T> {
500506
fn from(validation_error: TransactionValidationError) -> Self {
507+
log::info!("**** FRONTIER, frame/evm/src/lib.rs validation_error={:?}", validation_error);
501508
match validation_error {
502509
TransactionValidationError::GasLimitTooLow => Error::<T>::GasLimitTooLow,
503510
TransactionValidationError::GasLimitTooHigh => Error::<T>::GasLimitTooHigh,

frame/evm/src/runner/stack.rs

+11-3
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,19 @@ where
152152
) -> (ExitReason, R),
153153
R: Default,
154154
{
155+
log::info!("****** FRONTIER: running execute_inner: weight_limit={:?}, proof_size_base_cost={:?}", weight_limit, proof_size_base_cost);
156+
log::info!("****** FRONTIER: running execute_inner: weight_limit.proof_size={:?}", weight_limit.unwrap().proof_size());
157+
155158
// Used to record the external costs in the evm through the StackState implementation
156159
let maybe_weight_info =
157160
WeightInfo::new_from_weight_limit(weight_limit, proof_size_base_cost).map_err(
158-
|_| RunnerError {
159-
error: Error::<T>::Undefined,
160-
weight,
161+
|err| {
162+
log::info!("**** FRONTIER, execute_inner. ERROR={:?}", err);
163+
164+
RunnerError {
165+
error: Error::<T>::Undefined,
166+
weight,
167+
}
161168
},
162169
)?;
163170
// The precompile check is only used for transactional invocations. However, here we always
@@ -330,6 +337,7 @@ where
330337
log.data.len(),
331338
log.data
332339
);
340+
log::info!("**** FRONTIER, evm, before evm.Log event");
333341
Pallet::<T>::deposit_event(Event::<T>::Log {
334342
log: Log {
335343
address: log.address,

0 commit comments

Comments
 (0)