Skip to content

Commit 31ee142

Browse files
committed
Add new error type
1 parent 93209db commit 31ee142

4 files changed

Lines changed: 10 additions & 1 deletion

File tree

batcher/aligned-batcher/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ impl Batcher {
10351035
if let Some(lowest_priority_entry) = batch_state_lock.batch_queue.pop() {
10361036
send_message(
10371037
lowest_priority_entry.0.messaging_sink.unwrap(),
1038-
SubmitProofResponseMessage::AddToBatchError,
1038+
SubmitProofResponseMessage::BatchQueueLimitExceededError,
10391039
)
10401040
.await;
10411041
}

batcher/aligned-sdk/src/communication/messaging.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ async fn handle_batcher_response(msg: Message) -> Result<BatchInclusionData, Sub
265265
);
266266
Err(SubmitError::GenericError(e))
267267
}
268+
Ok(SubmitProofResponseMessage::BatchQueueLimitExceededError) => {
269+
error!("Batcher responded with error: queue limit has been exeeded. Funds have not been spent.");
270+
Err(SubmitError::BatchQueueLimitExceededError)
271+
}
268272
Err(e) => {
269273
error!(
270274
"Error while deserializing batch inclusion data: {}. Funds have not been spent.",

batcher/aligned-sdk/src/core/errors.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use core::fmt;
2+
use std::ops::Sub;
23
use ethers::providers::ProviderError;
34
use ethers::signers::WalletError;
45
use ethers::types::transaction::eip712::Eip712Error;
@@ -96,6 +97,7 @@ pub enum SubmitError {
9697
AddToBatchError,
9798
InvalidProofInclusionData,
9899
GetNonceError(String),
100+
BatchQueueLimitExceededError,
99101
GenericError(String),
100102
}
101103

@@ -210,6 +212,8 @@ impl fmt::Display for SubmitError {
210212
SubmitError::InvalidProofInclusionData => {
211213
write!(f, "Batcher responded with invalid batch inclusion data. Can't verify your proof was correctly included in the batch.")
212214
}
215+
SubmitError::BatchQueueLimitExceededError => write!(f, "Error while adding entry to batch, queue limit exeeded."),
216+
213217
SubmitError::GetNonceError(e) => write!(f, "Error while getting nonce {}", e),
214218
}
215219
}

batcher/aligned-sdk/src/core/types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ pub enum SubmitProofResponseMessage {
397397
AddToBatchError,
398398
EthRpcError,
399399
InvalidPaymentServiceAddress(Address, Address),
400+
BatchQueueLimitExceededError,
400401
}
401402

402403
#[derive(Debug, Clone, Serialize, Deserialize)]

0 commit comments

Comments
 (0)