flow-go icon indicating copy to clipboard operation
flow-go copied to clipboard

[Protocol KVStore] Move `EpochProtocolState` data into KVStore

Open jordanschalm opened this issue 9 months ago • 1 comments

At the moment we only store the hash of Epoch sub-state in the KVStore. We'd like to directly store all the data there instead.

Suggested implementation

  • keep original Snapshot.Epoch API, but back it by the KV-store (this prevents needing to update/refactor all existing usages)
  • no (remove) top-level "getter" Snapshot.EpochProtocolState
  • top-level access to Epoch-data is still given through KV-Store's canonical representation (interface according to the newest protocol version 👉 KVStoreReader)

Clean up duplicated epoch API at the same time?

Historically grown, the Epoch portion of the Protocol state is exposed in three different places in our APIs (see https://github.com/onflow/flow-go/pull/5650#discussion_r1561525307). We would like to consolidate this.

See also https://github.com/onflow/flow-go/issues/6191

jordanschalm avatar May 23 '24 12:05 jordanschalm