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

fix(iroh-sync): actually transfer newer entries for identical keys #1630

Merged
merged 2 commits into from
Oct 12, 2023

Conversation

Frando
Copy link
Member

@Frando Frando commented Oct 12, 2023

Description

We had a bug that just was never tested for: When both peers have an entry with identical ranger keys (i.e. identical namespace, author and key), when peer A received an entry from peer B, it would never send their matching entry, even if their entry has a higher timestamp.

This PR fixes this! The actual fix is a single line: https://github.com/n0-computer/iroh/pull/1630/files#diff-be755583e5a892a8b9a6329e59cfc17e9633447fb7992db74eef670ba1508ccbR378

In addition, the PR adds both a manual test for this and a proptest strategy, which are both properly failing without the change.

It also renames the prefix methods on the ranger store trait that were introduced in #1535 to have a clearer naming (which helped me while tracking this down), and improves naming and logic around the prefix in other places.

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates if relevant.
  • Tests if relevant.

@Frando Frando changed the title fix: actually transfer newer entries fix: actually transfer newer entries for identical keys Oct 12, 2023
Copy link
Contributor

@dignifiedquire dignifiedquire left a comment

Choose a reason for hiding this comment

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

very nice catch

@Frando Frando enabled auto-merge October 12, 2023 17:20
@Frando Frando added this pull request to the merge queue Oct 12, 2023
@divagant-martian
Copy link
Contributor

should the title be changed?

@b5 b5 added this to the v0.7.1 milestone Oct 12, 2023
@Frando Frando changed the title fix: actually transfer newer entries for identical keys fix(sync): actually transfer newer entries for identical keys Oct 12, 2023
@Frando Frando changed the title fix(sync): actually transfer newer entries for identical keys fix(iroh-sync): actually transfer newer entries for identical keys Oct 12, 2023
Merged via the queue into main with commit ef8c64b Oct 12, 2023
@dignifiedquire dignifiedquire deleted the ranger-fixes branch October 12, 2023 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants