Commit Graph
221 Commits
Author SHA1 Message Date
DanSandClaude Opus 4.8 817c6b2d0e hygiene: Phase 5 — correct stale comments + name safe magic numbers
Fifth phase of the code-hygiene remediation, done per-file (18 files) via an
18-agent Workflow with strict guardrails. No consensus or security VALUES
changed (verified: pow/hush_utils/hush_bitcoind/net.h/crypter/stratum have
zero non-comment numeric changes); built clean, self-mined, verifychain=true.

Totals: 57 stale comments corrected, 46 user-facing branding fixes, 6
behavior-preserving named constants, 4 stratum warnings, 77 items deliberately
left (consensus/security values, copyright headers).

- Stale comments -> DragonX: corrected HUSH3/HUSH/Komodo/Equihash/Arrakis
  leftovers that misdescribed the active chain (pow AWT/lwma notes, txdb
  "Equihash solution" -> RandomX, wallet CLTV/overwinter/Sapling@1 notes,
  util datadir provenance, crypter's stale mapSproutSpendingKeys invariant).
  Replaced unprofessional/editorializing comments (profane TODOs, "developers
  are elite") with neutral technical notes, preserving the real design info.
- User-facing branding: dumpwallet header "created by Hush" -> "DragonX";
  RPC help text hushd/hush-cli/hushprivkey/hushaddress/Agama -> dragonx*;
  rebranded provably-dead "HUSH3" symbol-fallback literals to DRAGONX.
- Named constants (same values, non-consensus/non-security): addrman
  peer-selection factors (kChanceFactorGrowth/kChanceScale/deprioritize),
  sietch MIN_ZOUTS, an init notarization-DB cache size.
- Left the security macros (ECC/TFM_TIMING_RESISTANT=420, comment-clarified
  only), the consensus subsidy/commission literals + 128/129 TRANSITION
  (comment only), and copyright headers untouched.
- Added a prominent WARNING that the stratum server is Equihash-era and NOT
  updated for DragonX's RandomX PoW (flagged, not rewritten).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-27 15:19:22 -05:00
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 798eccc624 hygiene: fix seven latent defects from the v1.2.0 code audit
Phase 1 of the code-hygiene remediation. Each is a genuine defect, not
style. The two consensus functions are touched only by provably
behavior-preserving dead-code removal and a comment.

- miner: initialize the anti-spin loop counter (was `int i;` -- the loop
  condition read an indeterminate value, UB) and break once the block
  time advances past the median, which is what the comment intended.
- consensus/upgrades: drop a stray printf() on the NetworkUpgradeState
  path; the following assert already documents the invariant.
- txdb: CBlockTreeDB::Snapshot2's outer catch treated ANY exception as
  normal end-of-iteration and built a snapshot from partial data. Fail
  instead, matching the inner catch the author marked consensus-relevant
  ("we need to exit here if so for consensus code!"). iter->Valid()
  already handles genuine end-of-iteration.
- wallet/rpcwallet + init: -sietch-min-zouts used a "--" key that the arg
  parser (which normalizes --foo to -foo) can never match, so the Sietch
  decoy floor was silently stuck at the default. Use the single-dash key
  so the knob works, and document it in -help.
- hush_bitcoind + hush_utils: remove four unreachable duplicate `else if`
  branches from hush_commission()/hush_block_subsidy() (a second
  `height < 23860000` and a second `height < 27220000` in each). Proven
  identical across 49,591 heights. NB: the dead values hint at an intended
  clean halving schedule that was never wired up; the DEPLOYED schedule
  (two double-steps) is preserved exactly. Changing it is a future
  consensus decision, not this cleanup.
- hush_bitcoind: replace the "likely a bug" halving TODO with an accurate
  note -- INTERVAL is only consumed by a debug fprintf, so the > vs >=
  boundary at HALVING1 has no consensus effect.
- git rm two committed macOS build artifacts (cc/customcc.dylib and
  libcc.dylib) and add the missing .dylib .gitignore rules.

Built clean on Linux; an isolated node self-mined genesis->5113 exercising
the miner and consensus-subsidy paths, and getsnapshot returned normally.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-27 11:35:38 -05:00
DanSandClaude Opus 4.8 84aefb5475 Remove assumeutxo / UTXO-snapshot feature
Removes the dumptxoutset RPC, -loadutxosnapshot / -loadutxosnapshotunsafe,
the CCoinsViewDB Dump/LoadSnapshot machinery + CUTXOSnapshotHeader, the
AssumeutxoData chainparams anchor, the LoadSnapshotChainstate activation +
reorg-below-H guard, the persisted assumeutxo-height flag, and the gtest.

Rationale: it duplicated the existing bootstrap (same skip-the-genesis-grind
fast-sync, no speed advantage), its only real edge was a trust model we don't
need for this chain, and it was inert anyway (no published snapshot hash in
chainparams). The -loadutxosnapshot load path adopted an external UTXO set and
bypassed genesis validation, so removing it also drops that attack surface.
Builds clean (no dangling references); the kept IBD speedups (RandomX
pre-verify, adaptive dbcache, tlsmanager) are untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 16:42:37 -05:00
DanSandClaude Opus 4.8 1673cfb6dc IBD/sync speedups: parallel RandomX pre-verify, adaptive dbcache, P2P download fixes
- Parallel RandomX PoW pre-verification pool (CCheckQueue) run ahead of the serial
  connect; consensus-neutral (inline CheckRandomXSolution fallback still verifies
  anything not pre-verified). New -randomxverifythreads (default = -par).
- Adaptive dbcache: default sizes the UTXO/coins cache to most of RAM and shrinks
  under memory pressure, always leaving a reserve free; -dbcache pins a fixed value.
- P2P block download: bounded socket recv-drain loop (tlsmanager); frontier-block
  reassignment to break head-of-line stalls (-blockreassigntimeout); ProcessGetData
  serves a bounded batch of blocks per pass instead of one (fixes the serve-side
  one-block-per-tick throttle that caps download network-wide).
- assumeutxo: dumptxoutset RPC + LoadSnapshot machinery + AssumeutxoData chainparams.
- Signed bootstrap verification (util/bootstrap-dragonx.sh, util/sign-bootstrap.md).
- gtest: RandomX pre-verify consensus-equivalence test + UTXO-snapshot round-trip;
  revived the gtest harness (Makefile.am include fix, Makefile.gtest.include).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 12:30:10 -05:00
Duke aa69b87505 These are unrelated to ztxs and should be -debug 2025-08-22 21:21:15 -04:00
Duke 380875906d Remove more CC stuff 2024-09-22 09:40:37 -04:00
onryo 58b65f9670 Update copyrights 2024-02-27 23:59:59 +01:00
Duke cf1274a42a Remove unnecessary consistency checks
As per https://github.com/zcash/zcash/issues/6532 this should speed up
startup times by roughly 3X and drastically reduce disk i/o on startup.
2023-04-20 04:47:20 -07:00
Duke e8dc755f06 Reduce memory usage of CBlockIndex
Ported code from https://github.com/zcash/zcash/pull/6192 with various changes needed
for the Hush codebase.
2023-04-13 23:30:23 -04:00
Duke 98ee2a6a4f Declare various CBlockTreeDB methods as const
Ported from https://github.com/zcash/zcash/commit/fb66589022df4a0eff6ff244aa6b713c3a2bb2dd
which has some methods we do not yet have.
2023-04-05 19:24:30 -07: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 59fbcbb541 . 2021-09-01 22:34:21 -04:00
Duke Leto b30fae8238 clean up some more 2021-09-01 11:13:08 -04:00
Duke Leto 4a536d62dc Update copyrights 2021-04-17 13:03:22 -04:00
Duke Leto 1f4c4f27e6 Refactoring 2021-01-24 08:51:17 -05:00
Duke Leto b58c15b9fb update copyrights 2020-12-10 07:45:36 -05:00
Duke Leto fb1facc821 delete more sprout shite, faster syncing 2020-12-04 08:36:28 -05:00
Duke Leto be16f80abc Hush Full Node is now GPLv3
Any projects which want to use Hush code from now on will need to be licensed as
GPLv3 or we will send the lawyers: https://www.softwarefreedom.org/

Notably, Komodo (KMD) is licensed as GPLv2 and is no longer compatible to receive
code changes, without causing legal issues. MIT projects, such as Zcash, also cannot pull
in changes from the Hush Full Node without permission from The Hush Developers,
which may in some circumstances grant an MIT license on a case-by-case basis.
2020-10-21 07:28:10 -04:00
Duke Leto a7f88a87aa Update copyright URL to be https 2020-09-20 13:17:38 -04:00
Duke Leto 40f0745fab Track shielded spends on disk so we can calculate anonset in real-time correctly 2020-07-11 11:11:14 -04:00
Duke Leto 2134269e76 desprout 2020-06-03 00:12:54 -04:00
Duke Leto 28f5f51e5e Do not call BatchWrite* for sprout 2020-04-06 23:03:27 -04:00
Duke Leto 649fa9fa71 Improve zindex to track anonset 2020-01-01 22:45:01 -05:00
Duke Leto c4320775f7 Start using -zdebug so we don't scare normal users with all this output 2019-12-31 08:19:01 -05:00
Duke Leto a2e63618e4 Tone down our STDOUT debugging 2019-12-19 17:46:58 -05:00
Duke Leto 12e7c13a84 Change datatypes, do not use VARINT, increase exception logging 2019-12-19 00:10:52 -05:00
Duke Leto aef3f37b0f move new zindex stuff to the end of serialization and more logging 2019-12-18 15:20:31 -05:00
Duke Leto fbfdc8f40f Port zindex code from old patches; compiles and seems to work when zindex is disabled 2019-12-17 12:08:14 -05:00
Duke Leto a4f827faeb remove zindex stuff that should not be on this branch 2019-10-25 18:23:15 -04:00
Jonathan "Duke" Leto 2b3023444d Properly serialize/deserialize new blockindex with zstats 2019-08-17 12:46:40 -07:00
blackjok3r 9802d350aa bug fix 2019-05-04 01:55:33 +08:00
blackjok3rtt aa32b1f963 Merge pull request #107 from blackjok3rtt/jl777
add daily snapshot address to getsnapshot (top = -1)
2019-05-03 22:39:24 +08:00
blackjok3r ec185b7226 add daily snapshot address to getsnapshot (top = -1) 2019-05-03 22:36:58 +08:00
blackjok3rtt a9e350b8b6 Merge pull request #104 from blackjok3rtt/jl777
merge paymentsCC in
2019-05-02 20:29:08 +08:00
blackjok3r ed6fd7e8c6 attempt at daily snapshot 2019-04-27 02:21:40 +08:00
blackjok3r ab7558ab9d inital commit for notarypay 0BR 2019-04-17 17:42:24 +08:00
blackjok3r 2e2bb2b518 fix getsnapshot2 thanks to dimxy's advice. 2019-04-10 16:53:08 +08:00
blackjok3r 7c86c40d71 description comment 2019-04-07 23:54:44 +08:00
blackjok3r df118e7c8f fix json output 2019-04-07 23:16:25 +08:00
blackjok3r 6db2c41b51 inital commit for getSnapshot2 changes 2019-04-07 21:57:17 +08:00
jl777 e2ddb727d4 SnapShot2 2019-04-06 00:01:49 -11:00
jl777 3155223e51 Compiler errors 2019-04-05 21:17:53 -11:00
Jonathan "Duke" Leto 6398d6f054 Filter out amount=0 UTXOs from getsnapshot results 2019-03-09 14:52:49 -08:00
Jonathan "Duke" Leto 5c66b810d3 Prevent use of uninitialized ignoredAddresses 2019-03-09 07:50:53 -08:00
blackjok3r 6d17cb5dec oopps 2019-01-26 16:00:03 +08:00
blackjok3r 3da846ce85 Merge branch 'FSM' of https://github.com/jl777/komodo 2019-01-26 15:59:29 +08:00
jl777 07a05ccd6b -print 2019-01-25 01:27:55 -11:00
jl777 d682dfd830 +print 2019-01-24 03:42:27 -11:00