Skip to content

Commit 11dd8f8

Browse files
authored
feat(l1): add p2p context (#1794)
**Motivation** There are many shared attributes in all p2p tasks: - Local node - Signer - TCP and UDP addresses - RLPX message Broadcaster. - Kademlia table. This makes the number of arguments big in all calls, and sometimes even repeated (e.g. addresses + node). Additionally, Adding a new argument related to all, like the broadcaster, also requires adding it everywhere. **Changes** This PR adds a `Context` struct with all the mentioned common fields and uses it instead of the individual fields. There's also 2 new helpers in the `Node` struct, for udp and tcp addresses.
1 parent 95b653c commit 11dd8f8

File tree

2 files changed

+177
-181
lines changed

2 files changed

+177
-181
lines changed

0 commit comments

Comments
 (0)