Skip to content

Commit 5e724b3

Browse files
save the signer address on init to avoid getting it from provider on each iteration
1 parent bb309a4 commit 5e724b3

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • aggregation_mode/proof_aggregator/src/backend

aggregation_mode/proof_aggregator/src/backend/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ pub struct ProofAggregator {
6262
sp1_chunk_aggregator_vk_hash_bytes: [u8; 32],
6363
risc0_chunk_aggregator_image_id_bytes: [u8; 32],
6464
db: Db,
65+
signer_address: Address,
6566
}
6667

6768
impl ProofAggregator {
@@ -74,6 +75,8 @@ impl ProofAggregator {
7475
.expect("Keystore signer should be `cast wallet` compliant");
7576
let wallet = EthereumWallet::from(signer);
7677

78+
let signer_address = signer.address();
79+
7780
// Check if the monthly budget is non-negative to avoid runtime errors later
7881
let _monthly_budget_in_wei = parse_ether(&config.monthly_budget_eth.to_string())
7982
.expect("Monthly budget must be a non-negative value");
@@ -117,6 +120,7 @@ impl ProofAggregator {
117120
sp1_chunk_aggregator_vk_hash_bytes,
118121
risc0_chunk_aggregator_image_id_bytes,
119122
db,
123+
signer_address,
120124
}
121125
}
122126

@@ -342,11 +346,7 @@ impl ProofAggregator {
342346
let nonce = self
343347
.proof_aggregation_service
344348
.provider()
345-
.get_transaction_count(
346-
self.proof_aggregation_service
347-
.provider()
348-
.default_signer_address(),
349-
)
349+
.get_transaction_count(self.signer_address)
350350
.await
351351
.map_err(|e| {
352352
RetryError::Transient(

0 commit comments

Comments
 (0)