-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
base: master
Are you sure you want to change the base?
Conversation
These comments became irrelevant in one of the previous code changes. They simply don't make sense anymore.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
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. |
047f61c
to
bc8e7d7
Compare
They will be used later on.
… short ids to wtxids
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.
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.
🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the Possibly this is due to a silent merge conflict (the changes in this pull request being Leave a comment here, if you need help tracking down a confusing failure. |
This is a re-attempt of #28765
The main differences from it are:
IsFanoutTarget
has been updated to reflect what the algorithm is doing (not how it is doing it)hash_key
is seeded inIsFanoutTarget
has changed (fromm_k0
towtxid.ToUint256()
). This is to prevent usingm_k0
for something it is not intended to, given what data we feed to the randomizer should not matterdestinations/target
has been renamed ton
inShouldFanoutTo/IsFanoutTarget
The differences can be easily checked via
git range-diff a14dfd9c873d1e196252c77ad7a8b32bd21b6f6d...ac5dc0aa512e78a1cc90e0ab182eedaec68b0444
Erlay Project Tracking: #28646