Skip to content

ETCM-443: Fix the KTable and the kademlia ID mapping getting out of sync #110

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

Merged
merged 2 commits into from
Dec 3, 2020

Conversation

aakoshh
Copy link
Contributor

@aakoshh aakoshh commented Dec 3, 2020

I mistakenly assumed that KBuckets.add adds a record while KBuckets.touch only updates the timestamp. Instead TimeSet.touch is effectively just an alias for +. Not sure if that was the intention, because KBuckets.touch says it should move an item to the end of the list, and add and touch are now doing the same thing which is slightly confusing, but TimeSetSpec clearly assumes touching will add records.

The PR changes DiscoveryService.State.withTouch to only touch the peer if it's contained in the K-table, to avoid the situation where an unresponsive peer is removed, but an async touch (perhaps due to an eviction check) puts it back into the table but not the ID mapping.

@aakoshh aakoshh requested a review from KonradStaniec December 3, 2020 13:17
@aakoshh aakoshh requested a review from jtownson December 3, 2020 13:26
@aakoshh aakoshh merged commit d5a2123 into develop Dec 3, 2020
@aakoshh aakoshh deleted the ETCM-443-fix-discovery-key-not-found branch December 3, 2020 13:54
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