* Create UnauthedEthStream
* remove authed flag from EthStream
* encode and decode in status handshake
* update test to assert the proper status is communicated
* cargo fmt
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* 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
* feat(ifaces): modify DB GAT to have implicit bounds
https://sabrinajewson.org/blog/the-better-alternative-to-lifetime-gats\#the-better-gats
* test(ifaces): impl new trait for mock
* feat(ifaces): impl db container
we use that downstream to avoid consuming the db transactions
when committing a stage
* fix(test): explicitly define lifetime
* test: ensure can spawn
* test: pls review
* chore: lints/warnings
* feat(db): impl the new gats
* test(db): try to make real db work with gats like in stages
* test(db): make Stage trait take DBContainer
otherwise we cannot call db.commit()
gst
* feat(stages): impl new traits
* chore(db): cleanup tests
* chore: remove unused imports