Commit Graph
45 Commits
Author SHA1 Message Date
DanSandClaude Opus 4.8 cf15b0a399 hygiene: Phase 4 — route unconditional debug output through LogPrint
Fourth phase of the code-hygiene remediation, addressing the ~1,082 stray
fprintf(stderr)/printf debug calls so consensus and hot paths stop spewing
to stderr/stdout. Done per-file (18 files) with conservative rules; the tree
builds clean, self-mines, and `verifychain` re-validates the whole chain
(pow/txdb/coins/miner paths) with -debug=1 enabling every converted line —
zero tinyformat/format-arg exceptions.

Net across 18 files: 174 commented-out debug lines deleted, 173 unconditional
live prints converted to LogPrint("<cat>",...)/LogPrintf (net/mining/pow/nspv/
zrpc categories, format strings + args preserved exactly), 40 pure-noise or
sensitive prints deleted, and 194 calls DELIBERATELY LEFT (already behind
fDebug/fZdebug guards, or genuine startup/fatal-error output that must reach
the console before logging init).

Notable:
- Deleted sensitive success-path dumps (nSPV SIG_TXHASH + full tx input/
  output/change amounts; kvupdate privkey/pubkey hex) that were writing key
  and amount material straight to stderr/stdout.
- Removed the raw 32-byte target hex dumps in the zawy adaptive-PoW helpers
  and the legacy one-shot `if(height==340000)` HUSH artifact in pow.cpp.
- Converted per-tx relay + ban/banlist (net), per-setgenerate MININGTHREADS
  (rpc/mining), signrawtransaction TXPOW, and per-message nSPV traces.
- Left format/arg-mismatched lines untouched (flagged) to avoid introducing
  tinyformat runtime throws.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-27 15:02:01 -05:00
DanSandClaude Opus 4.8 fc06a43dd7 fix(consensus): bound OP_RETURN opretlen + clamp notary pubkeys array
Defensive-audit findings (adversarially verified + fleet stability-tested):

#4 (CRITICAL) hush_voutupdate trusted an attacker-decoded OP_RETURN length
(opretlen, up to 65535 via OP_PUSHDATA2) with no check against the real script
length, driving up to ~64KB out-of-bounds reads through hush_stateupdate ->
hush_eventadd_opreturn -> hush_kvupdate (persisted to disk, leaked via kvsearch
RPC, reliable crash on block connect). Reject any opret claiming more bytes than
remain in the script, at the single taint source.

#5 (HIGH) notary-ratification loop did memcpy(pubkeys[numvalid++],..) into a
fixed uint8_t[64][33] with no bound; >64 crafted vouts smashed the stack. Clamp
numvalid < 64.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 11:21:28 -05:00
DanSandClaude Opus 4.8 4a0a334649 fix(consensus): guard NULL pindex deref in hush_validate_chain (crash DoS)
hush_validate_chain() enters its body when hush_getblockindex(srchash) returns
NULL (via || short-circuit) -- srchash comes from an attacker-controlled
notarization OP_RETURN -- then a debug fprintf dereferenced the NULL pindex.
A block carrying one crafted OP_RETURN tx crashed every synced node on connect,
and crash-looped on restart. Guard the deref: pindex ? GetHeight() : -1.

Introduced by Leto commit 4988ce6f2 ("much debug such wow", 2022).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 15:56:09 -05:00
onryo 58b65f9670 Update copyrights 2024-02-27 23:59:59 +01:00
Duke 94500a6e39 Reduce stderr spam 2023-02-10 11:27:11 -05:00
Duke e033a2e6eb Update copyrights to 2023 2023-02-09 18:06:03 -05:00
Jonathan "Duke" Leto 5d2307a709 Update copyrights to 2022 2022-09-19 15:45:30 -07:00
Duke Leto 739fe4d1f3 Merge branch 'dev' into danger 2022-07-12 08:32:06 -04:00
Duke Leto 4988ce6f2e much debug such wow 2022-07-01 12:20:51 -04:00
Duke Leto 7859fdf7eb More debug 2022-04-23 10:00:35 -04:00
Duke Leto afe1cf153c Uncomment some dpow debugging 2022-04-21 22:35:21 -04:00
Duke Leto a157a5c6a1 update 2022-02-14 14:10:08 -05:00
Duke Leto 4f15626bb0 Cleanup 2021-09-16 14:24:27 -04:00
Duke Leto f22cbbf1e2 Cleanup and remove dead code 2021-09-16 14:12:31 -04:00
Duke Leto 085f28a067 Hush does not have elections 2021-09-03 11:44:22 -04:00
Duke Leto b4cf845bf3 New listaddresses RPC and z_exportwallet RPC now can be called during RPC warmup 2021-09-02 12:22:04 -04:00
Duke Leto b713f43487 Clean up dead code and cruft 2021-09-01 14:46:53 -04:00
Duke Leto e424a997a7 Cleanup 2021-08-26 00:08:37 -04:00
Duke Leto 7764d05261 . 2021-07-12 01:49:04 -04:00
Duke Leto fc52a00c37 hush_init 2021-07-10 12:27:30 -04:00
Duke Leto 4a536d62dc Update copyrights 2021-04-17 13:03:22 -04:00
Duke Leto cf57365698 Deletions and cleanups 2021-01-26 08:56:08 -05:00
Duke Leto 1f4c4f27e6 Refactoring 2021-01-24 08:51:17 -05:00
Duke Leto 2e31b7d2dc lol 2021-01-23 22:18:57 -05:00
Duke Leto 8f70c5c356 HUSHCC 2021-01-23 20:47:44 -05:00
Duke Leto 1a481f401c More cleaning and updates in prep for 3.6.0 2020-12-16 23:20:06 -05:00
Duke Leto e3a68dfdfb Hush is the extreme future, Komodo is the KYC past 2020-12-16 22:49:58 -05:00
Duke Leto 980350b9b4 Stuck in the grind 2020-12-16 22:10:59 -05:00
Duke Leto c2eec1f7a7 Remove Komodo interest code and various other improvements 2020-12-15 13:14:54 -05:00
Duke Leto 87370e1da8 remove some nasty-ass jl777 KMD interest code 2020-12-15 08:36:29 -05:00
Duke Leto 7aacd3dfce Merge branch 'syncbug' into dev
Conflicts:
	src/metrics.cpp
2020-12-11 00:35:14 -05:00
Duke Leto 5b07e01437 Various things 2020-12-11 00:33:56 -05:00
Duke Leto b58c15b9fb update copyrights 2020-12-10 07:45:36 -05:00
Duke Leto 31fc4099df HUSH NSPV 2020-12-09 19:22:51 -05:00
Duke Leto 6a30b40415 Once men turned their thinking over to machines in the hope that this would set them free.
But that only permitted other men with machines to enslave them.

      --  Reverend Mother Gaius Helen Mohiam
2020-12-09 07:23:08 -05:00
Duke Leto 12fabf7fd7 Hush signed masks 2020-12-06 21:57:02 -05:00
Duke Leto db702d6c55 The State Of Hush 2020-12-06 20:35:36 -05:00
Duke Leto d38ae7d82c Hush little baby 2020-12-06 18:55:25 -05:00
Duke Leto b7398f812c Winners write the history books 2020-12-06 18:53:32 -05:00
Duke Leto 467c8c37e3 Hush Is A Fast State Of Life 2020-12-06 17:09:12 -05:00
Duke Leto 54d3293db5 I Got The (Pub)Keys - https://www.youtube.com/watch?v=WjBQ7v6i4O4 2020-12-06 17:04:20 -05:00
Duke Leto bcc14df332 Hush Is Global 2020-12-04 13:06:57 -05:00
Duke Leto c737c0dfaf We call them Hush Smart Chains around here 2020-11-15 11:54:06 -05:00
Duke Leto ebf0df633b Define a new season of anon Hush DPoW notaries 2020-11-15 11:13:15 -05:00
Duke Leto a23b0e8388 Remove the unsupported concept of staked notaries 2020-11-15 10:28:53 -05:00