ethpandaops / dora

Dora the Explorer is a lightweight slot explorer for the ethereum beaconchain
https://beaconlight.ephemery.dev/
GNU General Public License v3.0
83 stars 26 forks source link

add execution block hash index to block cache #144

Closed pk910 closed 1 month ago

pk910 commented 1 month ago

This PR adds a execution block hash to block reference map to the block cache. This map significantly lowers the processing time for the getBlocksByExecutionBlockHash function, which is more heavily used with #141.

The negative effect of this change is the memory overhead. The map holds all execution hashes & references to blocks for all unfinalized blocks, which roughly sums up to about 2.5M memory for a week of unfinality (50k blocks).

I think the overhead is acceptable compared to iterating the full unfinalized block range for each call to getBlocksByExecutionBlockHash.

Maliksb11 commented 1 month ago

Ok