Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSUB-1223: Remove deny_unknown_fields attribute from CallRequest. #3

Open
wants to merge 3 commits into
base: polkadot-v1.1.0-patch
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion client/rpc-core/src/types/call_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use crate::types::{deserialize_data_or_input, Bytes};

/// Call request
#[derive(Clone, Debug, Default, Eq, PartialEq, Deserialize)]
#[serde(deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct CallRequest {
/// From
Expand Down
2 changes: 2 additions & 0 deletions frame/ethereum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -47,6 +48,7 @@ std = [
"ethereum/std",
"evm/std",
"ethereum-types/std",
"log/std",
"rlp/std",
"scale-codec/std",
"scale-info/std",
Expand Down
3 changes: 2 additions & 1 deletion frame/ethereum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ impl<T: Config> Pallet<T> {
};

Pending::<T>::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(),
Expand Down Expand Up @@ -985,6 +985,7 @@ pub struct InvalidTransactionWrapper(InvalidTransaction);

impl From<TransactionValidationError> 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),
Expand Down
11 changes: 11 additions & 0 deletions frame/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,11 @@ pub mod pallet {

match info.exit_reason {
ExitReason::Succeed(_) => {
log::info!("***** FRONTIER evm, before evm.Executed event");
Pallet::<T>::deposit_event(Event::<T>::Executed { address: target });
}
_ => {
log::info!("***** FRONTIER evm, before evm.ExecutedFailed event");
Pallet::<T>::deposit_event(Event::<T>::ExecutedFailed { address: target });
}
};
Expand Down Expand Up @@ -334,6 +336,7 @@ pub mod pallet {
value: create_address,
..
} => {
log::info!("***** FRONTIER evm, before evm.Created event");
Pallet::<T>::deposit_event(Event::<T>::Created {
address: create_address,
});
Expand All @@ -343,6 +346,7 @@ pub mod pallet {
value: create_address,
..
} => {
log::info!("***** FRONTIER evm, before evm.CreatedFailed event");
Pallet::<T>::deposit_event(Event::<T>::CreatedFailed {
address: create_address,
});
Expand Down Expand Up @@ -422,6 +426,7 @@ pub mod pallet {
value: create_address,
..
} => {
log::info!("***** FRONTIER evm, before evm.Created 2 event");
Pallet::<T>::deposit_event(Event::<T>::Created {
address: create_address,
});
Expand All @@ -431,6 +436,7 @@ pub mod pallet {
value: create_address,
..
} => {
log::info!("***** FRONTIER evm, before evm.CreatedFailed 2 event");
Pallet::<T>::deposit_event(Event::<T>::CreatedFailed {
address: create_address,
});
Expand Down Expand Up @@ -498,6 +504,7 @@ pub mod pallet {

impl<T> From<TransactionValidationError> for Error<T> {
fn from(validation_error: TransactionValidationError) -> Self {
log::info!("**** FRONTIER, frame/evm/src/lib.rs validation_error={:?}", validation_error);
match validation_error {
TransactionValidationError::GasLimitTooLow => Error::<T>::GasLimitTooLow,
TransactionValidationError::GasLimitTooHigh => Error::<T>::GasLimitTooHigh,
Expand All @@ -507,6 +514,10 @@ pub mod pallet {
TransactionValidationError::GasPriceTooLow => Error::<T>::GasPriceTooLow,
TransactionValidationError::PriorityFeeTooHigh => Error::<T>::GasPriceTooLow,
TransactionValidationError::InvalidFeeInput => Error::<T>::GasPriceTooLow,
TransactionValidationError::InvalidChainId => panic!("+++ DEBUG: InvalidChainId"),
TransactionValidationError::InvalidSignature => {
panic!("+++ DEBUG: InvalidSignature")
}
_ => Error::<T>::Undefined,
}
}
Expand Down
14 changes: 11 additions & 3 deletions frame/evm/src/runner/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<T>::Undefined,
weight,
|err| {
log::info!("**** FRONTIER, execute_inner. ERROR={:?}", err);

RunnerError {
error: Error::<T>::Undefined,
weight,
}
},
)?;
// The precompile check is only used for transactional invocations. However, here we always
Expand Down Expand Up @@ -330,6 +337,7 @@ where
log.data.len(),
log.data
);
log::info!("**** FRONTIER, evm, before evm.Log event");
Pallet::<T>::deposit_event(Event::<T>::Log {
log: Log {
address: log.address,
Expand Down
Loading