Commit b48c9f8
committed
dbft: skip sealing task awaiting during node sync
If node is stale and far behind its peers, mining is aborted by the
signal of Downloader. If mining is aborted, then sealing task won't be
submitted to the consensus engine, and thus, dBFT awaiting for sealing
task may hang forever in case of multiple block batch processing by
Downloader. It may happen because dBFT's block notificaiton channel has
buffer size of 2 and block notification processing is managed by the
same eventLoop as sealing tasks awaiting. So dBFT blocks notifications
processing by sealing task awaiting, and thus, blocks the whole chain
from the further sync process:
```
2024-04-18T10:26:44.856+0300 DEBUG [email protected]/dbft.go:229 caching message from future {"height": 6470, "view": 0, "cache": {}}
2024-04-18T10:26:45.264+0300 DEBUG [email protected]/dbft.go:214 received message {"type": "Commit", "from": 4, "height": 6470, "view": 0, "my_height": 1, "my_view": 0}
2024-04-18T10:26:45.265+0300 DEBUG [email protected]/dbft.go:229 caching message from future {"height": 6470, "view": 0, "cache": {}}
INFO [04-18|10:26:50.148] Imported new chain segment number=192 hash=775270..7b8b06 blocks=192 txs=0 mgas=0.000 elapsed=562.005ms mgasps=0.000 age=19h32m52s triedirty=0.00B
INFO [04-18|10:26:50.149] New block in the chain "dbft index"=1 "chain index"=192 hash=0x77527025ea64a0ceb26235efaf6ddc5430d0e2de15757869da2e90a1c57b8b06 "parent hash"=0xa9cde87fe65f34bf1f40982015e1a7e73b117a80fadf707b0deda67a34855092 primary=3 coinbase=0x1212000000000000000000000000000000000003 "mix digest"=0x23c10fa9c1fae49f6139db9c3ecff715de101c145e56e4d390a16e67d5c32e1b
INFO [04-18|10:26:50.149] Fetching latest sealing proposal "desired number"=193
INFO [04-18|10:26:50.152] Indexed transactions blocks=193 txs=0 tail=0 elapsed=3.786ms
INFO [04-18|10:26:50.770] Imported new chain segment number=384 hash=a5dac5..02375b blocks=192 txs=0 mgas=0.000 elapsed=472.546ms mgasps=0.000 age=18h57m12s triedirty=0.00B
INFO [04-18|10:26:51.344] Imported new chain segment number=576 hash=1d8a8e..3e8def blocks=192 txs=0 mgas=0.000 elapsed=570.798ms mgasps=0.000 age=18h21m29s triedirty=0.00B
INFO [04-18|10:26:52.221] Imported new chain segment number=960 hash=6fde0c..d75d78 blocks=384 txs=0 mgas=0.000 elapsed=868.154ms mgasps=0.000 age=17h10m6s triedirty=0.00B
INFO [04-18|10:27:07.683] Looking for peers peercount=1 tried=1 static=0
```
To fix this problem we have to omit block notifications processing until
the node sync process end, i.e. util the moment miner resumes its work.
Signed-off-by: Anna Shaleva <[email protected]>1 parent 68e620e commit b48c9f8
4 files changed
+28
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
186 | 189 | | |
187 | 190 | | |
188 | 191 | | |
| |||
686 | 689 | | |
687 | 690 | | |
688 | 691 | | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
689 | 698 | | |
690 | 699 | | |
691 | 700 | | |
| |||
1412 | 1421 | | |
1413 | 1422 | | |
1414 | 1423 | | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
1415 | 1431 | | |
1416 | 1432 | | |
1417 | 1433 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| 299 | + | |
299 | 300 | | |
300 | 301 | | |
301 | 302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
188 | 193 | | |
189 | 194 | | |
190 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
385 | 391 | | |
386 | 392 | | |
387 | 393 | | |
| |||
0 commit comments