ethresearch / sharding-p2p-poc

Proof of Concept of Ethereum Serenity Peer-to-Peer Layer on libp2p PubSub System
40 stars 19 forks source link

Refactor the p2p layer to be more collation/message agnostic #68

Closed mhchia closed 5 years ago

mhchia commented 5 years ago

What is wrong?

Thanks to https://github.com/ethresearch/sharding-p2p-poc/pull/65, we can define message types in Python. However, there are still some collation logics in ShardManager, which make us need to modify both Go and Python sides when we want to change anything in collation.

How can it be fixed?

Move collation and other logics which are not necessary to the p2p layer, or which can be abstract to the upper layer out. Maybe we can only keep pubsub and requests.go logics inside ShardManager, rename the manager, and move it to a standalone package. The other information like shardPref can be put into an upper layer as another package. Then, another package p2pNode with CLI, host, DHT, and the package with shardPref and ShardManager. This way, we can restrict collation things to an upper layer, without affecting the actual p2p layer.

This issue is just a post for this refactor idea. Really appreciate if there is any feedback or idea!

mhchia commented 5 years ago

Obsolete