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

p2p: Fill reconciliation sets (Erlay) attempt 2 #30116

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

sr-gi
Copy link
Member

@sr-gi sr-gi commented May 15, 2024

This is a re-attempt of #28765

The main differences from it are:

  • Most outstanding comments have been addressed (or responded to on the original PR)
  • The description of how a node is picked in IsFanoutTarget has been updated to reflect what the algorithm is doing (not how it is doing it)
  • The way hash_key is seeded in IsFanoutTarget has changed (from m_k0 to wtxid.ToUint256()). This is to prevent using m_k0 for something it is not intended to, given what data we feed to the randomizer should not matter
  • destinations/target has been renamed to n in ShouldFanoutTo/IsFanoutTarget
  • The PR has been rebased

The differences can be easily checked via git range-diff a14dfd9c873d1e196252c77ad7a8b32bd21b6f6d...ac5dc0aa512e78a1cc90e0ab182eedaec68b0444

Erlay Project Tracking: #28646

These comments became irrelevant in one of the previous code changes.
They simply don't make sense anymore.
@DrahtBot
Copy link
Contributor

DrahtBot commented May 15, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #30111 (locks: introduce mutex for tx download, flush rejection filters on UpdatedBlockTip by glozow)
  • #30110 (refactor: TxDownloadManager by glozow)
  • #29415 (Broadcast own transactions only via short-lived Tor or I2P connections by vasild)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@DrahtBot DrahtBot added the P2P label May 15, 2024
@sr-gi
Copy link
Member Author

sr-gi commented May 15, 2024

I've talked to @naumenkogs about picking this up and he was happy about it. I'm happy to close this if he changes his mind.

@sr-gi sr-gi changed the title p2p: Fill reconciliation sets (Erlay) attempt: 2 p2p: Fill reconciliation sets (Erlay) attempt 2 May 15, 2024
naumenkogs and others added 7 commits May 30, 2024 15:45
Transactions eligible for reconciliation are added to the
reconciliation sets. For the remaining txs, low-fanout is used.

Co-authored-by: Martin Zumsande <mzumsande@gmail.com>
Co-authored-by: Pieter Wuille <pieter.wuille@gmail.com>
It helps to avoid recomputing every time we consider
a transaction for fanout/reconciliation.
@sr-gi
Copy link
Member Author

sr-gi commented May 31, 2024

I've slightly extended the approach adding 3 commits to deal with short id collisions, which were not taken into account. Some of this may be squashable, I've added them separately for now so they are easy to diff/review.

This would be missing an additional commit/amend to deal with #28765 (comment), which I overlooked when addressing the outstanding comments

If a wtxid to be added to a peer's recon set has a shot id collisions (a previously
added wtxid maps to the same short id), both transaction should be fanout, given
our peer may have added the opposite transaction to our recon set, and reconciliation
will fail. Moreover, all descendants of the previously added transaction that were in
the recon set should also be removed and fanout.
@DrahtBot
Copy link
Contributor

🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the
documentation.

Possibly this is due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.

Leave a comment here, if you need help tracking down a confusing failure.

Debug: https://github.com/bitcoin/bitcoin/runs/25659971810

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants