erigon-pulse/consensus
Manav Darji 5c0c9fdff9
consensus/bor: optimise get span, fixes in header validation (#7689)
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`.
2023-06-12 12:48:15 +01:00
..
aura Skip gas limit checks for chains with gas limit contract (#7567) 2023-05-23 22:14:18 +02:00
bor consensus/bor: optimise get span, fixes in header validation (#7689) 2023-06-12 12:48:15 +01:00
clique lru lib version up (#7695) 2023-06-09 13:46:58 +07:00
db [Diagnostics] Simplify logging settings, introduce correct log rotation with lumberjack (#7273) 2023-04-07 21:08:44 +00:00
ethash EIP-4844: add data_gas_used (#7639) 2023-06-02 21:26:19 +01:00
merge EIP-4844: Increase Blob Throughput (#7688) 2023-06-09 11:07:28 +02:00
misc EIP-4844: add data_gas_used (#7639) 2023-06-02 21:26:19 +01:00
chain_reader.go use BlockReader.CanonicalHash method instead of rawdb (#7604) 2023-05-31 13:41:10 +07:00
consensus.go Proper Gnosis Chain rewards in trace_block (#7473) 2023-05-09 17:19:23 +02:00
errors.go Withdrawals part 1 (#6009) 2022-12-01 09:15:01 +01:00
result.go Clean up DEBUG category logs (#2776) 2021-10-05 08:14:04 +07:00