Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Update a config of gossipsub based on Lisk network needs #18

Open
matjazv opened this issue Nov 18, 2022 · 1 comment
Open

Update a config of gossipsub based on Lisk network needs #18

matjazv opened this issue Nov 18, 2022 · 1 comment

Comments

@matjazv
Copy link
Contributor

matjazv commented Nov 18, 2022

Description

A libp2p and gossipsub have an extensive list of parameters to set. They need to be set in a way that they will best fit for the Lisk network.

  • Perform a different measurements to be able to tweak gossipsub parameters for best possible network performance and usage.
  • Implement/update unittest.

Acceptance Criteria

  • All new code is unit tested.

Additional Information

  • Change parameters together with a Research team to guarantee safety, reliability and usability.
shuse2 pushed a commit that referenced this issue Dec 19, 2022
### What was the problem?

- This PR resolves #12.

### How was it solved?

- `AutoNAT` feature is implemented (peer tries to detect if it has
public IP or is inside a private network without public IP).
- `Circuit-relay` feature is implemented (peer offers a circuit relay
service to other peers so that peers behind NAT can be called by other
peers in the network).
- `holepunching` feature is implemented (If a peer which calls another
peer via its relayer address has a public IP, then called peer drops
this connection and directly call peer by its public IP address and they
can communicate directly without any relayer peer inbetween. If both
peers are behind NAT then `holepunching` is executed and if it is
successfully performed, peers can communicate directly between each
other without a relayer peer in between.).

### How was it tested?

- New unit tests were implemented.
- Existing and new unit tests passed.

### Note

**All configuration options have default values from `libp2p` library.
In issue #18 we might change them.**

Logs for `holepunching` feature execution:

- A peer which called another peer via relayer node has a public IP
address (no `holepunching` is needed):
```
2022-12-14T11:30:45.526+0100    DEBUG   p2p-holepunch   holepunch/svc.go:95     waiting until we have at least one public addresspeer12D3KooWByJ2D6Rv7oe8oUAYTYARiszCAXWUgqkxNp1KbJTqL67E
2022-12-14T11:30:45.776+0100    DEBUG   p2p-holepunch   holepunch/svc.go:107    Host now has a public address. Starting holepunch protocol.
2022-12-14T11:32:07.240+0100    DEBUG   p2p-holepunch   holepunch/holepuncher.go:126    direct connection to peer successful, no need for a hole punch  {"peer": "12D3KooWNfXwDY2xjCF3BJDZniqKRHDZZNQMuVC3gQ1sYzVHvAVx"}
```

- Both peers are behind NAT so `holepunching` is needed:
```
2022-12-14T11:36:31.526+0100    DEBUG   p2p-holepunch   holepunch/svc.go:95     waiting until we have at least one public addresspeer12D3KooWByJ2D6Rv7oe8oUAYTYARiszCAXWUgqkxNp1KbJTqL67E
2022-12-14T11:36:32.776+0100    DEBUG   p2p-holepunch   holepunch/svc.go:107    Host now has a public address. Starting holepunch protocol.
2022-12-14T11:36:33.467+0100    DEBUG   p2p-holepunch   holepunch/holepuncher.go:131    got inbound proxy conn  {"peer": "12D3KooWC9T9yjhAzhjJg48yTosrGxUvTPLm2mtimGZqxeCCdy99"}
2022-12-14T11:36:33.669+0100    DEBUG   p2p-holepunch   holepunch/holepuncher.go:142    peer RTT is 201.757382ms; starting hole punch in 100.878691ms
2022-12-14T11:36:34.066+0100    DEBUG   p2p-holepunch   holepunch/util.go:68    hole punch successful   {"peer": "12D3KooWC9T9yjhAzhjJg48yTosrGxUvTPLm2mtimGZqxeCCdy99"}
2022-12-14T11:36:34.066+0100    DEBUG   p2p-holepunch   holepunch/holepuncher.go:159    hole punching with successful   {"peer": "12D3KooWC9T9yjhAzhjJg48yTosrGxUvTPLm2mtimGZqxeCCdy99", "time": 0.296361071}
```
@Madhulearn Madhulearn added this to the Sprint 9 milestone Mar 14, 2023
@Madhulearn Madhulearn modified the milestones: Sprint 9, Sprint 10 Mar 27, 2023
@hrmhatef hrmhatef self-assigned this Mar 30, 2023
@Madhulearn Madhulearn modified the milestones: Sprint 10, Sprint 11 Apr 12, 2023
@hrmhatef
Copy link
Contributor

The following tables describe the number of nodes for each execution of the testplan on an iMac 24-inch, M1, 2021(8-8) with 16GB RAM:

All values for config parameters are based on composition.toml values.

ID Total nodes Publishers Attackers Lurkers Description
1 150 100 0 50 failed without any result
2 150 100 6 44 failure (publishers:97/100 attackers:0/6 lurkers:44/44 )
3 92 60 8 24 success
4 80 54 6 20 success
5 64 36 12 16 success
6 49 29 8 12 success
7 30 20 4 6 success
8 12 10 0 2 success

Builder=docker:go
Runner=local:docker

ID Total nodes Publishers Attackers Lurkers Description
1 270 160 40 70 failed without any result
2 240 160 40 40 success
3 150 90 16 44 success
4 150 90 16 44 success
5 50 30 10 10 success
6 40 16 10 14 success
7 26 20 2 14 success
8 12 10 0 2 success

Builder=exec:go
Runner=local:exec

Note: It would be better to do more execution of the testplan in the feature with different config and number of nodes.

@Madhulearn Madhulearn removed this from the Sprint 11 milestone Apr 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants