If connecting node is not sending proper "messagestart" it should be banned. There is a lot cpu/bandwidth wasted because those "fake" nodes trying to connect over and over. Grep debug.log for "PROCESSMESSAGE: INVALID MESSAGESTART 44version" to see how much it is. After this patch node is dropped instantly.
Ban "invalid messagestart" nodes #9900
pull Rav3nPL wants to merge 1 commits into bitcoin:master from Rav3nPL:patch-2 changing 1 files +1 −0-
Rav3nPL commented at 9:33 PM on March 1, 2017: contributor
-
82573cbc95
Ban "invalid messagestart" nodes
If connecting node is not sending proper "messagestart" it should be banned. There is a lot cpu/bandwidth wasted because those "fake" nodes trying to connect over and over. Grep debug.log for "PROCESSMESSAGE: INVALID MESSAGESTART 44version" to see how much it is. After this patch node is dropped instantly.
- MarcoFalke added the label P2P on Mar 1, 2017
-
jtimon commented at 12:01 AM on March 2, 2017: contributor
utACK 82573cb Those "fake nodes" are likely just altcoin nodes. They don't want to be in the same network either.
-
TheBlueMatt commented at 12:05 AM on March 2, 2017: member
I'd be surprised if you are spending a significant amount of CPU/bandwidth on such nodes. This patch doesn't stop them from connecting (only disconnects directly thereafter), so it won't lower the CPU cost much, either. Do you have any idea what the nodes are who are doing this? I have never seen this except for one specific case of a misconfigured testnet node.
On March 1, 2017 4:33:11 PM EST, Rav3nPL notifications@github.com wrote:
If connecting node is not sending proper "messagestart" it should be banned. There is a lot cpu/bandwidth wasted because those "fake" nodes trying to connect over and over. Grep debug.log for "PROCESSMESSAGE: INVALID MESSAGESTART 44version" to see how much it is. After this patch node is dropped instantly. You can view, comment on, or merge this pull request online at:
-- Commit Summary --
- Ban "invalid messagestart" nodes
-- File Changes --
M src/net_processing.cpp (1)
-- Patch Links --
https://github.com/bitcoin/bitcoin/pull/9900.patch https://github.com/bitcoin/bitcoin/pull/9900.diff
-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/bitcoin/bitcoin/pull/9900
-
theuni commented at 1:56 AM on March 2, 2017: member
NACK. This would prohibit a few reasonable-ish protocol changes in the future, for little gain.
-
Rav3nPL commented at 7:42 AM on March 2, 2017: contributor
As for now those "bad altcions" nodes keep our daemon busy for no reason - it have to accept connection, receive some handshake data and parse response. Then daemon decide to drop connection, but do nothing more, so node is back in few seconds trying again, again, again. Because they are on totally different blockchain if we allow to connect there can be a lot more resources wasted network-wide. After this patch "bad" node is banned, so incoming connection is dropped instantly by IP. After I run it on my node I see in log, that those "bad" nodes are trying to connect every few seconds.
-
TheBlueMatt commented at 1:54 PM on March 2, 2017: member
There are hardly any more system resources wasted disconnecting after receiving the initial bad header than disconnecting before then. It really shouldn't matter almost at all.
On March 2, 2017 2:42:12 AM EST, Rav3nPL notifications@github.com wrote:
As for now those "bad altcions" nodes keep our daemon busy for no reason - it have to accept connection, receive some handshake data and parse response. Then daemon decide to drop connection, but do nothing more, so node is back in few seconds trying again, again, again. Because they are on totally different blockchain if we allow to connect there can be a lot more resources wasted network-wide. After this patch "bad" node is banned, so incoming connection is dropped instantly by IP. After I run it on my node I see in log, that those "bad" nodes are trying to connect every few seconds.
-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/bitcoin/bitcoin/pull/9900#issuecomment-283579975
-
laanwj commented at 2:23 PM on March 3, 2017: member
Banning is supposed to be used when nodes waste resources. Sending invalid/incomprehensible data just warrants a disconnect.
-
pstratem commented at 1:41 AM on March 4, 2017: contributor
Possibly the solution here is to change the log level for connections from nodes which produce gibberish?
-
gmaxwell commented at 7:41 PM on March 4, 2017: contributor
Bluematt's comments were my initial thought. I think @pstratem 's suggestion is good... most of the resources being wasted here is the log entry. :) Invalid messagestarts happen any time a non-bitcoin protocol connects, its not interesting.
-
laanwj commented at 10:00 PM on March 4, 2017: member
Agree with changing the logging for those messages. They shouldn't be shown at all unless net debugging is enabled.
-
laanwj commented at 2:53 PM on March 8, 2017: member
Closing this - it's clearly not the direction we want to go in.
- laanwj closed this on Mar 8, 2017
- MarcoFalke locked this on Sep 8, 2021