Code Monkey home page Code Monkey logo

devp2p's Introduction

devp2p's People

Contributors

frostred avatar leekt avatar sorpaas avatar vorot93 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

devp2p's Issues

Future machesim and the current implementation

Note that when poll returns NotReady, future would then require a "notifier" to wake up and poll again. This might not be aligned with the current implementation and caused the random stop issue.

Legacy is high

Properly deal with tokio's event-loop system both in DPT and RLPx to make it more responsive.

compile error

etcommon_bigint latest version 0.1.15 remove etcommon_bigint::LogsBloom, so in eth/proto.rs there is a compile error .

remove LogsBloom in proto.rs in use, compile is ok

ECIES decoder implementation incorrect

https://github.com/rust-ethereum/devp2p/blob/f00664fa84d14d217ed895ec6300f6b6b87c2937/src/ecies/proto.rs#L121

This is incorrect and causing issues in practice. The reason is returning Ok(None) tells the codec that it needs to read more bytes from the network, however it could have already read and buffered the body following the header, meaning it will just block on the socket waiting for more data which might not be coming before decoding the complete body that might already be sitting in the buffer.

https://docs.rs/tokio-util/0.5.1/tokio_util/codec/trait.Decoder.html

"If the bytes look valid, but a frame isn't fully available yet, then Ok(None) is returned. This indicates to the Framed instance that it needs to read some more bytes before calling this method again.

Note that the bytes provided may be empty. If a previous call to decode consumed all the bytes in the buffer then decode will be called again until it returns Ok(None), indicating that more bytes need to be read."

Additionally you can see in the implementation if Ok(None) is returned then the state will be toggled to not readable:

https://github.com/tokio-rs/tokio/blob/647299866a2262c8a1183adad73673e5803293ed/tokio-util/src/codec/framed_impl.rs#L144

I realize the point is to forward the state to ECIESState::Body but it can't be done like this, as decode() will not be called again after returning Ok(None). Two obvious alternatives are something like recursing into another call of decode(), or returning some kind of Item that gets ignored on the upper layer, but the first is probably the easiest (replacing Ok(None) with self.decode(buf))

Support libsecp256k1

We currently use C binding rust-secp256k1. Consider also support libsecp256k1!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.