Defer inserting into maprelay until just before relaying. #8082
pull gmaxwell wants to merge 1 commits into bitcoin:master from gmaxwell:just_in_time_maprelay changing 3 files +30 −31-
gmaxwell commented at 9:48 am on May 21, 2016: contributorThis reduces the rate of not founds by better matching the far end expectations, it also improves privacy by removing the ability to use getdata to probe for a node having a txn before it has been relayed.
-
in src/main.cpp: in ef5854122b outdated
5900+ if (pto->pfilter && !pto->pfilter->IsRelevantAndUpdate(tx)) continue; 5901 pto->filterInventoryKnown.insert(hash); 5902 vInv.push_back(inv); 5903+ { 5904+ LOCK(cs_mapRelay); 5905+ if (mapRelay.find(inv.hash) == mapRelay.end()) {
sipa commented at 9:52 am on May 21, 2016:More efficient:
0auto ret = mapRelay.insert(std::make_pair(inv.hash, tx)); 1if (ret.second) { 2 vRelayExpiration.push_back(std::make_pair(GetTime() + 16 * 60, inv.hash)); 3}
gmaxwell commented at 10:04 am on May 21, 2016:Done.MarcoFalke commented at 11:07 am on May 21, 2016: memberLooks like comparison tool triggers aPOTENTIAL DEADLOCK DETECTED
laanwj added the label P2P on May 21, 2016gmaxwell commented at 1:27 pm on May 21, 2016: contributor@MarcoFalke Yep. It was an actual inversion with the vSend lock, it’s fixed.laanwj commented at 11:14 am on May 22, 2016: memberConcept ACK
Nit: After this mapRelay is no longer used in net at all. It could become local to main.
sipa commented at 4:22 pm on May 24, 2016: memberutACK d9d1f2ec345b3d7ac37ce194032940b513b5e3f0theuni commented at 7:41 pm on May 24, 2016: memberut ACK d9d1f2ec345b3d7ac37ce194032940b513b5e3f0paveljanik commented at 8:33 pm on May 24, 2016: contributor@gmaxwell Can you please be more explicit in the commit message? In “This reduces the rate of not founds”, “This” means “this PR” or you mean the 15-> 16 minutes change (why not separate commit, BTW)?
What is the logic behind 15 -> 16 anyway?
gmaxwell commented at 9:27 pm on May 24, 2016: contributor@paveljanik “better matching far end expectations”– the far end retries on a two minute interval; 15 minutes is dead between counts– starting the counter before the transaction has been offered to anyone also makes it more likely to time out first.arowser commented at 8:43 am on May 25, 2016: contributorCan one of the admins verify this patch?gmaxwell commented at 11:25 am on May 28, 2016: contributorI changed it back to 15 minutes, – I think the time there should be adjusted but it can be done in another pull that reworks the mapaskfor handling a bit.Defer inserting into maprelay until just before relaying.
This reduces the rate of not founds by better matching the far end expectations, it also improves privacy by removing the ability to use getdata to probe for a node having a txn before it has been relayed.
gmaxwell commented at 3:46 pm on May 31, 2016: contributorRebased.sipa commented at 5:34 pm on May 31, 2016: memberLightly tested ACK. Setup: two mainnet full nodes with this patch (A publicly reachable, B -connect’ed to A) and a lightweight node C (connected to the public network). Tested block synchronization/relay of B from A, relay of transactions to from A to B, relay of newly created transactions by B and C through A. Nothing unusual.sipa merged this on Jun 1, 2016sipa closed this on Jun 1, 2016
sipa referenced this in commit 01d8359983 on Jun 1, 2016codablock referenced this in commit cfe6493630 on Sep 16, 2017codablock referenced this in commit 005111b608 on Sep 19, 2017codablock referenced this in commit 51fa05ac33 on Dec 22, 2017andvgal referenced this in commit 9be6b85a52 on Jan 6, 2019zkbot referenced this in commit 1d7ed06174 on Aug 13, 2021zkbot referenced this in commit 56b5f95897 on Aug 17, 2021MarcoFalke locked this on Sep 8, 2021
gmaxwell sipa MarcoFalke laanwj theuni paveljanik arowserLabels
P2P
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-17 15:12 UTC
More mirrored repositories can be found on mirror.b10c.me