Skip to content

Remove unused KV read serialization - #8303

Merged
Amaury Chamayou (achamayou) merged 3 commits into
mainfrom
achamayou-remove-read-serialization-upstream
Sep 7, 2026
Merged

Remove unused KV read serialization#8303
Amaury Chamayou (achamayou) merged 3 commits into
mainfrom
achamayou-remove-read-serialization-upstream

Conversation

@achamayou

@achamayou Amaury Chamayou (achamayou) commented Sep 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Remove the unused include_reads option, its default/forwarding plumbing, and the per-key read writer.
  • Preserve the zero map-read and read-count wire headers, legacy decoding/replay, snapshots, encryption and security-domain ordering, and main's scalar Version read tracking for OCC.
  • Rely on the existing LTS compatibility test for ledger-format backward compatibility, without adding a separate unit test.

Scope

This is a standalone cleanup against main. The diff is exactly four production files, +11/-38; the added compatibility unit test has been removed. It does not include Lean/model, tracing, fuzzer, optional<Version>, or zero-revision/OCC-fix changes.

Validation

Completed after removing the unit test, in an isolated Linux/WSL source tree identical to the committed tree:

  • Fresh Debug/Ninja kv_test build.
  • ./tests.sh -R '^kv_test$' -L unit --no-tests=error --output-on-failure -V: 74/74 cases and 4,735 assertions passed, with no skips.
  • Full scripts/ci-checks.sh -f: all 14 checks passed, with explicit exit status 0 and no source changes.

Preserve legacy read headers and decoding while removing the unused read-export API. Cover writes-only bytes, sizes, and legacy replay for public and private maps.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It changes core KV ledger serialisation interfaces/behavior (including compatibility-sensitive encoding paths) and should receive final human review despite the added regression coverage.

Pull request overview

This PR removes the unused per-key KV read-set serialisation path (include_reads and serialise_read) while preserving ledger compatibility by keeping the legacy read-set headers (entry version + read-count) in the wire format as zeroed values, and adding regression tests to validate legacy decoding/replay behavior.

Changes:

  • Remove the include_reads plumbing from AbstractMap::serialise_changes and related call sites.
  • Remove KvStoreSerialiser::serialise_read and the corresponding wrapper implementation.
  • Add unit regression coverage asserting byte-identical serialisation for public/private maps, correct sizing, removals, and replay/decoding of legacy entries containing reads.

Custom instructions used:

  • .github/copilot-instructions.md
  • .github/instructions/reviewing.instructions.md
File summaries
File Description
src/kv/untyped_map.h Always emits legacy read headers as {NoVersion, 0} while serialising writes/removes, removing the now-unused per-key read serialisation.
src/kv/test/kv_serialisation.cpp Adds a compatibility-focused regression test covering byte layout, size projection, legacy read decoding, and replay behavior.
src/kv/kv_types.h Updates KV serialiser/map interfaces by removing serialise_read and the include_reads argument.
src/kv/generic_serialise_wrapper.h Removes the concrete serialise_read implementation from the generic serialiser wrapper.
src/kv/committable_tx.h Simplifies transaction serialisation sizing/encoding paths by removing the unused include_reads parameter propagation.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Rely on the existing LTS compatibility test for ledger format coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@achamayou
Amaury Chamayou (achamayou) merged commit 500c55e into main Sep 7, 2026
13 checks passed
@achamayou
Amaury Chamayou (achamayou) deleted the achamayou-remove-read-serialization-upstream branch September 7, 2026 16:38
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.

3 participants