Skip to content

Commit 1ca9c4e

Browse files
committed
Add save config on proof_aggregator start
1 parent 9b941f6 commit 1ca9c4e

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

aggregation_mode/src/backend/fetcher.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,8 @@ impl ProofsFetcher {
128128

129129
Ok(proofs)
130130
}
131+
132+
pub fn get_last_processed_block(&self) -> u64 {
133+
self.last_processed_block
134+
}
131135
}

aggregation_mode/src/backend/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,15 @@ impl ProofAggregator {
6969
}
7070
}
7171

72-
pub async fn start(&mut self) {
72+
pub async fn start(&mut self, config: &mut Config) {
7373
info!("Starting proof aggregator service",);
7474

7575
info!("About to aggregate and submit proof to be verified on chain");
7676
let res = self.aggregate_and_submit_proofs_on_chain().await;
7777

7878
match res {
7979
Ok(()) => {
80+
config.last_processed_block = self.fetcher.get_last_processed_block();
8081
info!("Process finished successfully");
8182
}
8283
Err(err) => {

aggregation_mode/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ async fn main() {
2323
// load config
2424
let config_file_path = read_config_filepath_from_args();
2525
tracing::info!("Loading config from {}...", config_file_path);
26-
let config = Config::from_file(&config_file_path).expect("Config is valid");
26+
let mut config = Config::from_file(&config_file_path).expect("Config is valid");
2727
tracing::info!("Config loaded");
2828

2929
let mut proof_aggregator = ProofAggregator::new(&config);
30-
proof_aggregator.start().await;
30+
proof_aggregator.start(&mut config).await;
3131

32-
config.save_to_file(&config_file_path).unwrap();
32+
config.save_to_file(&config_file_path).unwrap();
3333
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ eth_ws_url: ws://localhost:8545
33
max_proofs_in_queue: 1000
44
proof_aggregation_service_address: 0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07
55
aligned_service_manager_address: 0x851356ae760d987E095750cCeb3bC6014560891C
6-
last_processed_block: 0
6+
last_processed_block: 626
77
ecdsa:
88
private_key_store_path: config-files/anvil.proof-aggregator.ecdsa.key.json
99
private_key_store_password: ''

0 commit comments

Comments
 (0)