Skip to content

Commit 7e7b841

Browse files
committed
Update PoS - Editing docs
1 parent 39c1164 commit 7e7b841

File tree

7 files changed

+407
-76
lines changed

7 files changed

+407
-76
lines changed

docs/img/pos/bad_block.png

52.1 KB
Loading

docs/img/pos/block_number.png

587 KB
Loading

docs/pos/operate-node/delegate/delegate.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The only prerequisite is to have your MATIC tokens and ETH on the Ethereum mainn
2626

2727
## Delegate to a validator
2828

29-
1. Click **Become a Delegator** or scroll down to a specific validator and click **Delegate**.
29+
1. Click "Become a Delegator" or scroll down to a specific validator and click "Delegate".
3030

3131
![img](../../../img/pos/home.png)
3232

@@ -35,30 +35,30 @@ The only prerequisite is to have your MATIC tokens and ETH on the Ethereum mainn
3535
![img](../../../img/pos/delegateB.png)
3636

3737

38-
3. Approve the delegation transaction and click **Delegate**.
38+
3. Approve the delegation transaction and click "Delegate".
3939

4040
![img](../../../img/pos/delegate2.png)
4141

4242

43-
After the delegation transaction completes, you will see the **Delegation Completed** message.
43+
After the delegation transaction completes, you will see the `Delegation Completed` message.
4444

4545
![img](../../../img/pos/delegate3.png)
4646

4747

4848
## View your delegations
4949

50-
To view your delegations, click [My Account](https://staking.polygon.technology/account).
50+
To view your delegations, click "My Account".
5151

5252
![img](../../../img/pos/myAccount.png)
5353

5454
## Withdraw rewards
5555

56-
1. Click [My Account](https://staking.polygon.technology/account).
56+
1. Click "My Account".
5757

5858
![img](../../../img/pos/click-my-account.png)
5959

6060

61-
2. Under your delegated validator, click **Withdraw Reward**.
61+
2. Under your delegated validator, click "Withdraw Rewards".
6262

6363
![img](../../../img/pos/withdraw-reward.png)
6464

@@ -67,12 +67,12 @@ This will withdraw the MATIC token rewards to your Ethereum address.
6767

6868
## Restake rewards
6969

70-
1. Click [My Account](https://staking.polygon.technology/account).
70+
1. Click "My Account".
7171

7272
![img](../../../img/pos/click-my-account.png)
7373

7474

75-
2. Under your delegated validator, click **Restake Reward**.
75+
2. Under your delegated validator, click "Restake Reward".
7676

7777
![img](../../../img/pos/restake-rewards.png)
7878

@@ -82,12 +82,12 @@ This will restake the MATIC token rewards to the validator and increase your del
8282

8383
## Unbond from a validator
8484

85-
1. Click [My Account](https://staking.polygon.technology/account).
85+
1. Click "My Account".
8686

8787
![img](../../../img/pos/click-my-account.png)
8888

8989

90-
2. Under your delegated validator, click **Unbond**.
90+
2. Under your delegated validator, click "Unbond".
9191

9292
![img](../../../img/pos/unbond-from-validator.png)
9393

@@ -110,16 +110,16 @@ This will restake the MATIC token rewards to the validator and increase your del
110110

111111
Moving stake from one node to another node is a single transaction. There are no delays or unbonding periods during this event.
112112

113-
1. Log in to the [My Account](https://staking.polygon.technology/account) on the Staking dashboard.
113+
1. Log in to the "My Account" on the Staking dashboard.
114114

115-
2. Click **Move Stake** under your delegated validator.
115+
2. Click "Move Stake" under your delegated validator.
116116

117-
3. Select an external validator and click **Stake here**.
117+
3. Select an external validator and click "Stake here".
118118

119119
![img](../../../img/pos/move.png)
120120

121121

122-
4. Provide the stake amount and click **Move Stake**.
122+
4. Provide the stake amount and click "Move Stake".
123123

124124
![img](../../../img/pos/move2.png)
125125

docs/pos/operate-node/validator/issues/reporting-issues.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11

22
## Where to report a bug
33

4-
For any bugs or attacks that are discovered, you need to report them to the [Immunefi bug bounty program](https://immunefi.com/bounty/polygon/). **Performing an attack and not providing submission of your proof will result in disqualification of your attempt.**
4+
For any bugs or attacks that are discovered, you need to report them to the [Immunefi bug bounty program](https://immunefi.com/bounty/polygon/).
55

6-
You need to make sure that you add all relevant details, such as an email address and Discord ID in order to maintain a rapport of communication in case it is required. You also need to provide as many details as possible so that the Polygon team can appropriately evaluate your submission.
6+
!!!info
7+
Performing an attack and not providing submission of your proof will result in disqualification of your attempt.
8+
9+
Make sure you add all relevant details such as your email address and Discord ID. Providing ample details creates a rapport of communication, and helps the Polygon team evaluate your submission appropriately.
710

811
## What happens after submitting a report
912

10-
Upon reporting an issue, the Polygon team will review and update / comment on the status of the issue. Upon evaluation, the Polygon team will report the outcome of the submission. The Severity will also be tagged as per the evaluation.
13+
Once an issue is reported, the Polygon team reviews it, comments, and updates on the status of the issue. After evaluation, the Polygon team reports the outcome of the submission. The severity of the issue also gets tagged as per the evaluation.
1114

1215
## Contact us for further questions
1316

14-
You can always connect with the community leaders, Anurag & Parvez, via email or tag the validator-support-team on Discord:
17+
Submitters of issues can connect with the community leaders via email or tag the validator-support-team on Discord.
1518

1619
### Via E-mail
1720

18-
* Anurag — anurag@polygon.technology
1921
* Parvez — parvez.shaikh@polygon.technology
2022

2123
### Via Discord

docs/pos/operate-node/validator/kb/known-issues.md

Lines changed: 97 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,91 @@
22
### Error: Bad block/Invalid Merkle
33

44
**Description:**
5-
A Bad Block or Invalid Merkle root error occurs when your Heimdall and Bor are not in sync with each other. Heimdall is the consensus layer for Polygon POS chain, which means that Heimdall directs Bor to create blocks accordingly. A Bad Block occurs when Bor moves ahead to create a block which has not been directed by Heimdall and hence there is an invalid hash been created, which causes the error, Bad Block, or Invalid Merkle root.
5+
A bad block or invalid Merkle root error occurs when the Heimdall and Bor layers are not in sync. Heimdall, as the consensus layer for Polygon POS chain, directs Bor to create blocks accordingly. A bad block error occurs when the Bor moves ahead to create a block which has not been directed by Heimdall. This causes an invalid hash being created, and hence results in an invalid Merkle root.
66

77
**Solution 1**:
8-
Typically a restart of the Bor service should resolve the problem. This would ensure your Bor connects with Heimdall again and start syncing and creating blocks correctly.
8+
Restart the Bor service by using the following command,
9+
```bash
10+
sudo service bor restart
11+
```
912

10-
To restart your Bor service you can use the following command, `sudo service bor restart`.
13+
Typically a restart of the Bor service should resolve the problem, and that's because restarting causes Bor to reconnect with Heimdall, start syncing, and create blocks correctly.
1114

12-
**Solution 2**:
13-
If a restart does not fix your problem, then the first thing you need to check is your Heimdall and REST server. Most of the time, your Heimdall service might have stopped which has caused the Bad block issue on Bor.
15+
If restarting the Bor service does not fix the problem, then try the next option.
1416

15-
Check the logs for your Heimdall first, `journalctl -u heimdalld -f` and check if everything is working correctly.
17+
**Solution 2**: Make the following checks.
1618

17-
Additionally, also check your REST server logs, `journalctl -u heimdalld-rest-server -f`.
19+
- Check if your Heimdall and REST servers are running.
1820

19-
If you find that any of these services are not running correctly, then please restart the above services and let them sync. Your Bor should automatically resolve the problem.
21+
The Heimdall service might have stopped, and thus causing the bad block issue on Bor.
2022

21-
**Solution 3**:
22-
If a restart of your Bor and Heimdall services don't resolve the problem, then its probably that your Bor is stuck on a block. The block number will be evident in the logs. To check your logs for Bor you can run this command, `journalctl -u bor -f`.
23+
- Check the logs for your Heimdall first,
2324

24-
The Bad block would be displayed this way in your logs:
25+
```bash
26+
journalctl -u heimdalld -f
27+
```
2528

26-
<img src={useBaseUrl("img/knowledge-base/bad_block.png")}/>
29+
- Check if everything is working correctly.
2730

28-
Once you know the Bad block number, you could roll back your Blockchain by a few hundred blocks and resync from a previous block. In order to do this, you will first need to convert the Block number to hexadecimal. You can use [this tool](https://www.rapidtables.com/convert/number/decimal-to-hex.html) for converting decimals to hexadecimals.
31+
- Additionally, check your REST server logs,
32+
33+
```bash
34+
journalctl -u heimdalld-rest-server -f
35+
```
2936

30-
Once you have your Hexadecimal ready, you can run the following commands;
37+
- Restart the services not running.
38+
39+
This should cause Bor to automatically resolve the problem
40+
41+
42+
If restarting both the Bor and Heimdall services doesn't solve the problem, it could be that Bor is stuck on some block.
43+
44+
**Solution 3**: Check the bad block in logs for Bor.
45+
46+
- Check Bor logs with this command
47+
```bash
48+
journalctl -u bor -f
49+
```
50+
51+
The bad block is typically displayed in the logs as shown in the below figure:
52+
53+
![Figure: Bad block](../../../../img/pos/bad_block.png)
54+
55+
- Note the bad block number.
56+
- Convert the block number to a hexadecimal number.
57+
58+
!!!info
59+
60+
Use this [tool](https://www.rapidtables.com/convert/number/decimal-to-hex.html) to convert the block number to a hexadecimal number.
61+
62+
63+
- Roll back the Blockchain by a few hundred blocks. That is, set Bor at the right block height, with the `debug.setHead()` function. Use the following command
3164
3265
```bash
33-
bor attach ./.bor/data/bor.ipc
34-
> debug.setHead("0xE92570")
66+
bor attach ./.bor/data/bor.ipc
67+
> debug.setHead("0xE92570")
3568
```
3669
37-
`debug.setHead()` is the function that will allow your Bor to set the tip at a particular Block height.
70+
The `debug.setHead()` function allows Bor to set the tip at a particular block height, resyncing from a previous block.
3871
39-
Once you run these commands, the output for this would be `null` . Null means good and it is intended. You can now start monitoring your logs for Bor again and see if it passes that block number.
72+
A successful output of the above command is a `null`. Once this is achieved, monitoring of the Bor can resume and see if the blochain goes passed the previously bad block number.
4073
41-
If in any case, none of these solutions work for you, please contact the Polygon Support team immediately.
74+
If none of these solutions works for you, please contact the Polygon Support team immediately.
4275
4376
### Log: Error validating checkpoint module=checkpoint startBlock
4477
45-
If your node throws up these logs, please check the following:
78+
If the node throws these logs, check the following:
4679
47-
- Ensure that the **Bor node is in sync**. To check, run the following command:
80+
- Check if the Bor node is in sync by running the following command
4881
4982
```bash
5083
bor attach .bor/data/bor.ipc
5184
eth.syncing
5285
```
5386
54-
If the output is **false**, then the Bor node is in sync.
87+
If the output is "false", then the Bor node is in sync.
5588
56-
- Another possible cause of this issue is that **your node might be on the wrong fork**. To check, run the following command to find the current block on your node:
89+
- Check if the Bor node is on the wrong fork by running this command
5790
5891
```bash
5992
bor attach .bor/data/bor.ipc
@@ -67,42 +100,48 @@ If your node throws up these logs, please check the following:
67100
eth.getBlockByNumber("<Block Number>").hash
68101
```
69102
70-
Now, you can inspect the block number to identify if you are running on the right fork. One way to do this is to search for the block number on an explorer like [PolygonScan](https://polygonscan.com/).
103+
Inspect the block number to identify if you are running on the right fork. One way to do this is to search for the block number on an explorer like [PolygonScan](https://polygonscan.com/).
71104
72-
<img src={useBaseUrl("img/knowledge-base/block_number.png")}/>
105+
![Figure: Bad block](../../../../img/pos/block_number.png)
73106
74107
If the hashes match, then the node is on the right fork.
75108
76109
### Log: Error dialing seed
77110
78-
Please check whether your Heimdall node is configured with the latest seeds as listed on the [node setup documents](../../operate/full-node-binaries.md).
111+
- Check whether your Heimdall node is configured with the latest seeds as listed on the [node setup documents](../../operate/full-node-binaries.md).
112+
113+
If you're still encountering the error, after either updating to the latest seeds or confirming that you are using the right seeds, you may need to clear the `addrbook.json` file. To do this, follow the steps below.
79114

80-
If you're still encountering the error after either updating to the latest seeds or confirming that you are using the right seeds, you may need to clear the `addrbook.json` file. To do this, follow the steps below.
81115

82116
1. Open the `config.toml` file in your terminal: ```vi /var/lib/heimdall/config/config.toml```
83117

84118
2. Stop `heimdalld` service: ```sudo service heimdalld stop```
85119

86120
3. Clear your `addrbook`
87-
121+
88122
```
89123
sudo service heimdalld stop
90124
cp /var/lib/heimdall/config/addrbook.json /var/lib/heimdall/config/addrbook.json.bkp
91125
rm /var/lib/heimdall/config/addrbook.json
92126
```
93127

94128
4. Increase `max_num_inbound_peers` and `max_num_outbound_peers` in `/var/lib/heimdall/config/config.toml`:
95-
129+
96130
```
97131
max_num_inbound_peers = 300
98132
max_num_outbound_peers = 100
99133
```
100134

101-
5. Start `heimdalld` service: ```sudo service heimdalld start```
135+
5. Start `heimdalld` service with the following command
136+
137+
```bash
138+
sudo service heimdalld start
139+
```
140+
102141

103142
### Log: Demoting invalidated transaction
104143

105-
This log is not an error. It is a process in **txpool** which rearranges the transactions and removes some of them (as per specific conditions).
144+
This log is not an error but a process in the transactinos pool `txpool` which rearranges the transactions and removes some of them (as per specified conditions).
106145

107146
It should in **no way affect the checkpointing mechanism**.
108147

@@ -162,6 +201,7 @@ Check if your Heimdall Bridge is running or not or if it has any errors in the l
162201
This typically means that your Sentry Heimdall is running into issues.
163202
164203
**Solution:**
204+
165205
- Check your Sentry Heimdall and see if the service is running fine.
166206
- If the service is stopped then restarting the service on your Sentry should resolve this issue.
167207
- Similarly, after fixing your sentry, a restart of your Heimdall service should also resolve the problem.
@@ -462,36 +502,37 @@ To fix this issue, the signer address that is used to mine must be added inside
462502
Please use the below steps:
463503

464504
1. Check your Bor data size before pruning
465-
466-
```bash
467-
du -sh /usr/bin/bor
468-
```
505+
506+
```bash
507+
du -sh /usr/bin/bor
508+
```
469509

470510
2. Stop Bor
511+
512+
```bash
513+
sudo service bor stop
514+
```
471515

472-
```bash
473-
sudo service bor stop
474-
```
475-
476-
3. Start **tmux** to ensure that even if your SSH connection is reset, the process is running on the remote machine
477-
tmux.
478-
479-
4. Start pruning
480-
481-
```bash
482-
sudo bor snapshot prune-state --datadir /usr/bin/bor
483-
```
516+
3. Start `tmux` to ensure that even if your SSH connection is reset, the process is running on the remote machine
517+
`tmux`.
484518

485-
The default --datadir is `/usr/bin/bor`.
519+
4. Start pruning.
520+
521+
```bash
522+
sudo bor snapshot prune-state --datadir /usr/bin/bor
523+
```
486524

487-
5. Once the pruning is completed, you will see success logs and details. Then start Bor again:
525+
The default --datadir is `/usr/bin/bor`.
488526

489-
```bash
490-
sudo service bor start
491-
```
527+
5. Once the pruning is completed, you will see success logs and details. Then start Bor again.
528+
529+
```bash
530+
sudo service bor start
531+
```
492532

493-
6. Check your Bor data size after pruning:
494533

495-
```bash
496-
du -sh /usr/bin/bor
497-
```
534+
6. Check your Bor data size after pruning.
535+
536+
```bash
537+
du -sh /usr/bin/bor
538+
```

0 commit comments

Comments
 (0)