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!
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
andrequests.go
logics insideShardManager
, rename the manager, and move it to a standalone package. The other information likeshardPref
can be put into an upper layer as another package. Then, another packagep2pNode
with CLI, host, DHT, and the package withshardPref
andShardManager
. 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!