ethereumjs / ethereumjs-devp2p

Project is in active development and has been moved to the EthereumJS VM monorepo.
https://github.com/ethereumjs/ethereumjs-vm/tree/master/packages/devp2p
141 stars 62 forks source link

Refactored Peer class #77

Closed holgerd77 closed 4 years ago

holgerd77 commented 4 years ago

This PR refactors the Peer class from the RLPx package.

Following changes:

Sorry if this is a bit hard to review, but this class needed some major revamp to have some fresh basis here. Tests pass and I also ran the example code on this for quite some time.

I would expect that we will find pre-existing bugs and suboptimalities on having a second look on the refactored code base. Before there was just too much "spaghetti" 😛 , especially along this central data processing code (now onSocketData).

coveralls commented 4 years ago

Coverage Status

Coverage increased (+0.002%) to 87.331% when pulling d9b8abc8529e52976b8b9d487b3ce9a9e6f482f3 on some-refactoring into d77a3f97a63003985f75585086520f228b03101b on master.

evertonfraga commented 4 years ago

I am not sure I can review this thoroughly today, as I need to gather context from the library and dive deep. Will schedule it for monday. Sounds good @holgerd77?

holgerd77 commented 4 years ago

@evertonfraga Sure, definitely, neither this here nor the forkhash PR are too pressing.

holgerd77 commented 4 years ago

If this could get a review today or tomorrow would be nice. Would like to slowly start to plan for a maintenance release on the client (for next week or so), and this (respectively a subsequent devp2p patch release) would be some part of it.