ethresearch / sharding-p2p-poc

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

Make sure the access of golang maps are safe #57

Closed mhchia closed 5 years ago

mhchia commented 5 years ago

What is wrong?

Previously, peerListeningShards in ShardManager is a map and may be accessed through different goroutines, which is dangerous. It should be fixed by https://github.com/ethresearch/sharding-p2p-poc/pull/54. We should further check if there is any this kind of issue existing in our code.

How can it be fixed?

Go through the code and see if there are similar issues.

mhchia commented 5 years ago

Checked the code and no shared maps without locks in our code.