Skip to content

backport: v0.26 bitcoin#25284 - #90

Open
DCG-Claude wants to merge 1 commit into
developfrom
backport-0.26-b079-misc
Open

DCG-Claude wants to merge 1 commit into
developfrom
backport-0.26-b079-misc

Conversation

@DCG-Claude

Copy link
Copy Markdown
Collaborator

Automated Bitcoin Core v0.26 backports, batch backport-0.26-b079-misc.

upstream commit gates notes
bitcoin#25284 5dbc35be59 pick:pass build:pass tests:warn mech:warn tree:pass verify:pass Backports bitcoin#25284, which replaces the ADDRV2_FORMAT version flag with serialization parameters (CNetAddr::V1/V2, W

Skipped in this batch:

Provenance

Each commit passed: cherry-pick (adapted by an Opus lane only where conflicts existed), build, touched tests, a mechanical diff-of-diffs check (every upstream hunk landed; no added line without an upstream counterpart), and an independent Opus verification lane where anything was adapted. Gate rows and lane artifacts are in the backportsys DB.

…erialization

fa626af Remove unused legacy CHashVerifier (MarcoFalke)
fafa3fc test: add tests that exercise WithParams() (MarcoFalke)
fac81af Use serialization parameters for CAddress serialization (MarcoFalke)
faec591 Support for serialization parameters (MarcoFalke)
fac42e9 Rename CSerAction* to Action* (MarcoFalke)
aaaa3fa Replace READWRITEAS macro with AsBase wrapping function (MarcoFalke)

Pull request description:

  It seems confusing that picking a wrong value for `ADDRV2_FORMAT` could have effects on consensus. (See the docstring of `ADDRV2_FORMAT`).

  Fix this by implementing bitcoin#19477 (comment) .

  This may also help with libbitcoinkernel, see bitcoin#28327

ACKs for top commit:
  TheCharlatan:
    ACK fa626af
  ajtowns:
    ACK fa626af

Tree-SHA512: 229d379da27308890de212b1fd2b85dac13f3f768413cb56a4b0c2da708f28344d04356ffd75bfcbaa4cabf0b6cc363c4f812a8f1648cff9e436811498278318

Dash adaptations:
- src/addrdb.cpp: DumpPeerAddresses keeps Dash's gArgs.GetDataDirNet() (upstream has args.) and drops the CLIENT_VERSION argument as upstream does
- src/net_processing.cpp: PushNodeVersion keeps Dash's nProtocolVersion, mnauthChallenge and m_masternode_connection fields; only addr_you and CService{} are wrapped in WithParams(CNetAddr::V1, ...) as upstream does
- src/serialize.h: Dash's HAVE_CONFIG_H/config/bitcoin-config.h include block kept; upstream's new #include <attributes.h> added after it
- src/version.h: Dash's own comment 'Make sure that none of the values above collide with `ADDRV2_FORMAT`' removed because ADDRV2_FORMAT no longer exists; all Dash protocol-version constants kept
- src/test/netbase_tests.cpp: the caddress_(un)serialize_v1/v2 tests sit elsewhere in Dash's file, so upstream's edits (DataStream + WithParams(CAddress::V1_NETWORK/V2_NETWORK, ...)) were applied to Dash's existing copies; Dash's LookupSubNet(...).IsValid() checks and NODE_NETWORK_LIMITED fixtures kept
- src/test/serialize_tests.cpp: upstream's new Base/Derived/WithParams tests appended after Dash's LIMITED_VECTOR tests; upstream's added #include <string> left out because Dash's include block already has it
- src/test/fuzz/deserialize.cpp: Dash's '*/' that closes the commented-out block_filter_deserialize target kept before upstream's new addr_info_deserialize FUZZ_TARGET; Dash's script/sign.h and util/system.h includes kept
- src/hash.h: upstream deletes CHashVerifier as unused, but Dash-only src/evo/snapshot.h (SnapshotBoundedInput::m_stream and the commitment bls_input) still uses it and reads GetType/GetVersion through it, so the class is kept unchanged; the HashedSourceWriter -> HashWriter change is applied as upstream
- src/evo/netinfo.h (Dash-only): NetInfoEntry used OverrideStream with |ADDRV2_FORMAT, which no longer exists; it now uses WithParams(CNetAddr::V2, service) directly on the stream. MnNetInfo serialized CService on streams without ADDRV2_FORMAT and now uses WithParams(CNetAddr::V1, ...), including in the CSizeComputer size override. Wire and disk bytes are unchanged
- src/evo/deterministicmns.h (Dash-only): GetUniquePropertyHash<CService> switched from ser_version |= ADDRV2_FORMAT to SerializeHash(WithParams(IsAddrV1Compatible() ? CNetAddr::V1 : CNetAddr::V2, v)), with non-CService types in the else branch of the if constexpr; the hash input bytes are identical, so the unique-property map stays compatible. CSerAction{Serialize,Unserialize} renamed to Action{Serialize,Unserialize} (upstream rename) in the immer-map SerReadWrite overloads and in CDeterministicMNList
- src/llmq/snapshot.h (Dash-only): CSerAction{Serialize,Unserialize} -> Action{Serialize,Unserialize} (upstream rename) in CQuorumSnapshot and CQuorumRotationInfo
- src/netfulfilledman.h (Dash-only): the netfulfilled.dat store serializes std::map<CService,...> keys on a stream without ADDRV2_FORMAT; it now uses READWRITE(WithParams(CNetAddr::V1, obj.mapFulfilledRequests)), so the on-disk format is unchanged

Not applicable to Dash (intentionally omitted):
- src/hash.h: Upstream's removal of the 'unused' CHashVerifier class does not apply: Dash-only src/evo/snapshot.h still uses it (SnapshotBoundedInput, commitment BLS input check), so the class is kept
- src/version.h: Upstream rewrites a comment to say values must not collide with SERIALIZE_TRANSACTION_NO_WITNESS; Dash has no segwit and no such flag, so only the obsolete ADDRV2_FORMAT comment line was removed
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

Potential PR merge conflicts

This is advisory only. It does not block CI, but it marks PRs that will likely need a rebase depending on merge order.

If this PR merges first

These open PRs will likely need a rebase:

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.

1 participant