Skip to content

Commit

Permalink
Merge branch 'paradigmxyz:main' into reorged_logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Arindam2407 authored Dec 22, 2023
2 parents 2d26c25 + 325bc49 commit 18d298c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/consensus/common/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ pub fn validate_transaction_regarding_header(
transaction: &Transaction,
chain_spec: &ChainSpec,
at_block_number: BlockNumber,
at_timestamp: u64,
base_fee: Option<u64>,
) -> Result<(), ConsensusError> {
let chain_id = match transaction {
Expand Down Expand Up @@ -110,6 +111,11 @@ pub fn validate_transaction_regarding_header(
max_priority_fee_per_gas,
..
}) => {
// EIP-4844: Shard Blob Transactions https://eips.ethereum.org/EIPS/eip-4844
if !chain_spec.fork(Hardfork::Cancun).active_at_timestamp(at_timestamp) {
return Err(InvalidTransactionError::Eip4844Disabled.into())
}

// EIP-1559: add more constraints to the tx validation
// https://github.com/ethereum/EIPs/pull/3594
if max_priority_fee_per_gas > max_fee_per_gas {
Expand Down Expand Up @@ -155,6 +161,7 @@ pub fn validate_all_transaction_regarding_block_and_nonces<
transaction,
chain_spec,
header.number,
header.timestamp,
header.base_fee_per_gas,
)?;

Expand Down

0 comments on commit 18d298c

Please sign in to comment.