Remove unused KV read serialization - #8303
Merged
Amaury Chamayou (achamayou) merged 3 commits intoSep 7, 2026
Merged
Conversation
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 started reviewing on behalf of
Amaury Chamayou (achamayou)
September 7, 2026 15:10
View session
Contributor
There was a problem hiding this comment.
🔵 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_readsplumbing fromAbstractMap::serialise_changesand related call sites. - Remove
KvStoreSerialiser::serialise_readand 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>
Amaury Chamayou (achamayou)
enabled auto-merge (squash)
September 7, 2026 16:16
Amaury Chamayou (achamayou)
requested a review
from Eddy Ashton (eddyashton)
September 7, 2026 16:16
Max (maxtropets)
approved these changes
Sep 7, 2026
Amaury Chamayou (achamayou)
deleted the
achamayou-remove-read-serialization-upstream
branch
September 7, 2026 16:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
include_readsoption, its default/forwarding plumbing, and the per-key read writer.Versionread tracking for OCC.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:
kv_testbuild../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.scripts/ci-checks.sh -f: all 14 checks passed, with explicit exit status 0 and no source changes.