Skip to content

Detached555#184

Draft
l0rinc wants to merge 15 commits into
masterfrom
detached555
Draft

Detached555#184
l0rinc wants to merge 15 commits into
masterfrom
detached555

Conversation

@l0rinc
Copy link
Copy Markdown
Owner

@l0rinc l0rinc commented Jun 2, 2026

No description provided.

l0rinc added 15 commits June 2, 2026 12:20
Replace local fixture parsing, file reading, string replacement, and error-substring checks with existing helpers where the replacement is direct.

Leave stale SRD test additions from the old stack out of the rewrite; this commit only changes helpers used by tests that still exist on current master.
Use existing SplitString and prefix-removal helpers in parser paths where the old code was manually slicing the same strings.

Keep current master APIs intact while replacing only the local parsing primitives.
Replace manual prefix and suffix slicing with the existing string helpers in args, IPC, wallet, BIP32, and base encoding paths.

The replacements keep the same checked prefixes and accepted padding forms while removing local indexing code.
Replace manual one-off suffix and prefix slicing in script formatting, RPC help, Unix socket paths, byte units, atoi, and args parsing with the existing string helpers.

Add focused tests for the formatting and Unix socket cases whose trailing or stripped text is observable.
Replace small local from_chars hex-byte parsers with HexDigit where the code only needs two checked nibbles.

The kernel and bitcoin-chainstate helper now reject odd-length input before reading the second nibble, matching the invalid-input path instead of depending on the old loop bounds.
Use Join or Cat in formatting paths where the old code only handled separators or appended one local vector.

Keep side-effecting and loop-carried formatting paths out of this rewrite so the helper use remains a direct replacement.
Replace local duration count conversions with existing helpers in time, networking, mempool, and focused tests.

Skip the stale fuzz-duration overload from the old stack because current master already has a templated ConsumeDuration helper.
Replace cache-size multiplications in DB and index tests with the existing MiB literal so the intended unit is explicit.

Only the include context needed adjustment while rebasing; the dropped txindex shutdown reproducer's time include was not carried forward.
Use existing overflow helpers where the code was open-coding saturated length addition or checked compact-block delta accumulation.

The focused base58 assertion pins the saturated length behavior touched by this cleanup.
Reuse ClearShrink, EncodeHexTx, and ToByteVector in paths that were spelling out equivalent vector or transaction-hex construction.

Keep the changes scoped to direct replacements; broader helper rewrites are left out when the call sites become less direct.
Use existing byte-vector and byte-span helpers in PSBT, descriptor/signing, script, and ASMap code where they directly replace manual byte range construction.

Only direct production replacements are carried from the old stack; broad test-only byte churn is left out.
Use MakeByteSpan and MakeWritableByteSpan where the code was manually constructing equivalent byte spans for obfuscation, random output, and wallet migration parsing.

The include conflict was resolved to the span dependency needed by the retained helper use.
Use existing span and Vector helpers in script, streams, validation, and tx download code where they replace local one-element or byte-span construction.

Keep the changes as direct expression rewrites without introducing new helper layers.
Use byte span helper wrappers in serialization and solver code where they replace manual byte pointer or one-element vector construction.
Replace repeated unsigned-char pointer casts with UCharCast in serialization, hashing, random-env, and kernel wrapper boundaries.

This keeps the cast points explicit while removing local reinterpret_cast spelling.
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