Commit Graph
49 Commits
Author SHA1 Message Date
DanSandClaude Opus 5.5 a2348515a2 Remove Hush Arrakis Chain (HAC) wording; delete dead launcher scripts
User-visible text:
- validateaddress help: "the given DragonX address" / "The DragonX
  address validated".
- getblockmerkletree help and error: "a given block height" / "Invalid
  block height parameter".
- ContextualCheckBlockHeader debug log: "HAC nbits" -> "nbits".

Comments and docs: HAC / Arrakis chain -> "smart chain" or "chain"
(src, contrib, util, doc/DEVELOPING.md, doc/randomx.md); the HAC and
Arrakis lines in doc/relnotes/README.md and contrib/debian/changelog
say "smart chain". Older "Hush Smart Chain" history is left as is.

Dead scripts removed: src/hush-arrakis-chain(.bat), src/smartchains and
src/sc/{koolaid,kush,zex}. They all start ./hushd, which the build no
longer produces, and none is in the release archive or the deb package.
The Dockerfile symlink to the launcher is dropped, and the rpc-test
framework defaults to src/dragonxd like util.py already does.

README: P2P port is 21768 (what the network and contrib/seeds use),
not 18030.

No identifiers, options (-ac_*), consensus code or licence headers are
changed. The miner.cpp change is a comment only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 22:14:37 -06:00
DanSandClaude Opus 4.8 6b67fc0e8e hush_checkPOW: verify RandomX at the recovered height on the peer-accept path
A block arriving over P2P reaches ProcessNewBlock(0,0,...) (the net BLOCK
handler), and both CheckBlock() calls on that accept path -- in
ProcessNewBlock and in AcceptBlock -- pass fCheckPOW=0, so CheckBlockHeader's
RandomX check never runs there. The only real-height PoW gate before the
block becomes a setBlockIndexCandidate is hush_checkPOW(0,pblock,height), and
for a peer block height is 0: CheckRandomXSolution ran at height 0 (where
RandomXValidationRequired is false, so it is skipped), the real height was
then recovered from hashPrevBlock, but RandomX was never re-checked.

So a block with a forged RandomX solution (only a grindable SHA256 target)
could become a candidate with its RandomX never verified at its real height,
and trip the MAX_REORG_LENGTH reorg guard before the connect-time check would
reject it -- the cheap half of the reorg-shutdown DoS.

Re-run CheckRandomXSolution at the recovered height before returning. It is a
no-op wherever the first call was (algo gate, activation height -- regtest is
far below it -- HUSH_LOADINGBLOCKS during IBD/reindex, the last in-index
checkpoint, and the thread-local miner self-check skip), so it only adds one
light-mode verification on the height==0 peer-accept path, which previously
did no real-height RandomX work at all.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-28 17:05:03 -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
DanS 85c8d7f7dd Rebrand hush3 to DragonX and share RandomX dataset across mining threads
Minimal rebrand (see compliant-rebrand branch for full rebrand):
- Rename binaries: hushd/hush-cli/hush-tx → dragonxd/dragonx-cli/dragonx-tx
- Default to DRAGONX chain params without -ac_* flags (randomx, blocktime=36, private=1)
- Update configure.ac: AC_INIT([DragonX],[1.0.0])
- Update client version string and user-agent to /DragonX:1.0.0/
- Add chainparams.cpp with DRAGONX network parameters
- Update build.sh, miner.cpp, pow.cpp for DragonX
- Add bootstrap-dragonx.sh utility script
- Update .gitignore for release directory

Share single RandomX dataset across all mining threads:
- Add RandomXDatasetManager with readers-writer lock, reducing RAM from
  ~2GB per thread to ~2GB total plus ~2MB per thread for the VM scratchpad
- Add LogProcessMemory() diagnostic helper for Linux and Windows
2026-03-04 18:42:42 -06:00
DanS d6ba1aed4e Fix RandomX validation exploit: verify nSolution contains valid RandomX hash
- Add CheckRandomXSolution() to validate RandomX PoW in nSolution field
- Add ASSETCHAINS_RANDOMX_VALIDATION activation height per chain
  (DRAGONX: 2838976, TUMIN: 1200, others: height 1)
- Add CRandomXInput serializer for deterministic RandomX hash input
- Fix CheckProofOfWork() to properly reject invalid PoW (was missing
  SMART_CHAIN_SYMBOL check, allowing bypass)
- Call CheckRandomXSolution() in hush_checkPOW and CheckBlockHeader

Without this fix, attackers could submit blocks with invalid RandomX
hashes that passed validation, as CheckProofOfWork returned early
during block loading and the nSolution field was never verified.
2026-03-03 17:28:49 -06:00
Duke 04165e161a Explain more details about the burn address 2024-09-12 13:40:30 -04:00
Duke 25f2ccb30e Document exactly what the RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPVMY address is and how it is derived 2024-09-11 14:53:33 -04:00
Duke d1991e6454 It is called hush-arrakis-chain now 2024-03-15 15:14:26 -04:00
Duke 65c4c5c8de They are called Hush Arrakis Chains (HACs) now 2024-03-15 14:06:57 -04:00
onryo 58b65f9670 Update copyrights 2024-02-27 23:59:59 +01:00
Duke e5dc287d2f Cleanup 2023-12-27 20:35:11 -05:00
Duke d8840beb3b Remove unused code 2023-12-27 08:36:24 -05:00
Duke 0f5e291f9f Remove unused pubkeys variable 2023-12-27 08:35:50 -05:00
Duke 77ab75c01d Document hush_block2pubkey33() 2023-12-27 08:35:22 -05:00
Duke 43aa4a7d90 Create a local variable instead of modifying the global ASSETCHAINS_SCRIPTPUB 2023-12-25 14:05:05 -05:00
Duke 901152cc50 Also log incoming script when we see an incorrect coinbase pubkey 2023-12-03 23:31:16 -05:00
Duke 429e25a3de Log ASSETCHAINS_SCRIPTPUB to stderr when we see an incorrect coinbase pubkey 2023-12-03 18:51:55 -08:00
Duke 620ca45efc Cleanup notary code 2023-11-22 09:48:09 -05:00
Duke 5cf38dd5db Merge branch 'dev' into danger 2023-10-13 09:27:38 -04:00
Duke 1c45a71b05 Remove dead code 2023-09-03 08:52:28 -04:00
Duke e2521ac2fa Remove unused sproutfunds argument 2023-09-03 08:48:06 -04:00
Duke 479ed54ff0 Add devtax address and scriptpub to getblocktemplate output 2023-06-23 09:13:11 -04:00
Duke 9f92bdd7dc Decentralized Devtax 2023-06-19 09:32:32 -04:00
jahway603 e1d6f7dd0e successfully built in Arch Linux with gcc12 2023-04-04 12:53:46 -04:00
jahway603 7f09d37cd4 reverted deleted code 2023-04-04 09:34:16 -04:00
jahway603 bb7cb253c1 miodrag patches to help get gcc12 building hushd 2023-04-03 22:23:30 -04: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 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 49713d8a04 Various things 2021-09-14 16:00:08 -04:00
Duke Leto 31fa46e2a1 Extra debug for notary stuff 2021-09-02 15:49:57 -04:00
Duke Leto 4fecf72ec8 Remove dead code 2021-09-02 15:01:58 -04:00
Duke Leto 8f7f445063 Remove dead code 2021-09-02 14:53:11 -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 59fbcbb541 . 2021-09-01 22:34:21 -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 5a3f5b4152 . 2021-07-10 14:05:20 -04:00
Duke Leto d7944252bb cleanup 2021-07-10 12:49:08 -04:00
Duke Leto dab4126a82 hush_makeopret 2021-07-10 12:30:34 -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 482990936f Cleanup 2021-01-23 22:30:56 -05:00
Duke Leto 01f4fae6a7 Add header file that got lost in the shuffle 2020-12-16 23:35:28 -05:00