-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use mutex lock for tx removal (#51)
Acquire a mutex lock and unlock while removing transactions from the mempool to avoid concurrent errors on the underlying maps. Changes made: 1. Acquire the pool mutex lock in `ClearAstriaOrdered` 2. Add a test in `legacypool_test.go` called `TestRemoveTxSanity` which adds a bunch of pending txs and removes them using `removeTx`. We use `ValidatePoolInternals` method to ensure that the pool state is not corrupted. This test is a sanity check for us to validate that `removeTx` works as intended and does not have adverse side effects. 3. Add a test in for the ExecutionAPI where we add an invalid tx which will have to be removed. We verify that the mempool is cleared completely after it --------- Co-authored-by: Bharath <vedabharath12345@gmail.com>
- Loading branch information
1 parent
401c3d5
commit c3cfc16
Showing
3 changed files
with
200 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters