Skip to content

Commit 929dde4

Browse files
committed
cmt nits
1 parent 91c0690 commit 929dde4

File tree

1 file changed

+6
-4
lines changed
  • batcher/aligned-batcher/src

1 file changed

+6
-4
lines changed

batcher/aligned-batcher/src/lib.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ impl Batcher {
684684
return Ok(());
685685
};
686686

687-
// We estimate the min balance to be the minimum balance needed to pay for the
687+
// We estimate the minimum balance for submission to be the product of the user's `user_min_fee` and the number of proofs they have included in the batch + 1.
688688
if !self.check_min_balance(user_min_fee, proofs_in_batch + 1, user_balance, msg_max_fee) {
689689
std::mem::drop(batch_state_lock);
690690
send_message(
@@ -778,16 +778,18 @@ impl Batcher {
778778
zk_utils::is_verifier_disabled(*disabled_verifiers, verifier)
779779
}
780780

781-
// Checks user has sufficient balance for paying all its the proofs in the current batch.
781+
// Checks user has sufficient balance for paying all the users proofs in the current batch.
782782
fn check_min_balance(
783783
&self,
784784
user_min_fee: U256,
785785
user_proofs_in_batch: usize,
786786
user_balance: U256,
787787
user_max_fee: U256,
788788
) -> bool {
789-
// If user proof has not been submitted yet its default is U256::max_value().
790-
// In this case we check the user `max_fee` can pay for its proof.
789+
// `user_min_fee` is the minimum `max_fee` the user submitted to the batcher
790+
// and it represents the maximium price that the user will pay for each submitted proof.
791+
// We use 'user_min_fee' as an upper bound for the proof submission cost of the user,
792+
// and use it to validate the user's balance has enough fund available to pay for all submitted proofs.
791793
let mut min_fee = user_min_fee;
792794
if user_min_fee == U256::max_value() {
793795
min_fee = user_max_fee

0 commit comments

Comments
 (0)