Repository navigation
backport: bitcoin#28508, #28904, #28451, finish #28438, #28892, #28912 (serialization without stream type and version) - #8256
Conversation
|
✅ Final review complete — no blockers (commit 24ca2e1) · triage: critical · Phase 2 only (queue backlog) |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
Changes requested: 4 blockers
- Clang builds fail because the compact-block send paths leave
PushMessageunused —src/net_processing.cpp:819-824(new)
Impact: The Linux multiprocess and TSan jobs stop compilingnet_processing.cppbefore their tests can run. - Cppcheck rejects the new serialization format member because it has no initializer —
src/protocol_ser_params.h:17(new)
Impact: The PR fails the Cppcheck job even though the current disk and network factory paths both set the format explicitly. - The transaction JSON size still bypasses the accessor used by bitcoin#28438 —
src/core_write.cpp:190(new)
Impact: The completion backport leaves RPC transaction size calculated separately fromCTransaction::GetTotalSize(), although both report the same number today. - Three fuzz targets still include the protocol-version header after their version reads are gone —
src/test/fuzz/block.cpp:10(new)
Impact: The completed bitcoin#28451 backport leaves an unnecessary header dependency in the block, deserialize, and transaction fuzz targets.
This series completes the Bitcoin Core v27 serialization backports, replacing stream type and version metadata with explicit parameters where Dash still needs them. The reviewed head merges cleanly with the supplied develop tip. ClangFormat and Lint passed; Cppcheck and the Linux multiprocess and TSan builds failed, while other build jobs were still pending at the check.
🔴 4 blocking | 🟡 3 suggestion(s)
2 finding(s) not shown inline (the lines are not part of this PR's diff)
🟡 Suggestion: The serialization stack conflicts with its declared dependency #8243
Impact: Integrating this stack with the current head of #8243 requires resolving conflicts in 12 files.
<commit:9818f1941a9>:1
The stack merges cleanly with develop at 42e2c2d4c66, but git merge-tree against #8243 head 92e73e1f648 reports conflicts in 12 files, including src/serialize.h, src/hash.h, and src/net_processing.cpp. The branches carry separate copies of several backports, including 9818f1941a9 versus #8243's fea92cf154a for bitcoin#28878. Once #8243 lands, rebase the completion stack onto the landed dependency and drop the parallel copies. The other declared dependency, #8255, is already an ancestor.
source: gpt-6.2-astra (phase2-reviewer: general, backport-reviewer, dash-core-commit-history)
🟡 Suggestion: Three partial-backport notes describe completed Dash migrations as pending
Impact: Maintainers reading the commit history get the wrong explanation for which prerequisites held up each completion commit.
<commit:f646a082dc5>:1
e8176c75ba8 says SigHashWriter and the CoinJoin queue hash still need CHashWriter, but 1dd9e69ef66 had already moved the writer to HashWriter and removed the explicit stream arguments from the queue hash. f646a082dc5 lists peer-version parameters and the Dash receive-handler migration as TODOs, although 25c01740b8e, 629f187f247, and e0b77f29d70 precede it. 46598db37f9 repeats that stale P2P prerequisite, even though its separate CKeyPool and SpanReader dependencies are still real at that point. Update only the Dash backport notes to distinguish completed preparation from the hunks still deferred.
source: gpt-6.2-astra (phase2-reviewer: general, backport-reviewer, dash-core-commit-history)
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:
criticalbygpt-6.2-sol(effort low) — This broad serialization refactor changes peer-facing deserialization in src/governance/vote.h, where CGovernanceVote::Unserialize now relies on an explicit format parameter to enforce the network signature size limit. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-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; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-astra— general (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— backport-reviewer (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— dash-core-commit-history (completed, effort high); agentphase2-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/net_processing.cpp`:
- [BLOCKING] src/net_processing.cpp:819-824: Clang builds fail because the compact-block send paths leave `PushMessage` unused
Impact: The Linux multiprocess and TSan jobs stop compiling `net_processing.cpp` before their tests can run.
[Multiprocess](https://github.com/dashpay/dash/actions/runs/45885548529/job/140152747552) and [TSan](https://github.com/dashpay/dash/actions/runs/45885548529/job/140152747537) both report `error: unused member function 'PushMessage' [-Werror,-Wunused-member-function]` at line 820. Bitcoin #28892 (`c252a0fc0f4`) adds the helper and uses it for the prebuilt compact blocks in `NewPoWValidBlock` and `SendMessages`; Dash added the helper but kept direct connman sends at lines 2346 and 6578. Apply the upstream calls `PushMessage(*pnode, ser_cmpctblock.Copy())` and `PushMessage(*pto, std::move(cached_cmpctblock_msg.value()))` without rebuilding either message. The same backport also missed the `MakeAndPushMessage` conversions for `CFILTER`, `CFHEADERS`, and `CFCHECKPT` at lines 3559–3560, 3599–3604, and 3639–3643. Carry over those three conversions as well; they do not cause the build failure or change the payload bytes.
In `src/protocol_ser_params.h`:
- [BLOCKING] src/protocol_ser_params.h:17: Cppcheck rejects the new serialization format member because it has no initializer
Impact: The PR fails the Cppcheck job even though the current disk and network factory paths both set the format explicitly.
[Cppcheck job 140147205400](https://github.com/dashpay/dash/actions/runs/45885548529/job/140147205400) reports `Member variable 'ProtocolSerParams::fmt' has no initializer. [uninitMemberVarNoCtor]` and exits with code 1. This declaration comes from the Dash-specific adapter in `79f8a49e9cc`, not Bitcoin Core. A disk initializer satisfies the check without changing `PROTOCOL_DISK` or `Network(version)`. A `constexpr` constructor that requires a format is also an option if callers should always make that choice explicitly.
In `src/core_write.cpp`:
- [BLOCKING] src/core_write.cpp:190: The transaction JSON size still bypasses the accessor used by bitcoin#28438
Impact: The completion backport leaves RPC transaction size calculated separately from `CTransaction::GetTotalSize()`, although both report the same number today.
The `TxToUniv` hunk in bitcoin#28438 (`108462139b6`) changes the `size` field from a direct `GetSerializeSize` call to `tx.GetTotalSize()`. Dash kept the direct call and only removed its version argument. The accessor is already present and adapted to `TX_NO_WITNESS`, so using it lands the missing hunk without adding witness handling or changing the RPC result.
In `src/test/fuzz/block.cpp`:
- [BLOCKING] src/test/fuzz/block.cpp:10: Three fuzz targets still include the protocol-version header after their version reads are gone
Impact: The completed bitcoin#28451 backport leaves an unnecessary header dependency in the block, deserialize, and transaction fuzz targets.
Bitcoin #28451 (`ffb021612b8`) deletes `<version.h>` from all three targets when it removes their stream version reads. Dash's partial commit `3a9690b2706` renamed the includes, and the completion at `bf191deee44` removed the last version uses but kept the renamed headers. Drop `<node/protocol_version.h>` from `block.cpp:10`, `deserialize.cpp:20`, and `transaction.cpp:12` to carry over the omitted deletions.
In `src/test/util/llmq_tests.h`:
- [SUGGESTION] src/test/util/llmq_tests.h:105-110: The round-trip test does not check masternode diff bytes sent to older peers
Impact: A future layout change could break replies to still-supported peers while the current-version round-trip continues to pass.
The Dash migration changes how `CSimplifiedMNListDiff` selects its wire layout, but the round-trip helper uses `PROTOCOL_VERSION` for both writer and reader. The functional test decoder also expects the current version-first layout. Peers as old as 70221 can connect: the diff omits its version field below 70225, places it after `cbTx` in 70225–70228, and puts it first from 70229. Add a table-driven test in `evo_simplifiedmns_tests.cpp` that checks the expected bytes at those boundaries independently of the reader.
In `<commit:9818f1941a9>`:
- [SUGGESTION] <commit:9818f1941a9>:1: The serialization stack conflicts with its declared dependency #8243
Impact: Integrating this stack with the current head of #8243 requires resolving conflicts in 12 files.
The stack merges cleanly with `develop` at `42e2c2d4c66`, but `git merge-tree` against #8243 head `92e73e1f648` reports conflicts in 12 files, including `src/serialize.h`, `src/hash.h`, and `src/net_processing.cpp`. The branches carry separate copies of several backports, including `9818f1941a9` versus #8243's `fea92cf154a` for bitcoin#28878. Once #8243 lands, rebase the completion stack onto the landed dependency and drop the parallel copies. The other declared dependency, #8255, is already an ancestor.
In `<commit:f646a082dc5>`:
- [SUGGESTION] <commit:f646a082dc5>:1: Three partial-backport notes describe completed Dash migrations as pending
Impact: Maintainers reading the commit history get the wrong explanation for which prerequisites held up each completion commit.
`e8176c75ba8` says `SigHashWriter` and the CoinJoin queue hash still need `CHashWriter`, but `1dd9e69ef66` had already moved the writer to `HashWriter` and removed the explicit stream arguments from the queue hash. `f646a082dc5` lists peer-version parameters and the Dash receive-handler migration as TODOs, although `25c01740b8e`, `629f187f247`, and `e0b77f29d70` precede it. `46598db37f9` repeats that stale P2P prerequisite, even though its separate `CKeyPool` and `SpanReader` dependencies are still real at that point. Update only the Dash backport notes to distinguish completed preparation from the hunks still deferred.
|
This pull request has conflicts, please rebase. |
… type and version [pre-backport] 1e241a8 refactor: use DataStream in the remaining Dash code (Konstantin Akimov) bcb2392 refactor: drop the unused stream version from BLS IES objects (Konstantin Akimov) 49213e1 scripted-diff: Use DataStream in most Dash code (Konstantin Akimov) ce0333d refactor: stop reading the stream version in two Dash P2P handlers (Konstantin Akimov) 60775cd refactor: hash and stream Dash objects without stream type and version (Konstantin Akimov) cc69ec6 refactor: choose the governance disk and network encodings by serialization parameter (Konstantin Akimov) ebd7cbf refactor: pass the peer protocol version of dsa as a serialization parameter (Konstantin Akimov) 9025a9f refactor: pass the peer protocol version of masternode list diffs as a serialization parameter (Konstantin Akimov) ec33c97 refactor: add ProtocolSerParams for Dash objects whose encoding depends on the peer (Konstantin Akimov) Pull request description: ## 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 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: - bitcoin#28508 (`CKeyPool` gets a fixed version), the rest of bitcoin#28438 (`CHashWriter`), bitcoin#28904 (`CAutoFile`), the rest of bitcoin#28892 (`CNetMsgMaker` becomes `NetMsg::Make()`, transports without version) and of bitcoin#28912 (`SpanReader`, wallet database streams), and bitcoin#28451; - the Dash tests that feed `PeerManager::ProcessMessage()` keep `CDataStream` until bitcoin#28892 changes that interface. ## 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: - [x] 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: 99bd28ab7af1faf4baf361e9e5e9919bc7e3a0a28d0ff6d8abe40d609d49a44164806ef17edc6f94b9910536ec9d2a8d09669b2ec47f2eb26dd92cbfb53604d7
…e version and type BACKPORT NOTE: only fa0ed07 (VectorWriter without nVersion) is backported, and CVectorWriter is kept next to it. Not backported: 66669da (Remove unused Make() overload), fa9b5f4 (NetMsg::Make() without nVersion) and fa79a88 (P2P transport without serialize version and type). They can't be done in full: Dash P2P messages are (de)serialized depending on the peer's protocol version and the stream type, which this PR removes from both the send path (CNetMsgMaker, CVectorWriter) and the receive path (CNetMessage::m_recv, V1Transport/V2Transport, vRecv): - evo/smldiff.h: MNLISTDIFF_VERSION_ORDER, BLS_SCHEME_PROTO_VERSION, MNLISTDIFF_CHAINLOCKS_PROTO_VERSION - evo/simplifiedmns.h: SMNLE_VERSIONED_PROTO_VERSION, DMN_TYPE_PROTO_VERSION - coinjoin/coinjoin.h: dsa flags gated by COINJOIN_REBALANCE_VERSION - llmq/net_quorum.cpp: request size check - primitives/block.cpp: CVectorWriter(SER_GETHASH, ...) for the X11 header hash Taking the PR as is would compile but drop that version gating on the wire. TODO: - move the version-dependent Dash serializers to a serialization parameter carrying the peer's protocol version (as upstream did for CAddress with CNetAddr::SerParams) and wrap those messages on send and receive; - switch the Dash message handlers (llmq, instantsend, chainlock, coinjoin, governance, evo, sync_manager: 45 declarations) from CDataStream& vRecv to the new stream type; - then backport 66669da, fa9b5f4 and fa79a88 and remove CVectorWriter. fa79a88 refactor: P2P transport without serialize version and type (MarcoFalke) fa9b5f4 refactor: NetMsg::Make() without nVersion (MarcoFalke) 66669da Remove unused Make() overload in netmessagemaker.h (MarcoFalke) fa0ed07 refactor: VectorWriter without nVersion (MarcoFalke) Pull request description: Now that the serialize framework ignores the serialize version and serialize type, everything related to it can be removed from the code. This is the first step, removing dead code from the P2P stack. A different pull will remove it from the wallet and other parts. ACKs for top commit: ajtowns: reACK fa79a88 Tree-SHA512: 785b413580d980f51f0d4f70ea5e0a99ce14cd12cb065393de2f5254891be94a14f4266110c8b87bd2dbc37467676655bce13bdb295ab139749fcd8b61bd5110 Co-authored-by: fanquake <[email protected]>
…thout nVersion BACKPORT NOTE: only the parts of fae76a1 (scripted-diff: Use DataStream in most places) whose streams don't need a version or type are backported: PSBT, transaction, block and compact-block streams in RPC, Qt, external signer and tests. From fac39b5 (SpanReader without nVersion) only the BitStreamReader type deduction in blockfilter and the golomb_rice fuzz target is backported; the BitStreamWriter deduction came with the partial bitcoin#28892. Not backported: - the rest of fac39b5, the SpanReader API itself: Dash still reads the stream type/version through SpanReader in psbt.h (SpanReader skey(s.GetType(), s.GetVersion(), key)), llmq/net_dkg.cpp (SpanReader over vRecv) and validation.cpp/rpc/blockchain.cpp; - the wallet database streams (wallet/db.h LoadFunc, wallet/walletdb.cpp, walletdb_tests): CKeyPool (de)serialization still reads s.GetVersion() and checks SER_GETHASH, which goes away only with bitcoin#28508; - the P2P parts, see the partial bitcoin#28892. TODO: - after bitcoin#28508 lands (CKeyPool hard-codes its version, SER_GETHASH removed), move the wallet database streams to DataStream; - after the P2P serializers stop reading the stream version (see the TODO of the partial bitcoin#28892), backport the rest of fac39b5 and drop the type/version from SpanReader. ---- fae76a1 scripted-diff: Use DataStream in most places (MarcoFalke) fac39b5 refactor: SpanReader without nVersion (MarcoFalke) Pull request description: The serialize version is unused, so remove it. This also allows to remove `GCS_SER_VERSION` and allows a scripted-diff to remove most of `CDataStream`. ACKs for top commit: ajtowns: ACK fae76a1 ryanofsky: Code review ACK fae76a1 Tree-SHA512: 3b487dba8ea380f1eacff9fdfb9197f025dbc30906813d3f4c3e6f1e9e4d9f2a169c6f163f51d135e18af538be78e2d2b13d694073ad25c5762980ae971a4c83 Co-authored-by: fanquake <[email protected]>
…ersion in CKeyPool serialize BACKPORT NOTE: Dash keeps SerializeHash(), on HashWriter since the partial bitcoin#28438, and drops its overload that took a stream type. CKeyPool writes 240100, the Dash counterpart of 259900, like CDiskBlockIndex::DUMMY_VERSION. The Dash SpanReader users in validation.cpp, rpc/blockchain.cpp and llmq/net_dkg.cpp drop the stream type; the X11 block header hash and the Dash tests that built a CVectorWriter with a type use VectorWriter, which came with the partial bitcoin#28892. Dash has no signet.cpp and no script_assets_test_minimizer fuzz target. ---- fac29a0 Remove SER_GETHASH, hard-code client version in CKeyPool serialize (MarcoFalke) fa72f09 Remove CHashWriter type (MarcoFalke) fa4a9c0 Remove unused GetType() from OverrideStream, CVectorWriter, SpanReader (MarcoFalke) Pull request description: Removes a bunch of redundant, dead or duplicate code. Uses the idea from and finishes the idea bitcoin#28428 by theuni ACKs for top commit: ajtowns: ACK fac29a0 kevkevinpal: added one nit but otherwise ACK [fac29a0](bitcoin@fac29a0) Tree-SHA512: cc805e2f38e73869a6691fdb5da09fa48524506b87fc93f05d32c336ad3033425a2d7608e317decd3141fde3f084403b8de280396c0c39132336fe0f7510af9e Co-authored-by: fanquake <[email protected]>
BACKPORT NOTE: completes the partial bitcoin#28438 with the rest of a0c254c (Drop CHashWriter), now that no Dash serializer reads the stream type or version and bitcoin#28508 is in. ---- a0c254c Drop CHashWriter (Anthony Towns) c94f7e5 Drop OverrideStream (Anthony Towns) 6e9e4e6 Use ParamsWrapper for witness serialization (Anthony Towns) Pull request description: Choose whether witness is included in transaction serialization via serialization parameter rather than the stream version. See bitcoin#25284 and bitcoin#19477 for previous context. ACKs for top commit: maflcko: re-ACK a0c254c 🐜 theuni: ACK a0c254c Tree-SHA512: 8fd5cadfd84c5128e36c34a51fb94fdccd956280e7f65b7d73c512d6a9cdb53cdd3649de99ffab5322bd34be26cb95ab4eb05932b3b9de9c11d85743f50dcb13 Co-authored-by: fanquake <[email protected]>
BACKPORT NOTE: the Dash block and undo record reads (RecordHeaderPos(), StoredBlockSizeField()) and their blockmanager_tests use AutoFile too. ---- 4eb2a9e streams: Drop unused CAutoFile (Anthony Towns) cde9a4b refactor: switch from CAutoFile to AutoFile (Anthony Towns) bbd4646 blockstorage: switch from CAutoFile to AutoFile (Anthony Towns) c72ddf0 streams: Remove unused CAutoFile::GetVersion (Anthony Towns) e63f643 streams: Base BufferedFile on AutoFile instead of CAutoFile (Anthony Towns) Pull request description: Continuing the move away from `GetVersion()`, replace uses of `CAutoFile` with `AutoFile`. ACKs for top commit: maflcko: re-ACK 4eb2a9e 🖼 TheCharlatan: ACK 4eb2a9e stickies-v: ACK 4eb2a9e Tree-SHA512: 1a68c42fdb725ca4bf573e22794fe7809fea764a5f97ecb33435add3c609d40f336038fb22ab1ea72567530efd39678278c9016f92ed04891afdb310631b4e82 Co-authored-by: fanquake <[email protected]>
…n and type BACKPORT NOTE: completes the partial bitcoin#28892 with 66669da, fa9b5f4 and fa79a88, and the netmessagemaker.h part of fa0ed07. The Dash messages whose encoding depends on the peer's protocol version pass it as ProtocolSerParams, so the stream version can go. Dash code moves from CNetMsgMaker to NetMsg::Make(), and to MakeAndPushMessage() inside PeerManagerImpl as upstream does; the Dash ProcessGetData() handlers no longer take a CNetMsgMaker. NetMsg::Make() keeps the Dash 4 KiB reserve. V2Transport keeps SetPeerVersion(), which Dash short message IDs use. ---- fa79a88 refactor: P2P transport without serialize version and type (MarcoFalke) fa9b5f4 refactor: NetMsg::Make() without nVersion (MarcoFalke) 66669da Remove unused Make() overload in netmessagemaker.h (MarcoFalke) fa0ed07 refactor: VectorWriter without nVersion (MarcoFalke) Pull request description: Now that the serialize framework ignores the serialize version and serialize type, everything related to it can be removed from the code. This is the first step, removing dead code from the P2P stack. A different pull will remove it from the wallet and other parts. ACKs for top commit: ajtowns: reACK fa79a88 Tree-SHA512: 785b413580d980f51f0d4f70ea5e0a99ce14cd12cb065393de2f5254891be94a14f4266110c8b87bd2dbc37467676655bce13bdb295ab139749fcd8b61bd5110 Co-authored-by: fanquake <[email protected]>
…ersion BACKPORT NOTE: completes the partial bitcoin#28912 with the rest of fac39b5 (the SpanReader API, also in the Dash readers in validation.cpp, rpc/blockchain.cpp and llmq/net_dkg.cpp) and the scripted-diff fae76a1, re-run on this tree. The wallet database streams can use DataStream now that CKeyPool does not read the stream version (bitcoin#28508). ---- fae76a1 scripted-diff: Use DataStream in most places (MarcoFalke) fac39b5 refactor: SpanReader without nVersion (MarcoFalke) Pull request description: The serialize version is unused, so remove it. This also allows to remove `GCS_SER_VERSION` and allows a scripted-diff to remove most of `CDataStream`. ACKs for top commit: ajtowns: ACK fae76a1 ryanofsky: Code review ACK fae76a1 Tree-SHA512: 3b487dba8ea380f1eacff9fdfb9197f025dbc30906813d3f4c3e6f1e9e4d9f2a169c6f163f51d135e18af538be78e2d2b13d694073ad25c5762980ae971a4c83 Co-authored-by: fanquake <[email protected]>
Since the previous commits these files use none of the protocol version constants; seven of them are upstream files whose upstream version does not include version.h. The masternode list headers, which use the constants, include it directly instead of getting it through hash.h. Prepares bitcoin#28451, which renames the header.
…TWORK, CDataStream BACKPORT NOTE: only fa98a09 (Rename version.h to node/protocol_version.h) and fa4fbd5 (Remove unused version.h include). The Dash includers of version.h move to node/protocol_version.h; psbt.cpp and test/fuzz/util.h keep it until their CDataStream goes. Not backported here: fa0ae22 (Remove unused SER_NETWORK, SER_DISK), fae00fe (Remove unused CDataStream) and fa7eb4f (fuzz: Drop unused version from fuzz input format), which need the remaining Dash CDataStream uses gone first; they follow after the Dash commits that convert them. ---- fa98a09 Rename version.h to node/protocol_version.h (MarcoFalke) fa4fbd5 Remove unused version.h include (MarcoFalke) fa0ae22 Remove unused SER_NETWORK, SER_DISK (MarcoFalke) fae00fe Remove unused CDataStream (MarcoFalke) fa7eb4f fuzz: Drop unused version from fuzz input format (MarcoFalke) Pull request description: Seems odd to have code that is completely dead. Fix this by removing all of it. ACKs for top commit: sipa: utACK fa98a09 ajtowns: ACK fa98a09 ryanofsky: Seems odd to not code review ACK fa98a09 (looks good) Tree-SHA512: 9f1b9d9f92bda0512610bda6653e892756f637860362a9abfa439faab62de233cbad94b7df78ebacc160d9667aadfed4d9df08c0edefa618c040a049050fb913 Co-authored-by: Ryan Ofsky <[email protected]>
Converts the Dash streams left in upstream files (CDBWrapper::CompactRange(), the bloom filter check in RPC, the InstantSend double-spend ZMQ notifier) and the Dash tests that fed PeerManager::ProcessMessage(), which takes a DataStream since bitcoin#28892. After this, CDataStream is only used where bitcoin#28451 itself removes it.
…DataStream BACKPORT NOTE: completes the partial bitcoin#28451 with fa0ae22 (Remove unused SER_NETWORK, SER_DISK), fae00fe (Remove unused CDataStream) and fa7eb4f (fuzz: Drop unused version from fuzz input format). Transactions and blocks keep TX_NO_WITNESS, and the Dash test data and bench block stay. The process_message fuzz target keeps the Dash connman receive path, which does not use CDataStream. psbt.cpp and test/fuzz/util.h drop the node/protocol_version.h include fa4fbd5 removed, and the Dash net_tests streams and an evo snapshot comment that named SER_DISK follow. ---- fa98a09 Rename version.h to node/protocol_version.h (MarcoFalke) fa4fbd5 Remove unused version.h include (MarcoFalke) fa0ae22 Remove unused SER_NETWORK, SER_DISK (MarcoFalke) fae00fe Remove unused CDataStream (MarcoFalke) fa7eb4f fuzz: Drop unused version from fuzz input format (MarcoFalke) Pull request description: Seems odd to have code that is completely dead. Fix this by removing all of it. ACKs for top commit: sipa: utACK fa98a09 ajtowns: ACK fa98a09 ryanofsky: Seems odd to not code review ACK fa98a09 (looks good) Tree-SHA512: 9f1b9d9f92bda0512610bda6653e892756f637860362a9abfa439faab62de233cbad94b7df78ebacc160d9667aadfed4d9df08c0edefa618c040a049050fb913 Co-authored-by: Ryan Ofsky <[email protected]>
bf191de to
24ca2e1
Compare
|
No actionable comments were generated in the recent review. WalkthroughThis PR removes serialization type and version state from stream APIs and replaces version-bound message construction with Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested reviewers: Merge Risk:
|
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 2 only (queue backlog)
New on this head: The rebased series builds on #8243 and #8255 to finish the v27 serialization cleanup. It routes compact-block and compact-filter sends through the new helpers and preserves explicit serialization parameters for block import and peer replies. Lint, Cppcheck, and the completed source builds, including fuzz, passed; the ASan build, multiprocess lint, and test jobs are 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.
1 finding(s) not shown inline (the lines are not part of this PR's diff)
🟡 Suggestion: Three partial-backport notes describe completed Dash migrations as pending
Impact: A maintainer following the two remaining commit notes gets the wrong account of what still prevented the transport and reader conversions.
<commit:bcf7956d43c>:1
The two notes make it look as though completing the transport backport would still drop Dash’s peer-version gates. Before bcf7956d43c, #8255 had already moved CSimplifiedMNListDiff and CCoinJoinAccept to s.GetParams(), supplied the negotiated peer version at their call sites, and converted Dash handlers such as NetDKG::ProcessMessage to DataStream&. The note in d29ccfb1fdf repeats the stale serializer prerequisite. Update those two Dash notes to credit #8255 and distinguish its work from the transport, SpanReader, and wallet database conversions that were still pending at those commits.
source: gpt-6.2-astra (phase2-reviewer: general, backport-reviewer, dash-core-commit-history)
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); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.2-sol(effort low) — This cross-cutting refactor changes the peer-facing deserialization path by replacing the versioned receive stream in V2Transport::GetReceivedMessage (src/net.cpp) and removing negotiated-version assignment before message parsing in PeerManagerImpl::ProcessMessages (src/net_processing.cpp). - Phase 1 reviewers: not run (skipped for throughput: 26 PRs queued, above the 10 limit)
- Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-astra— general (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— backport-reviewer (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— dash-core-commit-history (completed, effort high); agentphase2-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 `<commit:bcf7956d43c>`:
- [SUGGESTION] <commit:bcf7956d43c>:1: Three partial-backport notes describe completed Dash migrations as pending
Impact: A maintainer following the two remaining commit notes gets the wrong account of what still prevented the transport and reader conversions.
The two notes make it look as though completing the transport backport would still drop Dash’s peer-version gates. Before `bcf7956d43c`, #8255 had already moved `CSimplifiedMNListDiff` and `CCoinJoinAccept` to `s.GetParams()`, supplied the negotiated peer version at their call sites, and converted Dash handlers such as `NetDKG::ProcessMessage` to `DataStream&`. The note in `d29ccfb1fdf` repeats the stale serializer prerequisite. Update those two Dash notes to credit #8255 and distinguish its work from the transport, `SpanReader`, and wallet database conversions that were still pending at those commits.
depends on:
Issue being fixed or feature implemented
Finishes the v27 serialization cleanup: after this,
CDataStream,SER_NETWORK,SER_DISK,SER_GETHASH,CHashWriter,CVectorWriter,CAutoFileandCNetMsgMakerare 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?
CKeyPoolwrites240100, the Dash counterpart of259900(asCDiskBlockIndex::DUMMY_VERSION). Dash keepsSerializeHash()onHashWriter.CHashWriter.AutoFiletoo.NetMsg::Make()(MakeAndPushMessage()insidePeerManagerImpl);ProcessGetData()handlers no longer take aCNetMsgMaker. Kept: the 4 KiB reserve inNetMsg::Make(),V2Transport::SetPeerVersion()for Dash short message IDs.SpanReaderwithout version, also in Dash readers; the scripted-diff is re-run on this tree, which now includes the wallet database streams.version.h->node/protocol_version.h), a Dash commit converting the last DashCDataStreamuses, then the removal itself.version.hincludes removed before the rename; the last DashDataStreamconversions.Dash has no witness, so
TX_WITH_WITNESSbecomesTX_NO_WITNESSand witness-only hunks are dropped; there is nosignet.cppand noscript_assets_test_minimizerfuzz target. Theprocess_messagefuzz 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;
CKeyPoolrecords now store a constant in a field that readers ignore.Checklist: