Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
Upstream merge
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell committed Oct 31, 2023
1 parent 4a9de7f commit 9f7049a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/consensus/common/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ pub fn validate_header_standalone(
}

// Check if base fee is set.
if chain_spec.fork(Hardfork::London).active_at_block(header.number)
&& header.base_fee_per_gas.is_none()
if chain_spec.fork(Hardfork::London).active_at_block(header.number) &&
header.base_fee_per_gas.is_none()
{
return Err(ConsensusError::BaseFeeMissing);
}
Expand All @@ -38,8 +38,8 @@ pub fn validate_header_standalone(
if chain_spec.fork(Hardfork::Shanghai).active_at_timestamp(header.timestamp) && wd_root_missing
{
return Err(ConsensusError::WithdrawalsRootMissing);
} else if !chain_spec.fork(Hardfork::Shanghai).active_at_timestamp(header.timestamp)
&& header.withdrawals_root.is_some()
} else if !chain_spec.fork(Hardfork::Shanghai).active_at_timestamp(header.timestamp) &&
header.withdrawals_root.is_some()
{
return Err(ConsensusError::WithdrawalsRootUnexpected);
}
Expand Down Expand Up @@ -70,8 +70,8 @@ pub fn validate_transaction_regarding_header(
let chain_id = match transaction {
Transaction::Legacy(TxLegacy { chain_id, .. }) => {
// EIP-155: Simple replay attack protection: https://eips.ethereum.org/EIPS/eip-155
if chain_spec.fork(Hardfork::SpuriousDragon).active_at_block(at_block_number)
&& chain_id.is_some()
if chain_spec.fork(Hardfork::SpuriousDragon).active_at_block(at_block_number) &&
chain_id.is_some()
{
return Err(InvalidTransactionError::OldLegacyChainId.into());
}
Expand Down

0 comments on commit 9f7049a

Please sign in to comment.