chore(node/net): integrate the network driver inside the network actor#2376
chore(node/net): integrate the network driver inside the network actor#2376
Conversation
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| /// The frequency at which to inspect peer scores to ban poorly performing peers. | ||
| pub(super) const PEER_SCORE_INSPECT_FREQUENCY: Duration = Duration::from_secs(1); |
There was a problem hiding this comment.
Should this be configurable too?
There was a problem hiding this comment.
Can open an issue for it, I think we can configure it indeed!
There was a problem hiding this comment.
Oh actually it is already defined as a static constant here
kona/crates/node/p2p/src/gossip/config.rs
Lines 54 to 56 in 489b377
There was a problem hiding this comment.
How about we keep it constant for now then?
refcell
left a comment
There was a problem hiding this comment.
I'm happy with this. Will make it easier to split up kona-p2p into separate discovery and gossip crates, so I'm a proponent.
I think there's a few small things remaining that could be cleaned up. Otherwise nice work!
d7ba76d to
489b377
Compare
489b377 to
cc09150
Compare
cc09150 to
3a2c987
Compare
) ## Description Rewire the sequencer unsafe payload sender from the engine to the network. Previously, the sequencer was sending the unsafe blocks it received from the network `BuildTask` back to the network to call `InsertUnsafeTask`. Since the `BuildTask` inserts the newly built payloads to the engine state (like what the `InsertUnsafeTask` would do), this resulted in a no-op. Instead, the sequencer should send the payloads to the network to gossip them to the p2p mesh. ## Misc Close #2244 Built on top of #2376
op-rs/kona#2376) ## Description This PR refactors the network driver and moves it inside the network actor. This reduces the levels of indirection and allow the network actor to comply more with the new builder refactor of the node services by avoiding to define channels inside the driver. Changes: - Removes the `net` module inside `kona-p2p`. Moves the relevant files to the `kona-node-services` crate. - Removes the `broadcast` module inside the network actor. This can now be directly handled using a mpsc channel inside the network actor to implement the notion of queue. Outer interactions with the network actor happen through the `NetworkActor` context (see for instance op-rs/kona@main...theo/send-payloads-to-network#diff-b4e04fd02334c1ae45e956ad21312e81efacba5a7c1d477b176711dbae458c32R87-R126 or op-rs/kona@main...theo/send-payloads-to-network#diff-00c31e9f9de711af31ebbd3b81f610ea12ea100a6a8d0db6a2ef86f52f298849L80-R75) - Divides the network actor module with the following pattern to propagate the lower level abstractions (resp `Discv5Driver`/`Discv5Handler`/`GossipDriver`): ``` NodeBuilder ->build NodeDriver ->(async) start NodeHandler ``` Close op-rs/kona#2365
…-rs/kona#2378) ## Description Rewire the sequencer unsafe payload sender from the engine to the network. Previously, the sequencer was sending the unsafe blocks it received from the network `BuildTask` back to the network to call `InsertUnsafeTask`. Since the `BuildTask` inserts the newly built payloads to the engine state (like what the `InsertUnsafeTask` would do), this resulted in a no-op. Instead, the sequencer should send the payloads to the network to gossip them to the p2p mesh. ## Misc Close op-rs/kona#2244 Built on top of op-rs/kona#2376
op-rs/kona#2376) ## Description This PR refactors the network driver and moves it inside the network actor. This reduces the levels of indirection and allow the network actor to comply more with the new builder refactor of the node services by avoiding to define channels inside the driver. Changes: - Removes the `net` module inside `kona-p2p`. Moves the relevant files to the `kona-node-services` crate. - Removes the `broadcast` module inside the network actor. This can now be directly handled using a mpsc channel inside the network actor to implement the notion of queue. Outer interactions with the network actor happen through the `NetworkActor` context (see for instance op-rs/kona@main...theo/send-payloads-to-network#diff-b4e04fd02334c1ae45e956ad21312e81efacba5a7c1d477b176711dbae458c32R87-R126 or op-rs/kona@main...theo/send-payloads-to-network#diff-00c31e9f9de711af31ebbd3b81f610ea12ea100a6a8d0db6a2ef86f52f298849L80-R75) - Divides the network actor module with the following pattern to propagate the lower level abstractions (resp `Discv5Driver`/`Discv5Handler`/`GossipDriver`): ``` NodeBuilder ->build NodeDriver ->(async) start NodeHandler ``` Close #2365
Description
This PR refactors the network driver and moves it inside the network actor. This reduces the levels of indirection and allow the network actor to comply more with the new builder refactor of the node services by avoiding to define channels inside the driver.
Changes:
netmodule insidekona-p2p. Moves the relevant files to thekona-node-servicescrate.broadcastmodule inside the network actor. This can now be directly handled using a mpsc channel inside the network actor to implement the notion of queue. Outer interactions with the network actor happen through theNetworkActorcontext (see for instance main...theo/send-payloads-to-network#diff-b4e04fd02334c1ae45e956ad21312e81efacba5a7c1d477b176711dbae458c32R87-R126 or main...theo/send-payloads-to-network#diff-00c31e9f9de711af31ebbd3b81f610ea12ea100a6a8d0db6a2ef86f52f298849L80-R75)Discv5Driver/Discv5Handler/GossipDriver):Close #2365