-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: Support sending raw capability messages #13028
Conversation
should I update |
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.
great start
would be nice to get a test for this as well
see
reth/crates/net/eth-wire/src/ethstream.rs
Line 611 in b09c345
async fn ethstream_over_p2p() { |
crates/net/eth-wire/src/ethstream.rs
Outdated
|
||
/// Sends a raw capability message directly over the stream | ||
pub fn start_send_raw(&mut self, msg: RawCapabilityMessage) -> Result<(), EthStreamError> { | ||
self.inner.start_send_unpin(msg.payload)?; |
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.
what we need to do here instead is encode the entire msg together with the id.
see:
reth/crates/net/eth-wire-types/src/message.rs
Lines 109 to 113 in b09c345
/// Encodes the protocol message into bytes. The message type is encoded as a single byte and | |
/// prepended to the message. | |
fn encode(&self, out: &mut dyn BufMut) { | |
self.message_type.encode(out); | |
self.message.encode(out); |
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.
very nice!
should close #13005