Skip to content

Commit f53e267

Browse files
committed
Revert "add docs"
This reverts commit 9b54bfc.
1 parent e0346a1 commit f53e267

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

crates/batcher/src/lib.rs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,11 @@ pub struct Batcher {
9898
aggregator_fee_percentage_multiplier: u128,
9999
aggregator_gas_cost: u128,
100100

101-
// Shared state access:
102-
// Two kinds of threads interact with the shared state:
103-
// 1. User message processing threads (run in parallel)
104-
// 2. Batch creation thread (runs sequentially, includes failure recovery)
105-
//
106-
// Locking rules:
107-
// - To avoid deadlocks, always acquire `user_states` before `batch_state`.
108-
// - During failure recovery, restoring a valid state may require breaking this rule:
109-
// additional user locks might be acquired *after* the batch lock.
110-
// (See the `restore` algorithm in the `batch_queue` module.)
111-
//
112-
// Because of this exception, user message handling uses lock acquisition with timeouts.
101+
// Shared state (Mutex)
102+
/// The general business rule is:
103+
/// - User processing can be done in parallel unless a batch creation is happening
104+
/// - Batch creation needs to be able to change all the states, so all processing
105+
/// needs to be stopped, and all user_states locks need to be taken
113106
batch_state: Mutex<BatchState>,
114107

115108
user_states: Arc<RwLock<HashMap<Address, Arc<Mutex<UserState>>>>>,

0 commit comments

Comments
 (0)