chore(tx-pool): use max_blobs_per_tx in validating eip4844 txs (#16888)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Krishang Shah
2025-06-18 18:54:01 +05:30
committed by GitHub
parent 95cd15e595
commit 04f09f9208
2 changed files with 9 additions and 10 deletions

4
Cargo.lock generated
View File

@@ -236,9 +236,9 @@ dependencies = [
[[package]]
name = "alloy-eips"
version = "1.0.11"
version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8390cb5c872d53560635dabc02d616c1bb626dd0f7d6893f8725edb822573fed"
checksum = "4f853de9ca1819f54de80de5d03bfc1bb7c9fafcf092b480a654447141bc354d"
dependencies = [
"alloy-eip2124",
"alloy-eip2930",

View File

@@ -691,7 +691,7 @@ where
{
self.fork_tracker
.max_blob_count
.store(blob_params.max_blob_count, std::sync::atomic::Ordering::Relaxed);
.store(blob_params.max_blobs_per_tx, std::sync::atomic::Ordering::Relaxed);
}
self.block_gas_limit.store(new_tip_block.gas_limit(), std::sync::atomic::Ordering::Relaxed);
@@ -781,7 +781,7 @@ impl<Client> EthTransactionValidatorBuilder<Client> {
osaka: false,
// max blob count is prague by default
max_blob_count: BlobParams::prague().max_blob_count,
max_blob_count: BlobParams::prague().max_blobs_per_tx,
}
}
@@ -905,7 +905,7 @@ impl<Client> EthTransactionValidatorBuilder<Client> {
.chain_spec()
.blob_params_at_timestamp(timestamp)
.unwrap_or_else(BlobParams::cancun)
.max_blob_count;
.max_blobs_per_tx;
self
}
@@ -955,11 +955,10 @@ impl<Client> EthTransactionValidatorBuilder<Client> {
..
} = self;
// TODO: use osaka max blob count once <https://github.com/alloy-rs/alloy/pull/2427> is released
let max_blob_count = if prague {
BlobParams::prague().max_blob_count
BlobParams::prague().max_blobs_per_tx
} else {
BlobParams::cancun().max_blob_count
BlobParams::cancun().max_blobs_per_tx
};
let fork_tracker = ForkTracker {
@@ -1045,7 +1044,7 @@ pub struct ForkTracker {
pub prague: AtomicBool,
/// Tracks if osaka is activated at the block's timestamp.
pub osaka: AtomicBool,
/// Tracks max blob count at the block's timestamp.
/// Tracks max blob count per transaction at the block's timestamp.
pub max_blob_count: AtomicU64,
}
@@ -1070,7 +1069,7 @@ impl ForkTracker {
self.osaka.load(std::sync::atomic::Ordering::Relaxed)
}
/// Returns the max blob count.
/// Returns the max allowed blob count per transaction.
pub fn max_blob_count(&self) -> u64 {
self.max_blob_count.load(std::sync::atomic::Ordering::Relaxed)
}