Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make P-Chain Mempool thread-safe #2523

Merged
merged 8 commits into from
Dec 21, 2023
Merged

Conversation

joshua-kim
Copy link
Contributor

Why this should be merged

Makes the P-Chain mempool thread-safe. Currently we use the snow.Context lock to synchronize access to this, but we can use a lock in the mempool struct itself and only require holding the context lock when verifying against latest state.

How this works

Adds lock to the mempool

How this was tested

UTs

@joshua-kim joshua-kim self-assigned this Dec 20, 2023
@joshua-kim joshua-kim added the vm This involves virtual machines label Dec 20, 2023
Signed-off-by: Joshua Kim <[email protected]>
@joshua-kim joshua-kim force-pushed the pchain-thread-safe-mempool branch from f67d1da to 9413a68 Compare December 20, 2023 17:18
@joshua-kim joshua-kim marked this pull request as ready for review December 20, 2023 17:20
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Copy link
Contributor

@abi87 abi87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall look good to me.
I have a question about capping iteration.

Signed-off-by: Joshua Kim <[email protected]>
@StephenButtolph StephenButtolph added this to the v1.10.18 milestone Dec 21, 2023
@StephenButtolph StephenButtolph merged commit 35907e0 into dev Dec 21, 2023
17 checks passed
@StephenButtolph StephenButtolph deleted the pchain-thread-safe-mempool branch December 21, 2023 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vm This involves virtual machines
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants