Make eth protocol handler stateful in network #13955
Labels
A-devp2p
Related to the Ethereum P2P protocol
A-networking
Related to networking in general
A-sdk
Related to reth's use as a library
C-enhancement
New feature or request
D-complex
Quite challenging from either a design or technical perspective Ask for help!
Describe the feature
rn the eth handler used by peer connections are fixed to the default eth protocol spec:
reth/crates/net/eth-wire-types/src/message.rs
Line 174 in b97d9b4
this means that, while the types are configurable, the actual message variants are not.
the network impl itself is only concerned with bodies,headers,transaction messages
reth/crates/net/network/src/message.rs
Lines 42 to 62 in b97d9b4
we assume this will still be the case, but we'd like to make connection handling configurable:
reth/crates/net/network/src/session/mod.rs
Lines 907 to 935 in b97d9b4
meaning we'd like to support a custom p2pstream type:
reth/crates/net/network/src/session/mod.rs
Lines 990 to 991 in b97d9b4
this can be implemented similarly to what we already do with additional rlpx protocol handlers:
reth/crates/net/network/src/session/mod.rs
Lines 110 to 111 in b97d9b4
so some type that knows:
reth/crates/net/network/src/session/active.rs
Lines 70 to 71 in b97d9b4
This is a significant change and should be done in multiple steps
First we should introduce a stateful authenticator style type that knows how to establish incoming and outgoing connections (still restricted to the default eth types)
Afterwards we can slow relax the
EthMessage
locking and make it possible to configure a modified eth protocol for example.Additional context
No response
The text was updated successfully, but these errors were encountered: