bounties icon indicating copy to clipboard operation
bounties copied to clipboard

Implement a sharded network connectivity structure for efficient intra/inter shard communication

Open rlan35 opened this issue 3 years ago • 8 comments

Description

Harmony is a sharded blockchain where there are 4 shards each with hundreds of nodes doing consensus in parallel. The p2p network behind Harmony is based on libp2p. The network structure now is a fully meshed network where all nodes from all shards are randomly connected with each other without the sharding structure considered. When a validator in a shard needs to broadcast a message to other validators in the same shard, the messages actually travels through all the nodes in the network. This is rather inefficient in the network usage.

Ideally, we need to have a network structure that reflect the sharding structure too where there should be more connections between nodes in the same shards and less connections across shards. When messages are meant only for nodes within a shard, the message shouldn't be broadcasted to nodes from other shards. This will greatly reduce the network cost for regular consensus within shards.

Note this is not about message routing but more about network topology on how nodes are connected. This will require changes on both the bootnode and the peer nodes.

Acceptance Criteria

  • [ ] Create a mechanism for libp2p node connection where nodes within the same shards are densely connected and nodes across shards are loosely connected.
  • [ ] Add the logic to stop propagating intra-shard messages to nodes from other shards.
  • [ ] Conduct benchmarking to compare the network traffic before and after the sharded network structure is implemented.

Reward

$10000 equivalent in ONE tokens.

rlan35 avatar Jun 16 '21 00:06 rlan35

By saying network structure, do you mean something like A Kademlia DHT? so basically we could probably assign one DHT per shard which is only for broadcasting within the shard.

renlulu avatar Jun 16 '21 20:06 renlulu

By saying network structure, do you mean something like A Kademlia DHT? so basically we could probably assign one DHT per shard which is only for broadcasting within the shard.

It's not about message routing. It's about network topology where nodes within the same shards are well connected and there is less connection between shards. This way, message broadcasting can be within a shard and doesn't have to travel through all shards.

rlan35 avatar Jun 16 '21 20:06 rlan35

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 126673.7272 ONE (10159.23 USD @ $0.08/ONE) attached to it.

gitcoinbot avatar Jun 16 '21 20:06 gitcoinbot

By saying network structure, do you mean something like A Kademlia DHT? so basically we could probably assign one DHT per shard which is only for broadcasting within the shard.

It's not about message routing. It's about network topology where nodes within the same shards are well connected and there is less connection between shards. This way, message broadcasting can be within a shard and doesn't have to travel through all shards.

Okie, thanks for your clarifying, would like to dive a bit deeper on current implementation to see if I could help on this improvement.

renlulu avatar Jun 16 '21 20:06 renlulu

noted, the network topology has to be changed with every resharding configuration. I don't see this design fit before the resharding. It has to go with the design and implementation of resharding.

LeoHChen avatar Jun 22 '21 19:06 LeoHChen

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 4 weeks from now. Please review their action plans below:

1) voanhcung has started work.

Submit A Plan

Learn more on the Gitcoin Issue Details page.

gitcoinbot avatar Jun 27 '21 01:06 gitcoinbot

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 126673.7272 ONE (14668.18 USD @ $0.12/ONE) attached to this issue has been cancelled by the bounty submitter

gitcoinbot avatar Aug 24 '21 17:08 gitcoinbot

Is this issue still open? would be very keen to start working on it

rowlanja avatar Nov 11 '21 18:11 rowlanja