-
Notifications
You must be signed in to change notification settings - Fork 197
Address transaction de-duplication race condition #7995
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
base: master
Are you sure you want to change the base?
Conversation
it is difficult to replicate the race condition we are testing because: - it is a race condition - the race condition is currently disallowed by our locking granularity The test case triggers the condition by manually modifying the database to only contain the reference block height index.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit confused about this logic. It's hard to grasp it without prior experience with this. I think the difficulty is in LookupClusterBlocksByReferenceHeightRange
. It returns a list of blocks for height range, and then we try to find out on which fork it is. What if we use fork traversal logic from fork.
package and traverse the fork directly. Do you think it can simplify the logic in this function?
@durkmurder Do you mean replace the
For example, suppose I need to traverse the reference height range That index is stored for finalized blocks, then we use the standard fork traversal for the un-finalized fork. So we check the fork directly for candidate That is how the implementation currently works. Then, this PR is addressing the specific race condition described in #7758. Essentially, if finalization is occurring concurrently with extension, then a child of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. It makes sense.
This PR addresses #7758, which describes a potential race condition (if concurrent cluster block finalization and extension are allowed in the future). Currently concurrent finalization and extension are not allowed, so this race condition cannot happen.