Skip to content

fix: Cherry pick mempool tx removal race fix from astria-geth#52

Closed
bharath-123 wants to merge 2 commits intomainfrom
bharath/cherry-pick-fix-mempool
Closed

fix: Cherry pick mempool tx removal race fix from astria-geth#52
bharath-123 wants to merge 2 commits intomainfrom
bharath/cherry-pick-fix-mempool

Conversation

@bharath-123
Copy link
Copy Markdown
Contributor

This PR cherry-picks the fix with a race condition in the mempool. Refer #51 for more info

bharath-123 and others added 2 commits September 26, 2024 13:50
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>
@bharath-123 bharath-123 deleted the bharath/cherry-pick-fix-mempool branch October 11, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants