c4dt / d-voting

📧 E-Voting platform based on the Dela blockchain
https://dedis.github.io/d-voting
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Improve loading time with many blocks #127

Open ineiti opened 8 months ago

ineiti commented 8 months ago

If there are many blocks (3000 for 10k votes), startup of a node takes about 1 minute. This is due to the method here:

https://github.com/c4dt/dela/blob/main/core/ordering/cosipbft/blockstore/disk.go#L70

It crawls through all blocks, deserializes them, and creates a map of block-hashes to block-indexes. Some comments: