Skip to content

Commit f89d7c4

Browse files
committed
fix: last_max_fee_limit
1 parent eeb557d commit f89d7c4

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

batcher/aligned-batcher/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,8 +808,10 @@ impl Batcher {
808808
nonced_verification_data.nonce,
809809
);
810810

811+
811812
if let Some(lowest_entry_priority) = batch_state_lock.lowest_entry_priority() {
812-
// If the new proof has more priority than the lowest one in the queue, discard the latter one and push the new one
813+
// If the new proof has higher priority than the lowest-priority proof in the queue,
814+
// discard the lowest-priority proof and insert the new proof according to its priority.
813815
if lowest_entry_priority.cmp(&msg_entry_priority) == Ordering::Greater {
814816
let Some((removed_entry, _)) = batch_state_lock.batch_queue.pop() else {
815817
warn!("Failed to remove lowest-priority proof despite queue being full.");

batcher/aligned-batcher/src/types/batch_state.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ impl BatchState {
232232
pub(crate) fn update_user_state_on_entry_removal(&mut self, removed_entry: &BatchQueueEntry) {
233233
let addr = removed_entry.sender;
234234

235-
let last_max_fee_limit = match self
235+
let new_last_max_fee_limit = match self
236236
.batch_queue
237237
.iter()
238238
.filter(|(e, _)| e.sender == addr)
@@ -248,8 +248,8 @@ impl BatchState {
248248
if let Entry::Occupied(mut user_state) = self.user_states.entry(addr) {
249249
user_state.get_mut().proofs_in_batch -= 1;
250250
user_state.get_mut().nonce -= U256::one();
251-
user_state.get_mut().total_fees_in_queue -= U256::one();
252-
user_state.get_mut().last_max_fee_limit = last_max_fee_limit;
251+
user_state.get_mut().total_fees_in_queue -= user_state.get_mut().last_max_fee_limit;
252+
user_state.get_mut().last_max_fee_limit = new_last_max_fee_limit;
253253
}
254254
}
255255

0 commit comments

Comments
 (0)