Skip to content

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

Merged
aakoshh merged 2 commits intodevelopfrom
ETCM-443-fix-discovery-key-not-found
Dec 3, 2020
Merged

ETCM-443: Fix the KTable and the kademlia ID mapping getting out of sync#110
aakoshh merged 2 commits intodevelopfrom
ETCM-443-fix-discovery-key-not-found

Conversation

@aakoshh
Copy link
Copy Markdown
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