net/net processing: Move tx inventory into net_processing#21160
net/net processing: Move tx inventory into net_processing#21160fanquake merged 4 commits intobitcoin:masterfrom
Conversation
c9e92b3 to
a706cbe
Compare
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, 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. |
a706cbe to
b3b2714
Compare
b3b2714 to
4290bac
Compare
4290bac to
0164ae2
Compare
|
Rebased on master to pick up fix for interface_zmq.py in #21008. |
0164ae2 to
bbbdb04
Compare
|
Rebase resulted in silent merge conflict with 9476886. I'll fix tomorrow. |
We'll move the transaction relay data into Peer in subsequent commits, but the inbound eviction logic needs to know if the peer is relaying txs and if the peer has loaded a bloom filter. This is currently redundant information with m_tx_relay->fRelayTxes, but when m_tx_relay is moved into net_processing, then we'll need these separate fields in CNode.
Also, remove cs_main guard from m_wtxid_relay_peers and make it atomic. This should be fine since we don't need m_wtxid_relay_peers to be synchronized with m_wtxid_relay exactly at all times. After this change, RelayTransaction no longer requires cs_main.
-BEGIN VERIFY SCRIPT-
ren() { sed -i "s:\<$1\>:$2:g" $(git grep -l "\<$1\>" ./src ./test); }
ren cs_filter m_bloom_filter_mutex
ren fRelayTxes m_relay_txs
ren pfilter m_bloom_filter
ren cs_tx_inventory m_tx_inventory_mutex
ren filterInventoryKnown m_tx_inventory_known_filter
ren setInventoryTxToSend m_tx_inventory_to_send
ren fSendMempool m_send_mempool
ren nNextInvSend m_next_inv_send_time
ren minFeeFilter m_fee_filter_received
ren lastSentFeeFilter m_fee_filter_sent
-END VERIFY SCRIPT-
|
Rebased |
161eba6 to
1066d10
Compare
dergoegge
left a comment
There was a problem hiding this comment.
ACK 1066d10 - This is a good layer separation improvement with no behavior changes.
Are you still planning to address Cory's comments?
|
|
||
| /** Send a version message to a peer */ | ||
| void PushNodeVersion(CNode& pnode); | ||
| void PushNodeVersion(CNode& pnode, Peer& peer); |
There was a problem hiding this comment.
nit:
| void PushNodeVersion(CNode& pnode, Peer& peer); | |
| void PushNodeVersion(CNode& pnode, const Peer& peer); |
Or like cory suggested this could also just be a bool.
|
There are still a few outstanding review comments that could be responded to or addressed in a follow-up. Leaving this here mostly as a reminder to myself:
|
I believe I've now addressed all outstanding review comments on this PR, either here or in #24692. |
|
See also #24691 |
| } else { | ||
| stats.m_relay_txs = false; | ||
| stats.m_fee_filter_received = 0; | ||
| } |
There was a problem hiding this comment.
Moving fRelayTxes/m_relay_txs from CNodeStats to CNodeStateStats broke -netinfo (and perhaps other clients that expect this field to be non-null). Proposing a fix.
There was a problem hiding this comment.
Moving fRelayTxes/m_relay_txs from CNodeStats to CNodeStateStats broke -netinfo (and perhaps other clients that expected this field to be non-null). Proposing a fix.
Fixed in #25176.
This continues the work of moving application layer data into net_processing, by moving all tx data into the new Peer object added in #19607.
For motivation, see #19398.