Rework ImportHistory to batch up to 2500 consecutive blocks per
InsertReceiptChain call, reducing processing overhead.
Replace full receipt deserialization with raw RLP-level conversion via
GetRawReceiptsByNumber, avoiding allocation of Receipt/Log/Bloom structs
and eliminating the decode-reencode round-trip for both era1 and erae
formats.
Centralize consensus receipt conversion into types.ConvertConsensusReceiptsToStorage
(shared by eradb runtime path and import command), and add a new slim
receipt converter for the erae format that strips the tx-type field and
validates tx/receipt count consistency.
Fix resource management by explicitly closing file handles and era objects
at each error return instead of relying on defer-in-closure patterns.
Here is a draft for the New EraE implementation. The code follows along
with the spec listed at https://hackmd.io/pIZlxnitSciV5wUgW6W20w.
---------
Co-authored-by: shantichanal <158101918+shantichanal@users.noreply.github.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
This implements a backing store for chain history based on era1 files.
The new store is integrated with the freezer. Queries for blocks and receipts
below the current freezer tail are handled by the era store.
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: lightclient <lightclient@protonmail.com>