CESSProject / cess

An implementation of the distributed storage network supported by CESS LAB.
https://www.cess.cloud/
Apache License 2.0
297 stars 100 forks source link

Storage network transport optimization: use HTTP protocol instead of P2P protocol #400

Open 0xbillw opened 2 months ago

0xbillw commented 2 months ago

Existing Problems

Currently, CESS's storage network protocol stack uses 'libp2p', but the main business scenarios have not increased efficiency due to the use of 'libp2p'. For example, the transmission of file data blocks is designed in such a way that data is transferred only between two nodes, not shared with other nodes to create a BitTorrent-like effect that accelerates transmission. In addition, due to the use of the address discovery, reporting, and subscription features of 'libp2p', additional traffic will be generated for storing miners. These functions are unnecessary in the current design, as the meta-information of the storage miners can be obtained on-chain.

Proposed Solution

  1. Remove the libp2p library;
  2. Remove the 'bootnode' service of the storage network, and directly report the address information of the storage miners to the chain;
  3. Replace the data block transmission with other protocols, such as the simple HTTP protocol;

Remaining Issues

  1. There is a risk of exposing the addresses of storage miners. One of the initial reasons for using libp2p was the belief that exposing only the PeerId of storage miners on-chain would be beneficial for their security. While this approach means we cannot directly obtain the addresses of storage miners, it does not meet the requirements for address security. As long as an attacker can establish a connection with a storage miner, they can still obtain their address. If the need to conceal the addresses of storage miners is reasonable and strong, this should be considered at another level. For example: address encryption, using privacy networks like I2P or TOR.

Repositories or Modules That May Be Involved

Tasklist

democ98 commented 2 months ago

CESS faucet also rely cess-go-sdk,if there are any function change like doing transaction or event listening which faucet related,pls let me know