onflow/flow-emulator

Implement remote storage

Closed this issue · 2 comments

Implement a storage that uses the archive node to get the registers.
https://github.com/onflow/flow-archive

Implementing the store interface defined here

type DataGetter interface {

We can reuse most of the default store implementation but swap out the LedgerByHeight to return the storage snapshot provided by archive node.
The first step is to implement this for one-off transactions only, the second step would be to keep changes local and then fork the network state by first trying to see if we have local changes for a read and if not read from remote.

Btw if we will fork in the future, it would be nice to also fork protocol state. Something like ForkedStore(blockHeight, oldStore, newStore)

Yeah, I agree. Planning to play with this idea a bit this week.