erigon-pulse/consensus
milen 74ec3a9db7
stagedsync: fix bor heimdall mining flow (#9149)
Currently the mining loop is broken for the polygon chain. This PR fixes
this.

High level changes:

- Introduces new Bor<->Heimdall stage specifically for the needs of the
mining flow
- Extracts out common logic from Bor<->Heimdall sync and mining stages
into shared functions
- Removes `mine` flag for the Bor<->Heimdall sync stage
- Extends the current `StartMining` function to prefetch span zero if
needed before the mining loop is started
- Fixes Bor to read span zero (instead of span 1) from heimdall when the
span is not initially set in the local smart contract that the Spanner
uses

Test with devnet "state-sync" scenario:
![Screenshot 2024-01-05 at 17 41
23](https://github.com/ledgerwatch/erigon/assets/94537774/34ca903a-69b8-416a-900f-a32f2d4417fa)
2024-01-09 11:37:39 +00:00
..
aura Added db loggers to all db callers and fixed flag settings (#9099) 2023-12-31 17:10:08 +07:00
bor stagedsync: fix bor heimdall mining flow (#9149) 2024-01-09 11:37:39 +00:00
clique stagedsync: implement bor span for chain reader and fix loggers (#9146) 2024-01-05 14:20:21 +00:00
ethash Sentinel refactor (#8296) 2023-10-22 01:17:18 +02:00
merge Introduce extra functions for BorSpans (no-op) (#8648) 2023-11-04 10:59:07 +00:00
misc polygon/sync: canonical chain builder (#9117) 2024-01-04 10:44:57 +01:00
mock borheimdall: add test for span persistence (#8988) 2023-12-14 22:50:59 +02:00
chain_reader.go Introduce extra functions for BorSpans (no-op) (#8648) 2023-11-04 10:59:07 +00:00
consensus.go borheimdall: add test for span persistence (#8988) 2023-12-14 22:50:59 +02:00
errors.go Don't mark blocks as bad on transient errors (#8197) 2023-09-17 11:14:36 +02:00
result.go Clean up DEBUG category logs (#2776) 2021-10-05 08:14:04 +07:00