jnewbery
commented at 8:30 pm on May 12, 2020:
member
Headers-first is the primary method of announcement on the network. If a node fell back sending blocks by inv, it’s probably for a re-org. The final block hash provided should be the highest, so send a getheaders and then fetch the blocks we need to catch up.
Sending many GETHEADERS messages to the peer would cause them to send a large number of potentially large HEADERS messages with redundant data, which is a waste of bandwidth.
[net processing] Only send a getheaders for one block in an INV
Headers-first is the primary method of announcement on the network. If a
node fell back sending blocks by inv, it's probably for a re-org. The
final block hash provided should be the highest, so send a getheaders
and then fetch the blocks we need to catch up.
746736639e
DrahtBot added the label
P2P
on May 12, 2020
jonatack
commented at 10:36 pm on May 12, 2020:
member
The code changes look good. I need to verify the concept more when it’s not late, e.g. that the final block hash will be the highest and the variation/savings in bandwidth.
mzumsande
commented at 11:37 pm on May 12, 2020:
member
Can the “waste of bandwidth scenario” you describe ever occur?
My understanding was that it is currently taken care of by the send side by only including the tip in the INV in SendMessages(), so that there wouldn’t be multiple block hashes within an INV.
fanquake requested review from ajtowns
on May 13, 2020
fanquake requested review from amitiuttarwar
on May 13, 2020
fanquake requested review from naumenkogs
on May 13, 2020
laanwj added the label
Needs backport (0.20)
on May 13, 2020
jnewbery
commented at 2:59 am on May 14, 2020:
member
My understanding was that it is currently taken care of by the send side by only including the tip in the INV in SendMessages()
You’re right that current Bitcoin Core software should only send a single block in the INV message. The point about wasting bandwidth is more for other software that may send us many blocks in a single INV, which would cause us to reply with multiple getheaders.
naumenkogs
commented at 11:44 am on May 14, 2020:
member
utACK7467366
ajtowns
commented at 2:06 pm on May 14, 2020:
member
ACK746736639e6d05acdb85c866d4c605c947d4c500
I think this patch doesn’t change behaviour when the peer is a bitcoind (because it will only potentially send a single block in an inv message), and is not normally relevant because most peers will do headers first download and compact blocks so will find out about blocks that way. As such, which block in the inv is the best one to query doesn’t really seem decidable, so picking the last one seems as good a choice as any.
mzumsande
commented at 2:19 pm on May 14, 2020:
member
utACK746736639e6d05acdb85c866d4c605c947d4c500 as per ajtowns’ reasoning.
edit by laanwj: deleted a @
jonatack
commented at 2:21 pm on May 14, 2020:
member
ACK746736639e6d05acdb85c866d4c605c947d4c500
Code review and light sanity check running bitcoind with added debug logging in this change for a bit more than a day. Perhaps update the code comments with @ajtowns’ feedback.
MarcoFalke added this to the milestone 0.20.0
on May 14, 2020
laanwj merged this
on May 14, 2020
laanwj closed this
on May 14, 2020
jnewbery deleted the branch
on May 14, 2020
fanquake referenced this in commit
6161c94a61
on May 15, 2020
fanquake removed the label
Needs backport (0.20)
on May 15, 2020
MarcoFalke referenced this in commit
17bdf2afae
on May 15, 2020
sidhujag referenced this in commit
e78924ac41
on May 17, 2020
amitiuttarwar
commented at 9:46 pm on June 6, 2020:
contributor
post merge ACK7467366
Fabcien referenced this in commit
ba0016fcc6
on Feb 1, 2021
backpacker69 referenced this in commit
ec6fe7e9c2
on Mar 28, 2021
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2024-11-21 15:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me