ethstorage / es-node

Golang implementation of the EthStorage node.
Other
1.15k stars 77 forks source link

Load blob from downloader cache #300

Closed syntrust closed 3 months ago

syntrust commented 3 months ago

Issue: commit does not match occurs when the miner loads incorrect data from the storage manager.

The reason is that the miner only supports sampling from the storage manager, but new blobs are downloaded into the cache before being encoded by the storage manager, while the miner happens to sample from these blobs.

The solution would be to provide a unified interface BlobReader for the miner to sample blobs from both the storage manager and the cache.

Furthermore, the downloaded blobs must be encoded before being cached so the miner can do sampling.

A cache interface is now used by the downloader so later disk-backed storage can be easily introduced.

Test cases include:

qzhodl commented 3 months ago

There is another test case: When the block is finalized, the encoded BLOB can be written into the storage file successfully

syntrust commented 3 months ago

There is another test case: When the block is finalized, the encoded BLOB can be written into the storage file successfully

updated.