Skip to content

Commit 77fbb7c

Browse files
Convert the monthly eth budget in a config variable
1 parent 839283a commit 77fbb7c

File tree

6 files changed

+11
-5
lines changed

6 files changed

+11
-5
lines changed

aggregation_mode/src/backend/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub struct Config {
2323
pub ecdsa: ECDSAConfig,
2424
pub proofs_per_chunk: u16,
2525
pub total_proofs_limit: u16,
26+
pub monthly_eth_budget_gwei: u64,
2627
}
2728

2829
impl Config {

aggregation_mode/src/backend/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ impl ProofAggregator {
143143

144144
// Iterate until we can send the proof on-chain
145145
let start_time = Instant::now();
146-
const MONTHLY_ETH_BUDGET_GWEI: u64 = 15_000_000_000;
147146

148147
let mut sent_proof = false;
149148
while !sent_proof {
@@ -156,7 +155,7 @@ impl ProofAggregator {
156155

157156
if self.should_send_proof_to_verify_on_chain(
158157
time_elapsed,
159-
MONTHLY_ETH_BUDGET_GWEI,
158+
self.config.monthly_eth_budget_gwei,
160159
gas_price.into(),
161160
) {
162161
info!("Sending proof to ProofAggregationService contract...");
@@ -370,6 +369,7 @@ mod tests {
370369
},
371370
proofs_per_chunk: 512,
372371
total_proofs_limit: 3968,
372+
monthly_eth_budget_gwei: 15_000_000_000,
373373
};
374374

375375
let aggregator = ProofAggregator::new(config);

config-files/config-proof-aggregator-ethereum-package.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ proofs_per_chunk: 512 # Amount of proofs to process per chunk
1212
# Since each proof commitments takes 32 bytes hash
1313
# We can aggregate as much proofs as 126.976 / 32 = 3968 per blob
1414
total_proofs_limit: 3968
15+
# Monthly ETH budget for on-chain proof verification
16+
monthly_eth_budget_gwei: 15_000_000_000
1517

1618
ecdsa:
1719
private_key_store_path: "config-files/anvil.proof-aggregator.ecdsa.key.json"

config-files/config-proof-aggregator-mock-ethereum-package.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ proofs_per_chunk: 512 # Amount of proofs to process per chunk
1212
# Since each proof commitments takes 32 bytes hash
1313
# We can aggregate as much proofs as 126.976 / 32 = 3968 per blob
1414
total_proofs_limit: 3968
15-
15+
# Monthly ETH budget for on-chain proof verification
16+
monthly_eth_budget_gwei: 15_000_000_000
1617

1718
ecdsa:
1819
private_key_store_path: "config-files/anvil.proof-aggregator.ecdsa.key.json"

config-files/config-proof-aggregator-mock.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ proofs_per_chunk: 512 # Amount of proofs to process per chunk
1212
# Since each proof commitments takes 32 bytes hash
1313
# We can aggregate as much proofs as 126.976 / 32 = 3968 per blob
1414
total_proofs_limit: 3968
15-
15+
# Monthly ETH budget for on-chain proof verification
16+
monthly_eth_budget_gwei: 15_000_000_000
1617

1718
ecdsa:
1819
private_key_store_path: "config-files/anvil.proof-aggregator.ecdsa.key.json"

config-files/config-proof-aggregator.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ proofs_per_chunk: 512 # Amount of proofs to process per chunk
1212
# Since each proof commitments takes 32 bytes hash
1313
# We can aggregate as much proofs as 126.976 / 32 = 3968 per blob
1414
total_proofs_limit: 3968
15-
15+
# Monthly ETH budget for on-chain proof verification
16+
monthly_eth_budget_gwei: 15_000_000_000
1617

1718
ecdsa:
1819
private_key_store_path: "config-files/anvil.proof-aggregator.ecdsa.key.json"

0 commit comments

Comments
 (0)