Skip to content

Conversation

@sdaftuar
Copy link
Member

@sdaftuar sdaftuar commented Sep 25, 2018

Respond to getdata requests for transactions that are ancestors of newly-announced transactions. Currently, our software will request the parents of an orphan transaction from the peer who announced the orphan, but if our peer is running a recent Bitcoin Core version, the request would typically be dropped. So this should improve propagation for transaction chains, particularly for nodes that are just starting up.

(continued from #14220, which is now just a bugfix PR)

Depends on:

sdaftuar and others added 5 commits September 25, 2018 08:03
Prior to this commit, we'd respond with tx data for anything in mapRelay,
regardless of whether the requesting peer was one that we'd sent an INV to
for the transaction in question.

Close this privacy leak by maintaining a set of peers to which we've
relayed each transaction in mapRelay.
If we announce a transaction T to a peer, then we should also be willing to
provide T's parents to that peer (in case our peer is missing those parents).
This should improve propagation of transaction chains.
@DrahtBot
Copy link
Contributor

DrahtBot commented Sep 25, 2018

Reviewers, 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.

def on_getheaders(self, message): pass
def on_headers(self, message): pass
def on_mempool(self, message): pass
def on_notfound(self, message): pass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not used? :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, makes sense!

Copy link
Contributor

@jamesob jamesob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 6b66180

For future reviewers: the INV for missing parents (which we currently expect may not be answered if relay interval on the remote node has lapsed) happens here:

bitcoin/src/net_processing.cpp

Lines 2303 to 2309 in d799efe

if (!fRejectedParents) {
uint32_t nFetchFlags = GetFetchFlags(pfrom);
for (const CTxIn& txin : tx.vin) {
CInv _inv(MSG_TX | nFetchFlags, txin.prevout.hash);
pfrom->AddInventoryKnown(_inv);
if (!AlreadyHave(_inv)) pfrom->AskFor(_inv);
}

This PR is dependent on #14220 and probably shouldn't be merged before that.

else:
self.vec = vec

def deserialize(self, f):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use a better variable name than f? :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This maintains consistency with existing methods in similar classes (and it's a one-line usage: not considerably different from, say, a list comprehension) so I think this is fine.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I see that f is used consistently. Makes sense to follow that.

@DrahtBot
Copy link
Contributor

Needs rebase

@sdaftuar sdaftuar closed this Nov 6, 2018
@laanwj
Copy link
Member

laanwj commented Nov 6, 2018

@sdaftuar do you have any specific reason for closing?

@sdaftuar
Copy link
Member Author

sdaftuar commented Nov 6, 2018

@laanwj This builds on a PR that I closed because it needed rework, so I just didn't want to leave this open when it wasn't ready for review.

@laanwj
Copy link
Member

laanwj commented Nov 6, 2018

@sdaftuar thanks for the explanation, makes sense

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants