ethresearch / sharding-p2p-poc

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

Potential problems of using `partial-gx-uw.py` #46

Closed mhchia closed 5 years ago

mhchia commented 6 years ago

What is wrong?

We use script/partial-gx-uw.py to unwrite the import statement changed by gx-go rewrite, and currently, we unwrite gx/ipfs/.../opentracing-go in our repository to github.com/opentracing/opentracing-go. This is because one of our dependency ipfs/go-log depends on github.com/opentracing/opentracing-go, gx-go rw rewrites the import statements github.com/opentracing/opentracing-go to gx/ipfs/.../opentracing-go in our repository altogether. However, one of the dependencies of our repo appdash does not use gx to track the dependencies, i.e. it still uses the original import statements github.com/opentracing/opentracing-go even after gx-go rw. This introduces conflicts between the struct types in github.com/opentracing/opentracing-go and gx/ipfs/.../opentracing-go in our repository, even though they are the same types. To make them consistent, our temporary strategy is to recover all gx/ipfs/.../opentracing-go in our repository back to github.com/opentracing/opentracing-go. This approach works. But it also means part of our loaded program using gx/ipfs/.../opentracing-go, while the other part using github.com/opentracing/opentracing-go. The same two packages(possibly different code) are loaded with two different package name. It is possible that some conflicts like https://github.com/ipfs/go-log/issues/40 might occur at runtime(though I failed to poc on this).

How can it be fixed?

Turn appdash to use gx. Basically, we need to write a package.json for it, specifying its dependencies on the repositories on ipfs. And then we need to run an ipfs node to host the code, to make sure gx have access to this code anytime.

mhchia commented 5 years ago

Closed by https://github.com/ethresearch/sharding-p2p-poc/pull/121, using go mod now.