Skip to content

Commit f6c5d52

Browse files
fix: task sender nonce (#1496)
1 parent bd6edd9 commit f6c5d52

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

batcher/aligned-task-sender/src/commands.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use aligned_sdk::core::types::{Network, ProvingSystemId, VerificationData};
2-
use aligned_sdk::sdk::{deposit_to_aligned, get_nonce_from_ethereum, submit_multiple};
2+
use aligned_sdk::sdk::{deposit_to_aligned, get_nonce_from_batcher, submit_multiple};
33
use ethers::prelude::*;
44
use ethers::utils::parse_ether;
55
use futures_util::StreamExt;
@@ -317,15 +317,15 @@ pub async fn send_infinite_proofs(args: SendInfiniteProofsArgs) {
317317
info!("Starting senders!");
318318
for (i, sender) in senders.iter().enumerate() {
319319
// this is necessary because of the move
320-
let eth_rpc_url = args.eth_rpc_url.clone();
321320
let batcher_url = args.batcher_url.clone();
322321
let wallet = sender.wallet.clone();
323322
let verification_data = verification_data.clone();
324323

325324
// a thread to send tasks from each loaded wallet:
326325
let handle = tokio::spawn(async move {
327-
let mut nonce =
328-
get_nonce_from_ethereum(&eth_rpc_url, wallet.address(), args.network.into())
326+
loop {
327+
let mut result = Vec::with_capacity(args.burst_size);
328+
let nonce = get_nonce_from_batcher(&batcher_url, wallet.address())
329329
.await
330330
.inspect_err(|e| {
331331
error!(
@@ -335,9 +335,6 @@ pub async fn send_infinite_proofs(args: SendInfiniteProofsArgs) {
335335
)
336336
})
337337
.unwrap();
338-
339-
loop {
340-
let mut result = Vec::with_capacity(args.burst_size);
341338
while result.len() < args.burst_size {
342339
let samples = verification_data
343340
.choose_multiple(&mut thread_rng(), args.burst_size - result.len());
@@ -365,7 +362,6 @@ pub async fn send_infinite_proofs(args: SendInfiniteProofsArgs) {
365362
match aligned_verification_data {
366363
Ok(_) => {
367364
debug!("Response received for sender {}", i);
368-
nonce += U256::from(1);
369365
}
370366
Err(e) => {
371367
error!(

0 commit comments

Comments
 (0)