Files
nanoreth/crates/net/ecies
Dan Cline 3c72a12aff feat(eth-wire): Implement p2p stream (#114)
* wip: p2pstream

* add comment for handshake timeout

* temp allow some lint violations

* ignore unused_variables

* start of ping task

 * TODO: make it compile
 * TODO: test ping/pong/disconnect state machine
 * TODO: send subprotocol messages to stream
 * TODO: encode non-hello p2p messages as snappy encoding without using
   an encoder
 * TODO: create test comparing encoder to hand-written snappy encoding
   for ping, pong, disconnect messages

* implement message handling in stream poll method

 * restricts S to be Stream+Sink for P2PStream to implement Stream
 * start of a poll-based refactor

* impl Stream and Sink for P2PStream

 * add tests
 * TODO: make stream/sink types compatible
 * TODO: handshake message ids
 * TODO: inner poll fn
 * TODO: pinger interval
 * TODO: ethstream test
 * TODO: passthrough test

* create pingers and test

* impl working timeout interval pinger

 * it should be much easier to poll for pings and detect timeouts now

* use pinger in p2p stream

 * change item produced by stream so it's compatible with EthStream
   * add note on pros/cons
 * shorten message sends in stream

* improve errors and remove redundant methods

* fix handshake

* debugging printlns

* fix encoding and decoding

 * switch to snappy formatting for non-hello p2p messages

* cargo fmt

* perform handshake in ethstream over p2pstream test

 * remove check for `Hello` messages outside of the handshake because
   `P2PStream`s should assume messages sent in the sink are subprotocol
   messages, not `p2p` messages.

* impl From<EthVersion> for CapabilityMessage

* remove printlns

* add total_message method to EthVersion

* decode Hello in handshake

 * disallow protocol versions other than v5

* Integrate snappy and implement message size limits

* document constants, move stream definition

* fix missing hello message id

* implement shared capabilities

 * todo: test shared capabilities
 * todo: determine how / when / why to support multiple capabilities
 * removes obsolete authed and offset fields

* add sink api TODOs

* remove les

 * should add protocols when necessary rather than name unsupported
   protocols

* fix snappy compression length

 * add test for p2pstream over a passthrough codec which tests that
   peers agree on a single shared capability

* fix some clippy lints
2022-11-03 00:01:54 -07:00
..