-
Notifications
You must be signed in to change notification settings - Fork 37.7k
net_processing: ignore transactions while in IBD #21327
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
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this probably has no effect in practice, it shouldn't hurt to do either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK. Thanks for adding tests!
5b9036e
to
d631448
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for tackling this, I exercised new test coverage, works as expected!
W.r.t to Marco point, I don't think logging this minor rejection case is that important.
utACK d631448 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
Issues like those being explored in #21106 — where IBD may kick in at unintuitive times, complicating our understanding of the network due to special-case interactions throughout our codebase — are why I think we should hesitate before adding more checks gated on IBD and ensure we have a good reason for doing so. In this case, I think our code is simpler to understand if we either always or never processed unrequested transactions (and the benefit to skipping this while in IBD seems small in comparison). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK d631448
Ubuntu 20.04
- Ran the test individually and via test_runner (with all tests)
- Code looks fine (comments/docs are very good - they explains each test step perfectly)
🕵️ @sipa has been requested to review this pull request as specified in the REVIEWERS file. |
d631448
to
89ebd01
Compare
Just pushed some changes addressing @ariard’s review comment and clarifying the comment about “not a protocol violation.” On why add a gate for unsolicited transactions in IBD but not the general case: There can perhaps be an observable difference if we stop processing unsolicited transactions in the general case - someone mentioned in #21224 that there are clients that wouldn’t be able to broadcast their transactions because they don’t follow the inv/getdata dialogue. I'm not sure what the status is on that discussion so I won't speak to it too much. On the other hand, I don’t think there’s any downside to ignoring unsolicited transactions in IBD. We just have less wasted effort: Right now, if we can’t validate the transaction yet, we waste time putting it into orphan pool. If it conflicts with a block tx we see later on, we need to go through removing it from our mempool. If it’s valid and we can validate it, doing so while in IBD doesn’t benefit us - even if we come out of IBD really quickly (e.g. on a restart), we can download it again in a rebroadcast (or, later on, a reconciliation with Erlay). My personal opinion is that getting to exit early is worth the complexity of an extra |
Code review ACK 89ebd01 |
89ebd01
to
1665bbd
Compare
1665bbd
to
648c5c7
Compare
ACK 648c5c7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested ACK 648c5c7 on Ubuntu 20.04.
This simplifies the IBD logic a bit.
Co-authored-by: Amiti Uttarwar <amiti@uttarwar.org> Github-Pull: bitcoin#21327 Rebased-From: 8d5697c
Co-authored-by: Amiti Uttarwar <amiti@uttarwar.org> Github-Pull: bitcoin#21327 Rebased-From: 648c5c7
The code 648c5c7 looks correct, but I share the hesitation suhas expressed above. |
Co-authored-by: Amiti Uttarwar <amiti@uttarwar.org>
Co-authored-by: Amiti Uttarwar <amiti@uttarwar.org>
648c5c7
to
6aed8b7
Compare
reACK 6aed8b7 |
Code review ACK 6aed8b7 |
…e in IBD 3f4019a [test] tx processing before and after ibd (glozow) ef3eea0 [net_processing] ignore all transactions during ibd (glozow) Pull request description: This is basically a mini, IBD-only version of #21224 Incoming transactions aren't really relevant until we're caught up. That's why we send a giant feefilter and don't send tx getdatas, but we also shouldn't process them if peers send them anyway. Simply ignore them. ACKs for top commit: jnewbery: reACK 3f4019a laanwj: Code review ACK 3f4019a Tree-SHA512: 8e1616bf355f9d0b180bdbc5461f24c757dc5d7bc7bf651470f3b0bffcca5d5e68287106255b5cede2d96b42bce448a0f8c0649de35a530c5e079f7c89c70a35
This is basically a mini, IBD-only version of #21224
Incoming transactions aren't really relevant until we're caught up. That's why we send a giant feefilter and don't send tx getdatas, but we also shouldn't process them if peers send them anyway. Simply ignore them.