8000 net/net processing: Move addr data into net_processing by jnewbery · Pull Request #21186 · bitcoin/bitcoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

net/net processing: Move addr data into net_processing #21186

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

Merged
merged 5 commits into from
May 24, 2021

Conversation

jnewbery
Copy link
Contributor
@jnewbery jnewbery commented Feb 15, 2021

This continues the work of moving application layer data into net_processing, by moving all addr data into the new Peer object added in #19607.

For motivation, see #19398.

@DrahtBot
Copy link
Contributor
DrahtBot commented Feb 18, 2021

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

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.

maflcko pushed a commit that referenced this pull request Feb 19, 2021
…sing

3e68efa [net] Move checks from GetLocalAddrForPeer to caller (John Newbery)
d21d2b2 [net] Change AdvertiseLocal to GetLocalAddrForPeer (John Newbery)

Pull request description:

  This is the first part of #21186. It slightly disentangles addr handling in net/net_processing by making it explicit that net_processing is responsible for pushing addr records into `vAddrToSend`.

ACKs for top commit:
  MarcoFalke:
    re-ACK 3e68efa 🍅

Tree-SHA512: 9af50c41f5a977e2e277f24a589db38e2980b353401def5e74b108ac5f493d9b5d6b1b8bf15323a4d66321495f04bc271450fcef7aa7d1c095f051a4f8e9b15f
@jnewbery jnewbery force-pushed the 2020-02-addr-in-peer branch from 53177dd to 79ac127 Compare February 19, 2021 13:12
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Feb 19, 2021
…_processing

3e68efa [net] Move checks from GetLocalAddrForPeer to caller (John Newbery)
d21d2b2 [net] Change AdvertiseLocal to GetLocalAddrForPeer (John Newbery)

Pull request description:

  This is the first part of bitcoin#21186. It slightly disentangles addr handling in net/net_processing by making it explicit that net_processing is responsible for pushing addr records into `vAddrToSend`.

ACKs for top commit:
  MarcoFalke:
    re-ACK 3e68efa 🍅

Tree-SHA512: 9af50c41f5a977e2e277f24a589db38e2980b353401def5e74b108ac5f493d9b5d6b1b8bf15323a4d66321495f04bc271450fcef7aa7d1c095f051a4f8e9b15f
@jnewbery jnewbery force-pushed the 2020-02-addr-in-peer branch from 79ac127 to 2315628 Compare March 6, 2021 14:36
@jnewbery jnewbery changed the title Net/Net Processing: Move addr data into net_processing net/net processing: Move addr data into net_processing Mar 30, 2021
@jnewbery jnewbery force-pushed the 2020-02-addr-in-peer branch from 2315628 to 468db14 Compare April 1, 2021 08:10
@jnewbery
Copy link
Contributor Author
jnewbery commented Apr 1, 2021

#21236 is merged. Moving this out of draft.

@jnewbery jnewbery marked this pull request as ready for review April 1, 2021 08:10
@hebasto
< 8000 path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"> Copy link
Member
hebasto commented Apr 2, 2021

Concept ACK.

@jnewbery
Copy link
Contributor Author

Thank you for the careful review @mzumsande. You caught two rebase errors 😳

I've fixed those and addressed your other comment. I've also made some minor edits to comments to clarify concepts, and also re-reviewed everything to make sure no other errors have crept in.

Copy link
Contributor
@ajtowns ajtowns left a comment

Choose a reason for hiding this comment

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

The "Move addr relay data and logic into net processing" commit is doing a lot of things, and I think that makes it a bit hard to review (and leads to rebase errors?). Might be worth putting a bit of effort into splitting it up further if some of the changes can be isolated?

8000

Copy link
Contributor
@amitiuttarwar amitiuttarwar left a comment

Choose a reason for hiding this comment

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

started reviewing, looks good so far, will be awesome to have addr handling in net processing :)

-BEGIN VERIFY SCRIPT-
ren() { sed -i "s:\<$1\>:$2:g" $(git grep -l "\<$1\>" ./src ./test); }

ren fGetAddr     m_getaddr_sent
ren fSentAddr    m_getaddr_recvd
ren vAddrToSend  m_addrs_to_send
-END VERIFY SCRIPT-
@jnewbery jnewbery force-pushed the 2020-02-addr-in-peer branch from 0a7e2ff to 0829516 Compare April 30, 2021 10:29
@jnewbery
Copy link
Contributor Author

Thanks for the reviews @ajtowns and @amitiuttarwar. I've addressed all of your comments.

The "Move addr relay data and logic into net processing" commit is doing a lot of things, and I think that makes it a bit hard to review (and leads to rebase errors?). Might be worth putting a bit of effort into splitting it up further if some of the changes can be isolated?

I did try that at one point, but it seemed more confusing/difficult than just moving across the addr data/logic in one commit.

@practicalswift
Copy link
Contributor

Concept ACK

@DrahtBot
Copy link
Contributor
DrahtBot commented May 3, 2021

🕵️ @sipa has been requested to review this pull request as specified in the REVIEWERS file.

@laanwj
Copy link
Member
laanwj commented May 19, 2021

Code review ACK 0829516

@jonatack
Copy link
Member

Concept ACK

@mzumsande
Copy link
Contributor

ACK 0829516, reviewed the code and ran tests.

Copy link
Member
@sipa sipa left a comment

Choose a reason for hiding this comment

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

utACK 0829516

PeerRef peer = std::make_shared<Peer>(nodeid);
// Addr relay is disabled for outbound block-relay-only peers to
// prevent adversaries from inferring these links from addr traffic.
PeerRef peer = std::make_shared<Peer>(nodeid, /* addr_relay = */ !pnode->IsBlockOnlyConn());
Copy link
Member

Choose a reason for hiding this comment

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

Using !IsBlockOnlyConn() as proxy for "should we relay addresses" goes a bit in the opposite direction as the earlier connection types refactors went in. Any reason not just keep the function name (I realize there's a derived one with that name added, but it's ultimately still relying on this test.

I don't have a particularly strong opinion here; I'm just noticing some flipflopping.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This logic of checking IsBlockOnlyConn() is used only when calling the Peer ctor. After that, we use the RelayAddrsWithPeer(), which replaces the old RelayAddrsWithConn() function. That's a clearer separation between net and net_processing since we only check the connection type when initializing the Peer object.

Copy link
Member
@hebasto hebasto left a comment

Choose a reason for hiding this comment

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

re-ACK 0829516

@fanquake fanquake merged commit d3fa42c into bitcoin:master May 24, 2021
@jnewbery jnewbery deleted the 2020-02-addr-in-peer branch May 24, 2021 12:30
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request May 25, 2021
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jan 28, 2022
…yAddress()

Summary:
This is a backport of [[bitcoin/bitcoin#21186 | core#21186]] [1/5]
bitcoin/bitcoin@86acc96

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10927
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jan 28, 2022
…Impl

Summary:
This is a backport of [[bitcoin/bitcoin#21186 | core#21186]] [2/5]
bitcoin/bitcoin@caba7ae

Depends on D10927

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10928
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jan 28, 2022
Summary:
This is a backport of [[bitcoin/bitcoin#21186 | core#21186]] [3/5]
bitcoin/bitcoin@76568a3

Depends on D10928

Test Plan:
`ninja all check-all`
`ninja bitcoin-fuzzers`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10929
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jan 28, 2022
Summary:
```
-BEGIN VERIFY SCRIPT-
ren() { sed -i "s:\<$1\>:$2:g" $(git grep -l "\<$1\>" ./src ./test); }

ren fGetAddr     m_getaddr_sent
ren fSentAddr    m_getaddr_recvd
ren vAddrToSend  m_addrs_to_send
-END VERIFY SCRIPT-
```
This is a backport of [[bitcoin/bitcoin#21186 | core#21186]] [4/5]
bitcoin/bitcoin@09cc66c

Depends on D10929

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10930
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jan 28, 2022
Summary:
This is a backport of [[bitcoin/bitcoin#21186 | core#21186]] [5/5]
bitcoin/bitcoin@0829516

Depends on D10930

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10931
gwillen pushed a commit to ElementsProject/elements that referenced this pull request Jun 1, 2022
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
5BFF
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0