-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement ETH P2P #81
Conversation
crates/net/eth-wire/src/stream.rs
Outdated
struct EthStream<S> { | ||
stream: S, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could just be a new type wrapper Framed
with a EthMessage
codec.
Does making the Eth protocol a codec let us "layer" codecs together? i.e. I'd like to be able to add any extra messaging protocol on top of the ecies stream, and vice versa, i.e. be able to use an arbitrary encryption codec for my higher level messaging protocol |
77e2f06
to
7c03354
Compare
we were rlp encoding twice
This reverts commit 6e6e0a5. This does not handle framing, which would fail decoding if a partial write happened to the socket.
summarizing some notes:
|
we can instead use LengthLimitedCodec from Tokio IO, which we re-export as PassthroughCodec
1. 10MB message lengths 2. Same Genesis, Version, Chain on Status Handshake
Ref: #64
Introduces a new
EthStream
type that wraps around aStream
andSink
implementation and proceeds to RLP encode/decode messages over each line.TODO
Follow-up PRs: Rest of messages.