-
Notifications
You must be signed in to change notification settings - Fork 37.8k
p2p: Drop CADDR_TIME_VERSION checks now that MIN_PEER_PROTO_VERSION is greater #14033
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
I'm trying to remember what the plan was for removing the hardcoded alert |
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. |
I couldn't find anything in https://btcinformation.org/en/alert/2016-11-01-alert-retirement, but yeah, might as well remove it here. |
f808021
to
66bbc8c
Compare
The threat model seems to be: someone has been offline for quite a while (possibly using old software), reconnects to the network, and nobody has the final alert message. Instead they get connected to someone's weird node that spams them with a valid signed message that isn't the original final alert message. Is this particularly likely to happen and/or bad or something we'd want to prevent? |
Unless there is a reason to do otherwise, I think we should probably leave it in so long as we still connect to nodes that had the alert system enabled. @kanzure Because the alert key is published if someone starts older software that still has it, they could get a message like "Your wallet is outdated and could lose funds! go to leaksyourprivatekeys.com to get the new official bitcoin software". The hardcoded final alert mitigates this by blocking the message entirely and/or at least causing a message that indicates that these notices might not be safe to heed. |
Right, they were asking about removing the hardcoded alert. Anyway, I agree with leaving it in- unless it's causing issue or problems or maintenance headache. |
I think this is a good policy, there is little overhead in keeping it but I also think it would make sense to add a comment saying this, so that it's clear for future maintainers. (out of scope for this PR though as it no longer touches anything alert-system related) |
Is it intentional that you're keeping the FWIW, there seem to be no other constants for versions before If so, please do add a comment saying this, so it won't be 'accidentally' removed in a follow-up commit when someone notices that it's no longer used. |
utACK 66bbc8ce26547348906d4d648e7a22c6f9e3fc7a |
I'd guess the remaining check can be replaced by
|
66bbc8c
to
7fb962c
Compare
WIP: looking into how to test for https://github.com/bitcoin/bitcoin/pull/14033/files#r214007626 |
re-utACK 7fb962c4c1946caf0b4546bcfb6901b9d41d1443 |
7fb962c
to
fa28fd3
Compare
The last travis run for this pull request was 243 days ago and is thus outdated. To trigger a fresh travis build, this pull request should be closed and re-opened. |
fa28fd3
to
60c1519
Compare
Rebased, I think the x86_64 Linux build failure is spurious but I'm not able to rerun it. |
This looks good - it only changes e.g. What happened with the removal of |
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.
ACK 57b0c0a
I think the change here: #14033 (comment) should be applied to remove all uses of |
In this patch so far we assume Why the difference in #14033 (comment) where |
Good question! I should have been a bit more explicit with my comment "I'd also suggest adding comments to the CAddress serializer/deserializer to say that the time is only omitted for CAddress objects in the initial VERSION message." To expand:
bitcoin/src/net_processing.cpp Line 468 in ffa7080
bitcoin/src/net_processing.cpp Line 2298 in ffa7080
bitcoin/src/net_processing.cpp Lines 2262 to 2267 in ffa7080
|
@jnewbery Thanks for the elaborate explanation! So I think the patch is good as it is and it would also be good if extended as per #14033 (comment). |
Also, pull request description needs to be updated |
@Empact are you still maintaining this PR? I'm doing some work in net_processing and would like to get rid of this cruft, so I'm happy to take this over if you're no longer interested. I have a branch at https://github.com/jnewbery/bitcoin/tree/pr14033.1 that fully removes the |
Code reivew ACK 57b0c0a PR description indeed needs updating. |
Code review ACK 57b0c0a Can we change the PR description and get this merged? Other changes can be done in a follow-up. |
For those who wanted a PR description update, does the current description meet your expectations? @jnewbery thanks for the full explanation above, feel free to go ahead with the follow up, I don't have any immediate aspirations. |
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.
post-merge ACK 57b0c0a
…_PEER_PROTO_VERSION is greater 57b0c0a Drop CADDR_TIME_VERSION checks now that MIN_PEER_PROTO_VERSION is greater (Ben Woosley) Pull request description: We do not connect to peers older than 31800 ACKs for top commit: sipa: Code reivew ACK 57b0c0a jnewbery: Code review ACK 57b0c0a vasild: ACK 57b0c0a Tree-SHA512: e1ca7c9203cbad83ab7c7a2312777ad07ed6a16119169b256648b8a8738c260a5168acdd4fb33f6e4b17f51ec7e033e110b76bde55b4e3b2d444dc02c01bc2b1
…ater Summary: ``` After the version handshake, the version must be >= MIN_PEER_PROTO_VERSION, since we immediately disconnect any peer that advertises a lower version than that in its version message ``` Backport of core [[bitcoin/bitcoin#14033 | PR14033]]. Test Plan: ninja all check-all Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D8514
As per @jnewbery's comment below, "After the version handshake, the version must be >= MIN_PEER_PROTO_VERSION, since we immediately disconnect any peer that advertises a lower version than that in its version message"
#14033 (comment)