Skip to content

Commit b2f26b0

Browse files
committed
chore: rename proofs_to_cover_min_max_fee for amount_of_proofs_for_min_max_fee
1 parent e2e396e commit b2f26b0

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

config-files/config-batcher-docker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ batcher:
3333
replacement_private_key: ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 # Anvil address 1
3434
# When validating if the msg covers the minimum max fee
3535
# A batch of how many proofs should it cover
36-
proofs_to_cover_in_min_max_fee: 32
36+
amount_of_proofs_for_min_max_fee: 32
3737
# When replacing the message, how much higher should the max fee in comparison to the original one
3838
# The calculation is replacement_max_fee >= original_max_fee + original_max_fee * min_bump_percentage / 100
3939
min_bump_percentage: 10

config-files/config-batcher-ethereum-package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ batcher:
3131
replacement_private_key: ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 # Anvil address 1
3232
# When validating if the msg covers the minimum max fee
3333
# A batch of how many proofs should it cover
34-
proofs_to_cover_in_min_max_fee: 32
34+
amount_of_proofs_for_min_max_fee: 32
3535
# When replacing the message, how much higher should the max fee in comparison to the original one
3636
# The calculation is replacement_max_fee >= original_max_fee + original_max_fee * min_bump_percentage / 100
3737
min_bump_percentage: 10

config-files/config-batcher.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ batcher:
3333
replacement_private_key: ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 # Anvil address 1
3434
# When validating if the msg covers the minimum max fee
3535
# A batch of how many proofs should it cover
36-
proofs_to_cover_in_min_max_fee: 32
36+
amount_of_proofs_for_min_max_fee: 32
3737
# When replacing the message, how much higher should the max fee in comparison to the original one
3838
# The calculation is replacement_max_fee >= original_max_fee + original_max_fee * min_bump_percentage / 100
3939
min_bump_percentage: 10

crates/batcher/src/config/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub struct BatcherConfigFromYaml {
5151
pub metrics_port: u16,
5252
pub telemetry_ip_port_address: String,
5353
pub non_paying: Option<NonPayingConfigFromYaml>,
54-
pub proofs_to_cover_in_min_max_fee: usize,
54+
pub amount_of_proofs_for_min_max_fee: usize,
5555
pub min_bump_percentage: u64,
5656
}
5757

crates/batcher/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pub struct Batcher {
9898
aggregator_fee_percentage_multiplier: u128,
9999
aggregator_gas_cost: u128,
100100
latest_block_gas_price: RwLock<U256>,
101-
proofs_to_cover_in_min_max_fee: usize,
101+
amount_of_proofs_for_min_max_fee: usize,
102102
min_bump_percentage: U256,
103103
pub metrics: metrics::BatcherMetrics,
104104
pub telemetry: TelemetrySender,
@@ -269,7 +269,7 @@ impl Batcher {
269269
max_proof_size: config.batcher.max_proof_size,
270270
max_batch_byte_size: config.batcher.max_batch_byte_size,
271271
max_batch_proof_qty: config.batcher.max_batch_proof_qty,
272-
proofs_to_cover_in_min_max_fee: config.batcher.proofs_to_cover_in_min_max_fee,
272+
amount_of_proofs_for_min_max_fee: config.batcher.amount_of_proofs_for_min_max_fee,
273273
min_bump_percentage: U256::from(config.batcher.min_bump_percentage),
274274
last_uploaded_batch_block: Mutex::new(last_uploaded_batch_block),
275275
pre_verification_is_enabled: config.batcher.pre_verification_is_enabled,
@@ -670,7 +670,7 @@ impl Batcher {
670670

671671
// Before moving on to process the message, verify that the max fee covers the
672672
// minimum max fee allowed. This prevents users from spamming with very low max fees
673-
// the min max fee is enforced by checking if it can cover a batch of [`proofs_to_cover_in_min_max_fee`]
673+
// the min max fee is enforced by checking if it can cover a batch of [`amount_of_proofs_for_min_max_fee`]
674674
let msg_max_fee = nonced_verification_data.max_fee;
675675
if !self.msg_covers_minimum_max_fee(msg_max_fee).await {
676676
send_message(
@@ -2049,7 +2049,7 @@ impl Batcher {
20492049
async fn msg_covers_minimum_max_fee(&self, msg_max_fee: U256) -> bool {
20502050
let gas_price = *self.latest_block_gas_price.read().await;
20512051
let min_max_fee_per_proof = aligned_sdk::verification_layer::compute_fee_per_proof_formula(
2052-
self.proofs_to_cover_in_min_max_fee,
2052+
self.amount_of_proofs_for_min_max_fee,
20532053
gas_price,
20542054
);
20552055
msg_max_fee >= min_max_fee_per_proof

0 commit comments

Comments
 (0)