mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 19:50:36 +00:00
5c0c9fdff9
This PR does the following things. - Optimises the get span for bor function. The function was responsible to fetch span from heimdall and store in cache. If not found, it would iterate back (or front) depending on the last found span in cache. In this iteration it would also fetch the span every time it moves front / back which is not necessary at all. As we know the `spanLength` we can leverage it to directly jump to the required span ID without fetching all the intermediate ones. - Adds a check for `number > 255` in validating producers from headers' extra data with ones in span. As bor fetches this data from contract, it used to give correct results for 0th span (i.e. 0-255 blocks) and hence no error occurs. Erigon on the other hand directly uses span to get producers for all blocks. Hence, the data in 0th span turns out to be wrong (as it's hardcoded in contract). We can skip validation for 0th span blocks until we start fetching data from contract. - As we're planning to use erigon as a validator, it will also be responsible for preparing headers. It used to write all the validators in the `header.Extra` field instead of just the selected producers. As we have `GetCurrentProducers` function available now, we can use it instead of `GetCurrentValidators`. |
||
---|---|---|
.. | ||
aura | ||
bor | ||
clique | ||
db | ||
ethash | ||
merge | ||
misc | ||
chain_reader.go | ||
consensus.go | ||
errors.go | ||
result.go |