-
Notifications
You must be signed in to change notification settings - Fork 27
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
refactor(p2p): implement P2PConnectionProtocol [part 9/11] #1166
base: refactor/p2p/initial-state
Are you sure you want to change the base?
refactor(p2p): implement P2PConnectionProtocol [part 9/11] #1166
Conversation
1bb16b8
to
2034c11
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## refactor/p2p/initial-state #1166 +/- ##
==============================================================
- Coverage 84.87% 84.73% -0.15%
==============================================================
Files 321 318 -3
Lines 24498 24508 +10
Branches 3728 3742 +14
==============================================================
- Hits 20792 20766 -26
- Misses 2987 3000 +13
- Partials 719 742 +23 ☔ View full report in Codecov by Sentry. |
bb266e3
to
cc3bba3
Compare
72d3563
to
f7bf2f2
Compare
b6b19b2
to
58633dc
Compare
f7bf2f2
to
c66b07d
Compare
08328b2
to
b4f9b18
Compare
@@ -340,11 +344,11 @@ def send_tx_to_peers(self, tx: BaseTransaction) -> None: | |||
connections = list(self.iter_ready_connections()) | |||
self.rng.shuffle(connections) | |||
for conn in connections: | |||
conn.send_tx_to_peer(tx) | |||
self.reactor.callLater(0, conn.send_tx_to_peer, tx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this to unblock the main loop
protocol = self._connections.get_peer_by_address(addr) | ||
self.reactor.callLater(0, protocol.disconnect, force=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this to unblock the main loop
a5399b5
to
260d851
Compare
b4f9b18
to
44e6db9
Compare
260d851
to
36da2f5
Compare
44e6db9
to
73b394a
Compare
36da2f5
to
659806b
Compare
73b394a
to
cb9f709
Compare
Depends on #1172
Motivation
Continuing with the multiprocess P2P implementation, this PR abstracts the last piece of code that binds individual P2P connections to the rest of the full node: calls from the
ConnectionsManager
toHathorProtocol
instances.It also adds the currently unimplemented
--x-multiprocess-p2p
CLI option, and removes theSyncAgentFactory
abstraction, which was only necessary for Sync-v1 but not for Sync-v2. I refactored it to remove theConnectionsManager.get_sync_factory
method, which couldn't be called through IPC.Acceptance Criteria
P2PConnectionProtocol
, abstracting calls from theConnectionsManager
to individual connections (instances ofHathorProtocol
).--x-multiprocess-p2p
CLI option (currently does nothing).SyncAgent
s to removeConnectionsManager.get_sync_factory
, also removing related classes.Checklist
master
, confirm this code is production-ready and can be included in future releases as soon as it gets merged