-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
Description
Problem
The ValidatorSetManager in crates/consensus/src/validator_set_manager.rs uses expect("lock poisoned") for all RwLock operations, which will cause cascading panics if any thread holding a lock panics.
Details
Multiple occurrences throughout the file:
*self.current_epoch.read().expect("lock poisoned")
let mut sets = self.sets.write().expect("lock poisoned")
let mut pending = self.pending_next_epoch.write().expect("lock poisoned")Similar patterns exist in:
crates/rpc/src/middleware.rs(rate limiter locks)crates/consensus/src/validator_set_manager.rs(InMemoryValidatorSetStorage)
Impact
- If any consensus thread panics while holding a lock, all subsequent validator set operations will panic
- Node becomes unrecoverable without restart
- No graceful degradation or error logging