Skip to content

Commit 3880a35

Browse files
committed
feat: change blob_max_count to max_blobs_per_tx
1 parent b4516fa commit 3880a35

4 files changed

Lines changed: 17 additions & 19 deletions

File tree

bins/revme/src/cmd/statetest/runner.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,9 @@ pub fn execute_test_suite(
321321

322322
// set default max blobs number to be 9 for prague
323323
if cfg.spec.is_enabled_in(SpecId::PRAGUE) {
324-
cfg.set_blob_max_count(9);
324+
cfg.set_max_blobs_per_tx(9);
325325
} else {
326-
cfg.set_blob_max_count(6);
326+
cfg.set_max_blobs_per_tx(6);
327327
}
328328

329329
// EIP-4844

crates/context/interface/src/cfg.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ pub trait Cfg {
2828
/// Specification id
2929
fn spec(&self) -> Self::Spec;
3030

31-
/// Returns the blob target and max count for the given spec id.
31+
/// Returns the maximum number of blobs allowed per transaction.
3232
/// If it is None, check for max count will be skipped.
33-
///
34-
/// EIP-7840: Add blob schedule to execution client configuration files
35-
fn blob_max_count(&self) -> Option<u64>;
33+
fn max_blobs_per_tx(&self) -> Option<u64>;
3634

3735
/// Returns the maximum code size for the given spec id.
3836
fn max_code_size(&self) -> usize;

crates/context/src/cfg.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub struct CfgEnv<SPEC = SpecId> {
3131
/// Blob max count. EIP-7840 Add blob schedule to EL config files.
3232
///
3333
/// If this config is not set, the check for max blobs will be skipped.
34-
pub blob_max_count: Option<u64>,
34+
pub max_blobs_per_tx: Option<u64>,
3535
/// Blob base fee update fraction. EIP-4844 Blob base fee update fraction.
3636
///
3737
/// If this config is not set, the blob base fee update fraction will be set to the default value.
@@ -126,7 +126,7 @@ impl<SPEC> CfgEnv<SPEC> {
126126
limit_contract_code_size: None,
127127
spec,
128128
disable_nonce_check: false,
129-
blob_max_count: None,
129+
max_blobs_per_tx: None,
130130
tx_gas_limit_cap: None,
131131
blob_base_fee_update_fraction: None,
132132
#[cfg(feature = "memory_limit")]
@@ -171,7 +171,7 @@ impl<SPEC> CfgEnv<SPEC> {
171171
spec,
172172
disable_nonce_check: self.disable_nonce_check,
173173
tx_gas_limit_cap: self.tx_gas_limit_cap,
174-
blob_max_count: self.blob_max_count,
174+
max_blobs_per_tx: self.max_blobs_per_tx,
175175
blob_base_fee_update_fraction: self.blob_base_fee_update_fraction,
176176
#[cfg(feature = "memory_limit")]
177177
memory_limit: self.memory_limit,
@@ -189,19 +189,19 @@ impl<SPEC> CfgEnv<SPEC> {
189189
}
190190

191191
/// Sets the blob target
192-
pub fn with_blob_max_count(mut self, blob_max_count: u64) -> Self {
193-
self.set_blob_max_count(blob_max_count);
192+
pub fn with_max_blobs_per_tx(mut self, max_blobs_per_tx: u64) -> Self {
193+
self.set_max_blobs_per_tx(max_blobs_per_tx);
194194
self
195195
}
196196

197197
/// Sets the blob target
198-
pub fn set_blob_max_count(&mut self, blob_max_count: u64) {
199-
self.blob_max_count = Some(blob_max_count);
198+
pub fn set_max_blobs_per_tx(&mut self, max_blobs_per_tx: u64) {
199+
self.max_blobs_per_tx = Some(max_blobs_per_tx);
200200
}
201201

202202
/// Clears the blob target and max count over hardforks.
203-
pub fn clear_blob_max_count(&mut self) {
204-
self.blob_max_count = None;
203+
pub fn clear_max_blobs_per_tx(&mut self) {
204+
self.max_blobs_per_tx = None;
205205
}
206206

207207
/// Sets the disable priority fee check flag.
@@ -241,8 +241,8 @@ impl<SPEC: Into<SpecId> + Copy> Cfg for CfgEnv<SPEC> {
241241
}
242242

243243
#[inline]
244-
fn blob_max_count(&self) -> Option<u64> {
245-
self.blob_max_count
244+
fn max_blobs_per_tx(&self) -> Option<u64> {
245+
self.max_blobs_per_tx
246246
}
247247

248248
fn max_code_size(&self) -> usize {
@@ -318,6 +318,6 @@ mod test {
318318
#[test]
319319
fn blob_max_and_target_count() {
320320
let cfg: CfgEnv = Default::default();
321-
assert_eq!(cfg.blob_max_count(), None);
321+
assert_eq!(cfg.max_blobs_per_tx(), None);
322322
}
323323
}

crates/handler/src/validation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ pub fn validate_tx_env<CTX: ContextTr, Error>(
172172
tx.blob_versioned_hashes(),
173173
tx.max_fee_per_blob_gas(),
174174
context.block().blob_gasprice().unwrap_or_default(),
175-
context.cfg().blob_max_count(),
175+
context.cfg().max_blobs_per_tx(),
176176
)?;
177177
}
178178
TransactionType::Eip7702 => {

0 commit comments

Comments
 (0)