Summary
The emptying-transaction threshold subtracts 1 from execution_delay without guarding the case
where execution_delay == 0.
Vulnerability details
let blocks_since_latest_txn = SeqNum( block_seq_num_of_curr_txn .0 .saturating_sub(balance_state.block_seqnum_of_latest_txn.0),);!balance_state.is_delegated && blocks_since_latest_txn > execution_delay - SeqNum(1)Impact
Because SeqNum subtraction panics on underflow, a zero execution delay can crash the path on an
otherwise valid block.
Recommendation
Rewrite the comparison so it does not rely on execution_delay - 1, or clamp the minimum allowed
delay at construction time.