mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
* 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
37 lines
988 B
TOML
37 lines
988 B
TOML
[package]
|
|
name = "reth-eth-wire"
|
|
description = "Impements the eth/64 and eth/65 P2P protocols"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
license = "MIT OR Apache-2.0"
|
|
repository = "https://github.com/foundry-rs/reth"
|
|
readme = "README.md"
|
|
|
|
[dependencies]
|
|
bytes = { version = "1.1" }
|
|
hex = "0.4"
|
|
thiserror = "1"
|
|
|
|
# reth
|
|
reth-ecies = { path = "../ecies" }
|
|
reth-primitives = { path = "../../primitives" }
|
|
reth-rlp = { path = "../../common/rlp", features = ["alloc", "derive", "std", "ethereum-types"] }
|
|
|
|
#used for forkid
|
|
crc = "1"
|
|
maplit = "1"
|
|
tokio = { version = "1.21.2", features = ["full"] }
|
|
futures = "0.3.24"
|
|
tokio-stream = "0.1.11"
|
|
secp256k1 = { version = "0.24.0", features = ["global-context", "rand-std", "recovery"] }
|
|
tokio-util = { version = "0.7.4", features = ["io"] }
|
|
pin-project = "1.0"
|
|
pin-utils = "0.1.0"
|
|
tracing = "0.1.37"
|
|
snap = "1.0.5"
|
|
|
|
[dev-dependencies]
|
|
hex-literal = "0.3"
|
|
ethers-core = { git = "https://github.com/gakonst/ethers-rs", default-features = false }
|
|
rand = "0.8"
|