Skip to content

Remove KV serialiser forward declaration indirection#8025

Draft
achamayou with Copilot wants to merge 2 commits into
mainfrom
copilot/remove-kv-serialiser-forward-declarations
Draft

Remove KV serialiser forward declaration indirection#8025
achamayou with Copilot wants to merge 2 commits into
mainfrom
copilot/remove-kv-serialiser-forward-declarations

Conversation

Copilot AI commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

KV consumers only need a stable serialiser/deserialiser interface, not the concrete raw wrapper templates. The previous serialiser_declare.h indirection duplicated type knowledge and kept kv_types.h coupled to template forward declarations.

  • Abstract interfaces

    • Added virtual KvStoreSerialiser and KvStoreDeserialiser interfaces directly in kv_types.h.
    • Kept map/change-set APIs typed against these abstract interfaces.
  • Concrete raw implementations

    • Made GenericSerialiseWrapper and GenericDeserialiseWrapper implement the new interfaces.
    • Added RawKvStoreSerialiser / RawKvStoreDeserialiser aliases in kv_serialiser.h for construction sites.
  • Removed obsolete declaration layer

    • Deleted serialiser_declare.h.
    • Updated Store, Tx, and Snapshot code to construct the raw concrete wrappers explicitly.
class KvStoreSerialiser
{
public:
  virtual ~KvStoreSerialiser() = default;

  virtual void start_map(const std::string& name, SecurityDomain domain) = 0;
  virtual void serialise_raw(const std::vector<uint8_t>& raw) = 0;
  virtual std::vector<uint8_t> get_raw_data() = 0;
};

Copilot AI linked an issue Jul 3, 2026 that may be closed by this pull request
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove KV serialiser forward declarations Remove KV serialiser forward declaration indirection Jul 3, 2026
Copilot AI requested a review from achamayou July 3, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove KV serialiser forward declarations

2 participants