Skip to content

Commit dbd4495

Browse files
authored
Update evn docs (#670)
1 parent feffec4 commit dbd4495

File tree

5 files changed

+91
-70
lines changed

5 files changed

+91
-70
lines changed
Lines changed: 40 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,8 @@
11
---
22
title: EVN Best Practices - BSC EVN
33
---
4-
5-
# EVN Best Practices
6-
7-
## Background
8-
9-
After [Maxwell Hardfork](https://www.bnbchain.org/en/blog/bnb-chain-announces-maxwell-hardfork-bsc-moves-to-0-75-second-block-times), the block interval will be reduced to 0.75s, which is a huge improvement in user experience for BSC, and at the same time has greater requirements for the client's network, execution and other components.
10-
11-
BSC introduced a new network layer optimization, Enhanced Validator Network, aka EVN. It is not a new P2P network, but based on the current P2P network to optimize the validator network and reduce the latency of core consensus messages as much as possible.
12-
13-
![evn topology](../../img/evn/evn-topology.png)
14-
15-
EVN only affects the networking and configuration of the validator, and does not affect other roles. At the same time, the existing network topology is similar to EVN.
16-
17-
## How EVN Works
18-
19-
The essence of EVN is to allow validators to identify each other, optimize the broadcast algorithm, and reduce the broadcast latency of core consensus messages.
20-
21-
EVN is a network layer optimized based on the current existing network topology and broadcast algorithm. It is still not perfect and will continue to be optimized and improved.
22-
23-
You can also check [BEP-563](https://github.com/bnb-chain/BEPs/blob/master/BEPs/BEP-563.md) and [BEP-564](https://github.com/bnb-chain/BEPs/blob/master/BEPs/BEP-564.md) for more details.
24-
25-
### NodeID Registration
26-
27-
The operator adds the validator’s NodeID of the P2P network on the chain through the configuration file, then the node will auto sign a registration tx.
28-
29-
It establishes the identity mapping from the consensus layer to the network layer.
30-
31-
### EVN Peer Identification
32-
33-
All validators/sentry will pull the on-chain registration information, identify whether the connected P2P Peer belongs to the NodeID of a validator, and mark it as an EVN Peer.
34-
35-
### Broadcast Optimization
36-
37-
Transaction broadcast is disabled between all EVN Peers, and mined blocks are broadcast to all connected EVN Peers. Non-mined blocks still use the old gossip broadcast mechanism.
38-
39-
### EVN Whitelist
40-
41-
This is an EVN whitelist that takes effect on this node. It will consider the whitelisted Peers to be EVN Peers as well and apply the EVN broadcast algorithm.
42-
43-
### EVN Peer Connection
44-
45-
Currently, EVN Peers are mainly connected directly through static nodes, allowing most EVN Peers to connect directly to each other.
46-
474
## Network Requirements
48-
49-
At the network layer, BSC hopes to have a low enough latency so that most of the time can be used for core processes such as block packaging and block verification. The entire BSC network is relatively decentralized and is distributed in different geographic locations.
5+
At the network layer, BSC requires minimal latency to maximize time available for critical operations like block packaging and verification. The BSC network maintains decentralization through validators distributed across diverse geographic locations worldwide.
506

517
Taking AWS's network service as an example, the measured latency of some regions are:
528
- AP<->EU, latency ~100ms
@@ -56,12 +12,12 @@ Taking AWS's network service as an example, the measured latency of some regions
5612
This data will be the theoretical best value of network message latency, and it is also the reference value for network environment testing between validators.
5713

5814
## Configuration
15+
There are two different modes to configure your node, depends on how your validator is connected to the network.
16+
### Mode-1: Sentry Mode
5917

60-
### Sentry Mode
61-
62-
![evn sentry mode](../../img/evn/evn-sentry-mode.png)
18+
![evn sentry mode](../../img/evn/evn-sentry-mode.png){:style="width:500px; height:auto;"}
6319

64-
In this mode, the operator needs to create multiple nodes, including multiple validator nodes, multiple sentry nodes, and fullnode nodes.
20+
In this mode, the operator could create multiple nodes, including multiple validator nodes, multiple sentry nodes, and fullnode nodes.
6521

6622
The validator always remains in a secure intranet environment. Sentry is responsible for quickly exchanging messages with EVN Peer and forwarding them to the validator. Fullnode is a redundant path for additional transactions and other messages.
6723

@@ -80,7 +36,12 @@ EnableEVNFeatures = true
8036
EnableQuickBlockFetching = true
8137

8238
[Node.P2P]
83-
StaticNodes = ["ValidatorEnodes", "FullnodeEnodes", "SentryEnodes"]
39+
StaticNodes = [
40+
"<OtherValidatorEnodes>",
41+
"<FullnodeEnodes>",
42+
"<SentryEnodes>",
43+
"..."
44+
]
8445
```
8546

8647
`EVNNodeIDsToAdd` fills in the sentry nodeID here. Because the validator is protected in the external network, sentry will act as an EVN Peer to help forward public EVN Peer messages.
@@ -99,34 +60,52 @@ EnableEVNFeatures = true
9960
EnableQuickBlockFetching = true
10061

10162
[Node.P2P]
102-
EVNNodeIdsWhitelist = ["ValidatorNodeIDs", "PublicEVNPeerNodeIDs", "BuilderNodeIDs"]
103-
ProxyedValidatorAddresses = ["ValidatorAdresses"]
104-
StaticNodes = ["ValidatorEnodes", "FullnodeEnodes", "SentryEnodes", "PublicEVNPeerEnodes", "PublicFullnodeEnodes"]
63+
EVNNodeIdsWhitelist = ["<whitelist nodeids>"]
64+
ProxyedValidatorAddresses = ["<ValidatorAdresses>"]
65+
StaticNodes = [
66+
"enode://3dd9e7e22180cda7c2a7015d3582811327abb3bc5f330879be7bc3217be4ed7c4ec0d5117ab0fae6542d3e5d199f3d935b7bca108b565f07806ed7687af8d1b5@52.198.165.142:30311",
67+
"enode://70aeb4f0cc52df44f4ef0c72ca0eca8a210b9916ad02bcd147cc58bbfee9259ee46dfa23e13512f98bdb3937d62d2d0a521a90c76161ccffd24bb10829d8d542@13.112.162.162:30311",
68+
"enode://4af65e07b676e3634e4e2e6df01b23e32eb73fdc200b7f98a4807b16e8faefae4d3875bea4d88e203e319f6a61859b66c0b8254191a2058629a00fe6e42e7b18@54.155.24.228:30311",
69+
"enode://2a6cfdbfc8f401d09a766efa53411bb5457fd5903331afee5363017f65623f0c0c43873c14bfb4001cf02811b1196f710bb3911a36e683cb557b11244cffe212@54.77.55.214:30311",
70+
"enode://cc6d828a735db591cb2a0454a94b9602be6c0aca6c73f771efaabc7f68c46085b953c97f880efb17597578320444acc9e207042297689515c18e659d138bb393@23.23.111.240:30311",
71+
"enode://5035ae74e04b4290885c3cea546ca179cb80c1461141b8c3124bb6707993c1e68dafd2f5fd9b13a8d076225412bf5bbefe81c16aa812a35e7c19bb1020b8c124@34.205.243.82:30311",
72+
"<other trusted nodeids>"
73+
]
10574
```
10675

107-
`EVNNodeIdsWhitelist` is an EVN Peer whitelist that is only valid for the current node. In the transition period before enabling maxwell, the whitelist can be used to apply EVN in advance. At the same time, the operator can put the cooperating builder into the local whitelist.
76+
`EVNNodeIdsWhitelist`: it is optional and is an EVN Peer whitelist that is only valid for the current node. In the transition period before enabling maxwell, the whitelist can be used to apply EVN in advance. At the same time, the operator can put the cooperating builder into the local whitelist.
77+
78+
`ProxyedValidatorAddresses`: it is optional and is only for sentry to identify which blocks should be broadcast to all EVN Peers, it is configured as the protected validator address.
10879

109-
`ProxyedValidatorAddresses` This configuration is only for sentry. In order to let sentry identify which blocks should be broadcast to all EVN Peers, it is configured as the protected validator address.
80+
`StaticNodes`: it includes a list of well maintained EVN nodes for validators to connect to, the list could be changed in the future.
11081

111-
### Simple Mode
82+
### Mode-2: Simple Mode
11283

113-
![evn simple mode](../../img/evn/evn-simple-mode.png)
84+
![evn simple mode](../../img/evn/evn-simple-mode.png){:style="width:500px; height:auto;"}
11485

115-
In the current mode, the operator needs to build multiple validator nodes and expose them directly to the public network environment, so that they can directly connect to other nodes.
86+
With simple mode, the operator could run a validator node by exposing it directly to the public network environment, so that they can directly connect to other nodes.
11687

11788
#### Validator Configuration
11889

11990
The example of `Config.toml`.
12091

12192
```toml
12293
[Eth]
123-
EVNNodeIDsToAdd = ["validatorNodeID1", "validatorNodeID2"]
94+
EVNNodeIDsToAdd = ["validator NodeID", "other nodeids"]
12495

12596
[Node]
12697
EnableEVNFeatures = true
12798
EnableQuickBlockFetching = true
12899

129100
[Node.P2P]
130-
EVNNodeIdsWhitelist = ["ValidatorNodeIDs", "PublicEVNPeerNodeIDs", "BuilderNodeIDs"]
131-
StaticNodes = ["ValidatorEnodes", "FullnodeEnodes", "PublicEVNPeerEnodes", "PublicFullnodeEnodes"]
101+
EVNNodeIdsWhitelist = ["<whitelist nodeids>"]
102+
StaticNodes = [
103+
"enode://3dd9e7e22180cda7c2a7015d3582811327abb3bc5f330879be7bc3217be4ed7c4ec0d5117ab0fae6542d3e5d199f3d935b7bca108b565f07806ed7687af8d1b5@52.198.165.142:30311",
104+
"enode://70aeb4f0cc52df44f4ef0c72ca0eca8a210b9916ad02bcd147cc58bbfee9259ee46dfa23e13512f98bdb3937d62d2d0a521a90c76161ccffd24bb10829d8d542@13.112.162.162:30311",
105+
"enode://4af65e07b676e3634e4e2e6df01b23e32eb73fdc200b7f98a4807b16e8faefae4d3875bea4d88e203e319f6a61859b66c0b8254191a2058629a00fe6e42e7b18@54.155.24.228:30311",
106+
"enode://2a6cfdbfc8f401d09a766efa53411bb5457fd5903331afee5363017f65623f0c0c43873c14bfb4001cf02811b1196f710bb3911a36e683cb557b11244cffe212@54.77.55.214:30311",
107+
"enode://cc6d828a735db591cb2a0454a94b9602be6c0aca6c73f771efaabc7f68c46085b953c97f880efb17597578320444acc9e207042297689515c18e659d138bb393@23.23.111.240:30311",
108+
"enode://5035ae74e04b4290885c3cea546ca179cb80c1461141b8c3124bb6707993c1e68dafd2f5fd9b13a8d076225412bf5bbefe81c16aa812a35e7c19bb1020b8c124@34.205.243.82:30311",
109+
"<other trusted nodeids>"
110+
]
132111
```

docs/bnb-smart-chain/validator/evn/faqs.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@ title: FAQs - BSC EVN
44

55
# FAQs
66

7-
### How to get node’s NodeID?
7+
### Q1: How to get node’s NodeID?
88

9-
you can use the following command to query your enode information.
10-
```bash
11-
./bsc --exec "admin.nodeInfo.id" attach ./geth.ipc
12-
```
9+
you can use the following command to query your enode information.
10+
```bash
11+
./bsc --exec "admin.nodeInfo.id" attach ./geth.ipc
12+
```
1313

14-
### Can multiple validators share sentry nodes?
14+
### Q2: Can multiple validators share sentry nodes?
1515

16-
Yes, for service providers who act as agents for multiple validators, they can use fewer sentries to achieve the same function. It is worth noting that the combination of validators and sentry is best to be in the same region machine.
16+
Yes, for service providers who act as agents for multiple validators, they can use fewer sentries to achieve the same function. It is worth noting that the combination of validators and sentry is best to be in the same region machine.
1717

18-
### Can a validator use multiple sentry nodes?
18+
### Q3: Can a validator use multiple sentry nodes?
1919

20-
Of course, multiple sentries improve redundancy and reduce message delays caused by single sentry failures. It is also recommended that validators connect to multiple fullnodes and other P2P nodes to receive more transactions and improve message redundancy.
20+
Of course, multiple sentries improve redundancy and reduce message delays caused by single sentry failures. It is also recommended that validators connect to multiple fullnodes and other P2P nodes to receive more transactions and improve message redundancy.
21+
22+
### Q4: How to register other key ecosystem player into EVN network
23+
As only validator can register evn nodeid, so they can ask validator's help to register for them. It could be useful for some key users like mev-builders, infra providers... But there is a limitation on the number of evn nodeids that each validator can register, by default it is 5, but it can be changed by governance.
File renamed without changes.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: Overview - BSC EVN
3+
---
4+
## Background
5+
6+
After [Maxwell Hardfork](https://www.bnbchain.org/en/blog/bnb-chain-announces-maxwell-hardfork-bsc-moves-to-0-75-second-block-times), the block interval has be reduced to 0.75s, which is a huge improvement in user experience for BSC, and at the same time has greater performance requirements for the client's network, execution and other components.
7+
8+
BSC introduced a new network layer optimization, Enhanced Validator Network, aka EVN. It is not a new P2P network, but based on the current P2P network to optimize the validator network and reduce the latency of core consensus messages as much as possible. You can also check [BEP-563](https://github.com/bnb-chain/BEPs/blob/master/BEPs/BEP-563.md) and [BEP-564](https://github.com/bnb-chain/BEPs/blob/master/BEPs/BEP-564.md) for more details.
9+
10+
![evn topology](../../img/evn/evn-topology.png){:style="width:450px; height:auto; display: block; margin: 0 auto;"}
11+
12+
## How EVN Works
13+
14+
### NodeID Registration
15+
16+
Node operator could add the validator’s EVN NodeIDs through the configuration file(config.toml), then the node will automatically sign a registration tx to register the node id on chain.
17+
18+
It establishes the identity mapping from the consensus layer to the network layer.
19+
20+
### EVN Peer Identification
21+
22+
All validators/sentry will pull the on-chain registration information, identify whether the connected P2P Peer belongs to the NodeID of a validator, and mark it as an EVN Peer.
23+
24+
### Broadcast Optimization
25+
26+
Transaction broadcast is disabled between all EVN Peers, and mined blocks are broadcast to all connected EVN Peers. Non-mined blocks still use the old gossip broadcast mechanism.
27+
28+
### EVN Whitelist
29+
30+
This is an EVN whitelist that takes effect on this node. It will consider the whitelisted Peers to be EVN Peers as well and apply the EVN broadcast algorithm.
31+
32+
### EVN Peer Connection
33+
34+
Currently, EVN Peers are mainly connected directly through static nodes, allowing most EVN Peers to connect directly to each other.

mkdocs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ nav:
135135
- Builder Guide: ./bnb-smart-chain/validator/mev/builder-integration.md
136136
- User Guide: ./bnb-smart-chain/validator/mev/user-guide.md
137137
- FAQs: ./bnb-smart-chain/validator/mev/faqs.md
138+
- EVN:
139+
- Overview: ./bnb-smart-chain/validator/evn/overview.md
140+
- Best Practice: ./bnb-smart-chain/validator/evn/best-practice.md
141+
- Network Monitor: ./bnb-smart-chain/validator/evn/network-monitor.md
142+
- FAQs: ./bnb-smart-chain/validator/evn/faqs.md
138143
- Slashing:
139144
- Overview: ./bnb-smart-chain/slashing/overview.md
140145
- Slash Rules: ./bnb-smart-chain/slashing/slash-rules.md

0 commit comments

Comments
 (0)