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

[Dynamic Protocol State | M3] Querying data from KV store

Open durkmurder opened this issue 1 year ago • 1 comments

Context

KV store was designed to be backward compatible and support multiple versions, to reflect this in the code base we need an version agnostic way to query data. The proposed solution is to use a generic interface which is a combination of all fields that were present across different versions. The concrete implementation of the interface will depend on the actual version which was or is active at the time the snapshot was taken. This approach allows us to use single interface across all supported versions as well as expand them, details on the approach can be found in the design doc.

For fields that are deprecated(not supported anymore) as result of the update or fields that were added(in new version but weren't present in previous one) we have agreed to use sentinel errors to inform caller that value is not available.

Definition of Done

  • Implement a generic, version agnostic interface to represent values in the KV store.
  • Implement a way to query KV store data from Snapshot API, similar to the identity-table.
  • Define sentinel errors to represent unsupported values.
  • Add tests
  • Add a comprehensive godoc that describes how to maintain interface across different versions.

durkmurder avatar Jan 29 '24 20:01 durkmurder