PowerLoom / epoch-manager

0 stars 0 forks source link

Force Consensus reset nonce issue #5

Closed xadahiya closed 5 months ago

xadahiya commented 5 months ago

Force consensus goes into a weird loop where it is not able to do anything in case a transaction is dropped by chain and it tries to reset the nonce.

Describe the bug

Acquiring the rw lock using aiorwlock_aqcuire_release (without acquiring semaphore) first is causing some weird behavior making the Force consensus service go into a state where it can't make any more transactions.

To Reproduce

Steps to reproduce the behavior:

  1. Start Force Consensus Service
  2. Wait for one of the transactions to be dropped by the chain or simulate the reset nonce behavior
  3. Observe Force Consensus service behavior

Proposed Solution Even for nonce reset first semaphore should be acquired using semaphore_then_aiorwlock_aqcuire_release instead of aiorwlock_aqcuire_release