Skip to content

refactor: stop Dash serializers from depending on stream type and version [pre-backport] - #8255

Merged
knst merged 9 commits into
dashpay:developfrom
knst:bp-serialization-pre-1
Nov 27, 2026
Merged

knst merged 9 commits into
dashpay:developfrom
knst:bp-serialization-pre-1

Conversation

@knst

@knst knst commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

Bitcoin Core v27 finished moving serialization away from the stream type and version: bitcoin#28508 removes SER_GETHASH, bitcoin#28892 and bitcoin#28912 drop the version from P2P streams, VectorWriter and SpanReader, and bitcoin#28451 removes SER_NETWORK, SER_DISK and CDataStream. Our partial backports of bitcoin#28438, bitcoin#28892 and bitcoin#28912 had to stop short because Dash code still reads them:

  • CSimplifiedMNListEntry, CSimplifiedMNListDiff (MNLISTDIFF, QRINFO) and CCoinJoinAccept (dsa) pick fields by the peer's protocol version taken from the stream;
  • CSimplifiedMNListEntry::CalcHash() uses SER_GETHASH to leave out the network-only version prefix;
  • CGovernanceObject writes its local state only for SER_DISK, and CGovernanceVote bounds the signature only when reading SER_NETWORK;
  • Dash code holds most of the 529 CDataStream uses.

This PR removes those dependencies first, without changing any serialized byte, so that the backports which follow can be taken nearly 1:1. It continues the preparation started in #8093.

Follow-up backports are prepared here: #8256; that PR stacks on #8255 and #8243.

What was done?

  • ProtocolSerParams: a serialization parameter in the style of CAddress::SerParams, Network with the peer's protocol version or Disk (disk, hashes, RPC). MNLISTDIFF and QRINFO are only sent, so only the sender wraps them; dsa is wrapped on both sides. The entry hash and the raw entries in quorum proofs use Disk.
  • GovernanceSerParams (Disk, Network): the governance cache (de)serializes through a disk ParamsStream, as upstream AddrMan does; P2P sends and receives of objects and votes use Network. CGovernanceVote gets separate Serialize/Unserialize, so hashing a vote needs no parameter.
  • Dash hashers and streams that set a type or version only for the constructor become HashWriter/DataStream (SigHashWriter, evo snapshot, CoinJoin queue hash, stable asset-unlock hash, CoinJoin round salt). No hash changes.
  • The QGETDATA size check and the DKG prefix peek pass a constant instead of the stream version.
  • scripted-diff: Dash-only files use DataStream, with the expressions of the refactor: VectorWriter and SpanReader without nVersion bitcoin/bitcoin#28912 scripted-diff; the leftovers follow by hand. BLS IES objects lose a version parameter that only built a stream.

Not done here, it follows with the backports:

How Has This Been Tested?

No new tests. Existing tests that check the version-gated encodings now pass the parameters explicitly: coinjoin_inouts_tests/dsa_rebalance_flag_version_gated_serialization (old and new peer encodings), governance_vote_wire_tests (network cap versus unbounded disk read), the governance cache round-trips in governance_vote_processing_tests, and the llmq round-trip helper in test/util/llmq_tests.h. governance_vote_wire_tests/object_signature_size_limit no longer loops over SER_NETWORK and SER_DISK, which Governance::Object never read.

Breaking Changes

None. P2P messages, disk files and hashes are byte-for-byte unchanged.

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (if you have permission to set one)

@knst knst added this to the 24.1 milestone Nov 26, 2026
@thepastaclaw

thepastaclaw commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

🕓 Review not started yet because the new head is waiting for the 30-minute push debounce.

  • Request normal review — click when the PR is ready for review.
  • Request priority review — click to move this review to the front of the queue.

Commit 1e241a8. Normal review starts when eligible; priority review starts as soon as a slot is available.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change replaces CDataStream with DataStream across serialization, message-processing, persistence, and test code. It adds protocol serialization parameters for disk and network formats, and updates selected serializers to use explicit format or peer-version parameters. BLS encryption and decryption calls no longer accept protocol-version arguments. Governance vote serialization and deserialization now use explicit governance format parameters. Tests and fixtures are updated to use the revised stream and parameter APIs.

Estimated code review effort: 4 (Complex) | ~45 minutes

Suggested reviewers: thepastaclaw

Merge Risk: Minimal · up to bc023

This refactor moves serialization choices out of stream types into explicit parameters. No concrete defect was identified in the supplied material. An earlier PR comment mentions an undescribed blocking finding that could not be evaluated.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names a refactor that removes Dash serializers' dependence on stream type and version. The changeset does this: it adds ProtocolSerParams and GovernanceSerParams, replaces CDataStream with D…
Description check Passed The description states the motivation, lists the concrete changes (ProtocolSerParams, GovernanceSerParams, DataStream replacements, QGETDATA and DKG prefix constants), names the tests touched, and say…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names a refactor that removes Dash serializers' dependence on stream type and version. The changeset does this: it adds ProtocolSerParams and GovernanceSerParams, replaces CDataStream with DataStream, and drops version parameters from several encrypt/decrypt and message paths. The title covers the main change, though it does not mention the bracketed backport tag or the scope of the follow-up work.

Full details: Description check

Explanation

The description states the motivation, lists the concrete changes (ProtocolSerParams, GovernanceSerParams, DataStream replacements, QGETDATA and DKG prefix constants), names the tests touched, and says the change keeps serialized bytes unchanged. It is directly related to the changeset.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7d44fb87-fce5-45f3-a676-fe07f8f475c2
Commits

Reviewing files that changed from the base of the PR and between b7e6fed and bc02316.

Files selected for processing: 1

  • src/protocol_ser_params.h

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Final validation — Phase 1 + Phase 2

Changes requested: 1 blocker

  • Cppcheck fails on the new serialization format field — src/protocol_ser_params.h:17-20 (new)
    Impact: The PR's Cppcheck job exits with code 1 on the new header, even though the current callers supply a format.

This pre-backport refactor replaces implicit stream type and version checks with explicit serialization parameters and migrates Dash code to DataStream and HashWriter without changing the intended encodings. On the reviewed head, ClangFormat and the general lint job passed, Cppcheck failed, and build and test results were still pending.

🔴 1 blocking | 🟡 1 suggestion(s)

Review provenance

Source: reviewer 1: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: backport-reviewer); reviewer 3: gpt-6.2-astra (agent: phase2-reviewer, role: dash-core-commit-history); reviewer 4: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)

  • Triage: critical by gpt-6.2-sol (effort low) — The cross-cutting refactor changes peer-facing deserialization in src/governance/vote.h and src/coinjoin/coinjoin.h, where signature bounds and version-gated fields now depend on explicitly supplied parameters.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity quota lookup failed), glm-5.3-flash (not used above high effort; tier asks max)
  • Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
  • Fresh verifier: gpt-6.2-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.2-astra — general (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — backport-reviewer (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — dash-core-commit-history (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.

In `src/protocol_ser_params.h`:
- [BLOCKING] src/protocol_ser_params.h:17-20: Cppcheck fails on the new serialization format field
  Impact: The PR's Cppcheck job exits with code 1 on the new header, even though the current callers supply a format.
  [Cppcheck / Run cppcheck](https://github.com/dashpay/dash/actions/runs/45883070410/job/140144398605) fails on this head with `src/protocol_ser_params.h:17:18: warning: Member variable 'ProtocolSerParams::fmt' has no initializer. [uninitMemberVarNoCtor]`. Both `Network()` and `PROTOCOL_DISK` initialize the field through aggregate initialization, so this is a lint failure, not an observed uninitialized read. Add a `constexpr` constructor that requires a format and preserves the disk version default of zero.

In `src/test/util/llmq_tests.h`:
- [SUGGESTION] src/test/util/llmq_tests.h:105-110: The round-trip test can pass when older peers get the wrong masternode diff layout
  Impact: Peers that negotiate an older supported protocol version could lose the ability to decode MNLISTDIFF or QRINFO replies without the existing tests catching the regression.
  The existing tests would miss an encoding change confined to older peers. The QRINFO round trip uses the same C++ implementation for both directions at `PROTOCOL_VERSION`, and the functional P2P decoder expects only the current layout. The refactored serializer still serves versions where `nVersion` appears after `cbTx` or is absent, and where the quorum ChainLock signature map is omitted. Add table-driven cases in `evo_simplifiedmns_tests` that compare a populated diff against independently assembled expected bytes just below and at the version boundaries. Include a populated masternode entry to check that the selected version reaches nested entries.

Comment thread src/protocol_ser_params.h Outdated
Comment on lines +17 to +20
const Format fmt;
const int nVersion{0};

static ProtocolSerParams Network(int version) { return {Format::Network, version}; }

@thepastaclaw thepastaclaw Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

✅ Resolved at bc02316f; see the replies below.

🔴 Blocking: Cppcheck fails on the new serialization format field
Impact: The PR's Cppcheck job exits with code 1 on the new header, even though the current callers supply a format.

Cppcheck / Run cppcheck fails on this head with src/protocol_ser_params.h:17:18: warning: Member variable 'ProtocolSerParams::fmt' has no initializer. [uninitMemberVarNoCtor]. Both Network() and PROTOCOL_DISK initialize the field through aggregate initialization, so this is a lint failure, not an observed uninitialized read. Add a constexpr constructor that requires a format and preserves the disk version default of zero.

Suggested change
const Format fmt;
const int nVersion{0};
static ProtocolSerParams Network(int version) { return {Format::Network, version}; }
const Format fmt;
const int nVersion;
explicit constexpr ProtocolSerParams(Format format, int version = 0) : fmt{format}, nVersion{version} {}
static ProtocolSerParams Network(int version) { return ProtocolSerParams{Format::Network, version}; }

source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.2-astra (phase2-reviewer: general, backport-reviewer, dash-core-commit-history)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Resolved (re-reviewed at bc02316f): Your Format::Disk initializer gives fmt a default without changing Network(version), which still sets both fields explicitly. Cppcheck passed on this head.

Comment on lines +105 to +110
const auto params{ProtocolSerParams::Network(PROTOCOL_VERSION)};

ss_obj << obj;
ss_tmp << obj;
ss_tmp >> obj_rt;
ss_obj_rt << obj_rt;
ss_obj << params(obj);
ss_tmp << params(obj);
ss_tmp >> params(obj_rt);
ss_obj_rt << params(obj_rt);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🟡 Suggestion: The round-trip test can pass when older peers get the wrong masternode diff layout
Impact: Peers that negotiate an older supported protocol version could lose the ability to decode MNLISTDIFF or QRINFO replies without the existing tests catching the regression.

The existing tests would miss an encoding change confined to older peers. The QRINFO round trip uses the same C++ implementation for both directions at PROTOCOL_VERSION, and the functional P2P decoder expects only the current layout. The refactored serializer still serves versions where nVersion appears after cbTx or is absent, and where the quorum ChainLock signature map is omitted. Add table-driven cases in evo_simplifiedmns_tests that compare a populated diff against independently assembled expected bytes just below and at the version boundaries. Include a populated masternode entry to check that the selected version reaches nested entries.

source: gpt-6.2-astra (phase2-reviewer: general, backport-reviewer, dash-core-commit-history)

@thepastaclaw thepastaclaw added the pastaclaw:changes-requested thepastaclaw's latest review requested changes label Nov 26, 2026
@knst
knst force-pushed the bp-serialization-pre-1 branch from b7e6fed to bc02316 Compare November 26, 2026 21:01
@thepastaclaw thepastaclaw removed the pastaclaw:changes-requested thepastaclaw's latest review requested changes label Nov 26, 2026

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-review — Final validation — Phase 1 + Phase 2

New on this head: Since the previous review, the only patch change is that ProtocolSerParams::fmt now defaults to Format::Disk; callers that explicitly select network encoding are unchanged. Cppcheck, lint, formatting, and all reported source builds passed; Linux test jobs, including ASan, and multiprocess lint were still pending.

🟡 1 suggestion(s)

Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.

Still open from earlier rounds (1)

  • 🟡 Suggestion: The round-trip test can pass when older peers get the wrong masternode diff layout — src/test/util/llmq_tests.h:105-112 (thread)
Review provenance

Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.2-astra (agent: phase2-reviewer, role: backport-reviewer); reviewer 4: gpt-6.2-astra (agent: phase2-reviewer, role: dash-core-commit-history); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)

  • Triage: critical by gpt-6.2-sol (effort low) — The refactor is broad and changes peer-facing deserialization in src/governance/vote.h, where the explicit network parameter controls the signature size limit, and in src/coinjoin/coinjoin.h, where the peer version controls which fields are read.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity quota lookup failed), glm-5.3-flash (not used above high effort; tier asks max)
  • Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
  • Fresh verifier: gpt-6.2-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.2-astra — general (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — backport-reviewer (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — dash-core-commit-history (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.

In `src/test/util/llmq_tests.h`:
- [SUGGESTION] src/test/util/llmq_tests.h:105-112: The round-trip test can pass when older peers get the wrong masternode diff layout
  (carried; thread: https://github.com/dashpay/dash/pull/8255#discussion_r4712990853)

Comment thread src/protocol_ser_params.h Outdated
Comment on lines +17 to +20
const Format fmt;
const int nVersion{0};

static ProtocolSerParams Network(int version) { return {Format::Network, version}; }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Resolved (re-reviewed at bc02316f): Your Format::Disk initializer gives fmt a default without changing Network(version), which still sets both fields explicitly. Cppcheck passed on this head.

@thepastaclaw thepastaclaw added the pastaclaw:approved thepastaclaw's latest review approved this PR label Nov 26, 2026
knst added 9 commits November 27, 2026 15:14
…ds on the peer

Several Dash serializers read the stream type and version to choose their encoding: some P2P messages depend on the peer's protocol version, and the masternode list entry hash leaves out the network-only version prefix. bitcoin#28892, bitcoin#28912 and bitcoin#28451 remove the version and type from streams, and bitcoin#28508 removes SER_GETHASH.

ProtocolSerParams carries that choice as a serialization parameter, following CAddress::SerParams: Network with the peer's protocol version, or Disk for disk, hashes and RPC. The following commits switch the serializers to it.
…a serialization parameter

CSimplifiedMNListEntry and CSimplifiedMNListDiff read the stream type and version to choose their P2P encoding. bitcoin#28892 and bitcoin#28912 remove both from the P2P streams, and bitcoin#28508 removes SER_GETHASH, which CalcHash() used to mean "not a network stream".

Following CAddress::SerParams, the encoding is now chosen by ProtocolSerParams: Network with the peer's protocol version for MNLISTDIFF and QRINFO, Disk for the entry hash and the raw entries in quorum proofs. Both messages are only sent; a received one is a misbehaviour and is not deserialized. The serialized bytes are unchanged.
…rameter

CCoinJoinAccept reads the stream version to decide whether to serialize the rebalance flags. bitcoin#28892 and bitcoin#28912 remove the version from P2P streams, so the sender and the receiver now pass the peer's protocol version through ProtocolSerParams. The serialized bytes are unchanged.
…zation parameter

CGovernanceObject stores its local state only when the stream type is SER_DISK, and CGovernanceVote bounds the signature only when reading a SER_NETWORK stream. bitcoin#28451 removes both stream types.

The encoding is now chosen by GovernanceSerParams. Like AddrMan, the governance cache (de)serializes its content through a disk ParamsStream; P2P sends and receives of objects and votes use the network parameters. CGovernanceVote gets separate Serialize and Unserialize, so that hashing a vote does not need parameters. The serialized bytes are unchanged.
After the previous commits no Dash serializer reads the stream type or version, so the remaining Dash hashers and streams that set one only to satisfy the constructor become HashWriter and DataStream, as bitcoin#28341 did upstream. SigHashWriter derives from HashWriter, the evo snapshot input no longer forwards its source's type and version, and CCoinJoinQueue::GetHash() keeps including the signature. No hash changes.

This leaves SER_GETHASH to CKeyPool and the X11 block header hash, which bitcoin#28508 changes.
The QGETDATA size check and the DKG message prefix peek take the version from vRecv, although neither encoding depends on it. Passing PROTOCOL_VERSION lets the handlers take a DataStream, as the next commit does; bitcoin#28878 and bitcoin#28912 later drop the argument.
Dash serializers no longer read the stream type or version, so Dash code can use DataStream like upstream code does after bitcoin#28912. The expressions are those of bitcoin#28912's scripted-diff, extended to the other spellings of the type, and run over the Dash-only files. Tests that feed CDataStream to PeerManager::ProcessMessage() wait for bitcoin#28892; streams created with a non-constant version or from an expression are handled outside the scripted-diff.

-BEGIN VERIFY SCRIPT-
sed --regexp-extended -i 's/CDataStream ([0-9a-zA-Z_]+)[({]SER_[A-Z]+, [A-Z_]+_VERSION[)}];/DataStream \1{};/g; s/CDataStream ([0-9a-zA-Z_]+)[({]([^,(){}]+), SER_[A-Z]+, [A-Z_]+_VERSION[)}];/DataStream \1{\2};/g; /(SER_|^ *\/\/)/!s/\bCDataStream\b/DataStream/g' $(git grep -l CDataStream -- $(cat test/util/data/non-backported.txt) ':!src/bench/net_processing.cpp' ':!src/test/governance_inv_tests.cpp' ':!src/test/llmq_blockprocessor_tests.cpp' ':!src/test/llmq_chainlock_tests.cpp' ':!src/test/evo_netinfo_tests.cpp' ':!src/test/governance_vote_wire_tests.cpp')
sed -i 's/CDataStream& vRecv/DataStream\& vRecv/' src/node/sync_manager.h src/node/sync_manager.cpp
sed -i 's/msg_type, CDataStream& vRecv) {}/msg_type, DataStream\& vRecv) {}/' src/net_processing.h
-END VERIFY SCRIPT-
CBLSIESEncryptedObject and CBLSIESMultiRecipientObjects take a version only to build the stream they (de)serialize the encrypted secret key shares with, and BLS secret keys do not read it. Every caller passed PROTOCOL_VERSION. The streams become DataStream and the parameter goes away, also from the masternode and DKG session helpers that only forwarded it.
Converts the Dash streams the previous scripted-diff left out: those created from an expression or with the peer's version, and the network, governance and evo tests that do not go through PeerManager::ProcessMessage(). The governance object signature test no longer loops over SER_NETWORK and SER_DISK, which Governance::Object never read.

The tests feeding PeerManager::ProcessMessage() keep CDataStream until bitcoin#28892.
@knst
knst force-pushed the bp-serialization-pre-1 branch from bc02316 to 1e241a8 Compare November 27, 2026 08:14
@knst
knst merged commit 2abf680 into dashpay:develop Nov 27, 2026
6 checks passed
@thepastaclaw thepastaclaw removed the pastaclaw:approved thepastaclaw's latest review approved this PR label Nov 27, 2026
knst added a commit that referenced this pull request Nov 28, 2026
…inish bitcoin#28438, bitcoin#28892, bitcoin#28912 (serialization without stream type and version)

24ca2e1 Merge bitcoin#28451: refactor: Remove unused SER_DISK, SER_NETWORK, CDataStream (Konstantin Akimov)
29464a9 refactor: use DataStream in the last Dash code (Konstantin Akimov)
e0e680e partial Merge bitcoin#28451: refactor: Remove unused SER_DISK, SER_NETWORK, CDataStream (Konstantin Akimov)
72fe7d6 refactor: remove unused version.h includes (Konstantin Akimov)
97da7f7 Merge bitcoin#28912: refactor: VectorWriter and SpanReader without nVersion (Konstantin Akimov)
e3ae71c Merge bitcoin#28892: refactor: P2P transport without serialize version and type (Konstantin Akimov)
e0fc213 Merge bitcoin#28904: Drop CAutoFile (Konstantin Akimov)
276c2a1 Merge bitcoin#28438: Use serialization parameters for CTransaction (Konstantin Akimov)
e4b9157 Merge bitcoin#28508: refactor: Remove SER_GETHASH, hard-code client version in CKeyPool serialize (Konstantin Akimov)
d29ccfb partial Merge bitcoin#28912: refactor: VectorWriter and SpanReader without nVersion (Konstantin Akimov)
bcf7956 partial Merge bitcoin#28892: refactor: P2P transport without serialize version and type (Konstantin Akimov)

Pull request description:

  depends on:
   - #8243
   - #8255

  ## Issue being fixed or feature implemented
  Finishes the v27 serialization cleanup: after this, `CDataStream`, `SER_NETWORK`, `SER_DISK`, `SER_GETHASH`, `CHashWriter`, `CVectorWriter`, `CAutoFile` and `CNetMsgMaker` are gone, as upstream.

  Depends on the pre-backport refactoring PR (Dash serializers no longer read the stream type or version) and on the PR with the partial bitcoin#28438, bitcoin#28892 and bitcoin#28912.

  ## What was done?
  - bitcoin#28508: `CKeyPool` writes `240100`, the Dash counterpart of `259900` (as `CDiskBlockIndex::DUMMY_VERSION`). Dash keeps `SerializeHash()` on `HashWriter`.
  - bitcoin#28438 (rest): drop `CHashWriter`.
  - bitcoin#28904: the Dash block and undo record reads use `AutoFile` too.
  - bitcoin#28892 (rest): Dash code moves to `NetMsg::Make()` (`MakeAndPushMessage()` inside `PeerManagerImpl`); `ProcessGetData()` handlers no longer take a `CNetMsgMaker`. Kept: the 4 KiB reserve in `NetMsg::Make()`, `V2Transport::SetPeerVersion()` for Dash short message IDs.
  - bitcoin#28912 (rest): `SpanReader` without version, also in Dash readers; the scripted-diff is re-run on this tree, which now includes the wallet database streams.
  - bitcoin#28451, in three steps: the partial (`version.h` -> `node/protocol_version.h`), a Dash commit converting the last Dash `CDataStream` uses, then the removal itself.
  - Two Dash commits: unused `version.h` includes removed before the rename; the last Dash `DataStream` conversions.

  Dash has no witness, so `TX_WITH_WITNESS` becomes `TX_NO_WITNESS` and witness-only hunks are dropped; there is no `signet.cpp` and no `script_assets_test_minimizer` fuzz target. The `process_message` fuzz target keeps the Dash connman receive path. bitcoin#28929 is not needed: no version-gated Dash object is nested in another serialization parameter.

  ## How Has This Been Tested?
  No new tests; upstream test changes are included.

  ## Breaking Changes
  None. P2P messages, disk files and hashes are unchanged; `CKeyPool` records now store a constant in a field that readers ignore.

  ## Checklist:
  - [ ] I have performed a self-review of my own code
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(if you have permission to set one)_

Top commit has no ACKs.

Tree-SHA512: d52af8d408928e993153d75c1758beb6b5838ab49a85505ac5823ba7a3d072ea16ce7f439f29bd28c2a5564a32b53185e23ad513f5858e123fd4d62898a5b4ad
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.

2 participants