Commit Graph

19 Commits

Author SHA1 Message Date
8f9d2908ca chore: add and fix more lints, improve docs (#4765) 2023-09-25 15:46:46 +00:00
6d1e8a2ecc feat:new discovered node record event stream (#3707)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2023-07-17 09:42:28 +00:00
85085896a9 fix: encode forkid entry in struct, accept trailing fields (#3193) 2023-06-15 20:04:23 +00:00
643ee5226c chore(net): improve network service launch error diagnostic (#2068) 2023-04-01 08:20:27 +02:00
ee226fc889 feat: use dnsdisc peers for discv4 bootstrap (#1983) 2023-03-26 12:42:08 +02:00
6005ecb89a perf(net): emit all discovred nodes (#1414) 2023-02-16 21:07:27 +01:00
e3dbaf686e feat: include optional ForkId in Discovery (#863) 2023-01-13 13:30:08 +01:00
7767b216bc feat: integrate DNS discovery service (#832) 2023-01-13 10:34:13 +01:00
f5ae970e63 feat(cli): add --disable-discovery (#597)
* redo add disable_discovery cli flag

* incorporate option into discovery test

* smol touch up

* rustmft

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2022-12-30 10:56:59 +01:00
3ab6c278e8 fix(net): improve error propagation (#620)
* fix(net): improve error propagation

* refactor: unify on closed session

* add noop helpers

* add noop helpers

* test setup

* test: add dropped connection test

* rename mock --> test-utils
2022-12-29 16:05:56 +01:00
dcd3923d19 Add serde support for NodeRecord primitive type (#617)
* Add serde support to NodeRecord

* Move NodeRecord to primitives

along with NodeKey and Octets

* Reexport NodeRecord from discv4

* Move NodeKey and kad_key back to discv4::node

Also, move NodeRecord::key functionality to a helper function: discv4::node::record_key.
This avoids the discv5 dependency in the primitives crate.

* Fix NodeRecord (de)serializing

The default derive macros work with a dictionary like display.
Changed that to serde_with macros, that use Display and FromStr traits.

* Add some tests for NodeRecord (de)serializing

* Hide NodeKey struct

* Move Octets after NodeRecord

* Replace record_key with From trait

* Fix clippy error

unnecessary into()
2022-12-27 18:03:54 +01:00
635203759b feat(discv4): support eth entries (#447)
* add ENRRequest and ENRResponse messages

 * todo: encode and decode impls

* scaffold enrrequest and enrresponse msgs

* implement encodable and decodable for enr

* cargo fmt

* impl sending enr requests

* silence clippy for now

* add todos for enrrequest and response in mocks

* make payload length fold more explicit

* feat: add enr support to ping pong

* integrate enr

* add update methods

* add enr handling

* feat: add enr handling

* integrate fork id

* fix: set frontier forkid

* disable eip868 by default

* address comments

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2022-12-16 14:14:19 +02:00
43f6bb9127 feat(net): integrate discovery banlist (#442)
* feat(net): integrate discovery banlist

* fix typos
2022-12-14 19:47:11 +02:00
02be8121e0 fix(disc): also emit discovered node when buckets are full (#414) 2022-12-13 19:53:53 +02:00
7879389059 chore(net): deny unused and cleanup (#289) 2022-11-29 20:57:40 +01:00
7db61eeadb misc(net): discovery docs and renames (#268) 2022-11-26 14:46:57 +01:00
f7c6ae5858 feat(net): impl active session (#219)
* feat(net): impl active stream

* rename fields

* work on active

* feat(net): add disconnect function

* more work on active session

* feat(net): add broadcast message variants

* feat: impl session future

* misc: refactor

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-11-21 11:31:03 +01:00
f1e6639374 feat(net): authenticate sessions (#178)
* Switch stream type of ActiveSession to EthStream

 * Start `StatusBuilder` for initializing the `Status` message required
   for the handshake
 * Add `Hardfork` for `Status` default forkid
 * Add `MAINNET_GENESIS` constant

* finish `StatusBuilder`

* initialize eth streams in session

 * add status, hello, and fork filter to session manager
 * fix status builder example
 * add status and hello to network config
   * will probably remove

* removing status and hello from networkconfig

* move forkid to primitives

* change imports for forkid

* add hardfork to primitives

* remove hardfork and forkid from eth-wire

* fix remaining eth-wire forkid references

* put mainnet genesis in constants, remove NodeId

* replace NodeId with PeerId

 * the only NodeId remaining is inherited from enr
 * PeerId still needs to be documented
 * also run cargo fmt

* replace loop with iter().any()

* ignore missing docs for hardforks

* use correct PeerId for Discv4::bind example test

* document PeerId as secp256k1 public key

* cargo fmt

* temporarily allow too_many_arguments

 * the authenticate and start_pending_incoming_session methods have many
   arguments, we can reconsider the lint or fix the methods at a later
   point
2022-11-14 12:03:05 -05:00
b7cdfbf4f9 feat(net): network scaffolding (#110)
* feat(net): network scaffolding
2022-11-07 09:27:08 +01:00