Commit Graph
51 Commits
Author SHA1 Message Date
DanSandClaude Opus 4.8 81f803948c hygiene: Phase 6 (partial) — fix 7 verified bugs + quick-wins + dedup
From the Phase-6 structural scoping: land the verified behavioral bugs and
the safe quick-wins/dedups now; the large refactors (monolith splits, ~180
header globals) and consensus-adjacent items stay deferred. Built clean;
self-mined; verifychain=true.

BUGS (verified by reading the code):
- net.cpp CNode::Ban: a braceless `if (subNet.Match(...))` left
  `pnode->fDisconnect = true;` OUTSIDE the guard, so banning any one subnet
  marked EVERY connected peer for disconnect (dropped the whole peer set).
  Wrapped the two statements in braces. (LIVE, high severity.)
- rpcdump.cpp importwallet: the `!fGood -> throw "Error adding some keys"`
  check was trapped inside the `if (fRescan)` block, so importwallet with
  rescan=false silently reported success when key import failed. Hoisted the
  check before the rescan branch and cleaned the garbled braces/indentation.
- wallet.cpp CommitTransaction: ignored AddToWallet()'s return, so a failed
  disk-persist of a just-signed spend was swallowed while the tx broadcast.
  Now logs a hard error on failure.
- hush_nSPV_fullnode.h: the UTXOS branch declared `uint8_t filter` while the
  twin TXIDS branch uses `uint32_t filter`; dragon_rwnum switches on
  sizeof(filter), so the utxos path parsed only 1 of 4 wire filter bytes.
  Widened to uint32_t.
- asyncrpcoperation_sweep.cpp: LogPrintf("%s ... %s", one-arg) read a missing
  vararg; added the __func__ argument.
- rpcdump.cpp importprivkey: inner `auto secret_key` shadowed the outer
  uint8_t and changed the type into DecodeCustomSecret; dropped the shadow.
- rpcdump.cpp getrescaninfo: char[8] + sprintf("%.4f") overflows when the
  ratio >= 10.0 (transient reorg); widened to char[16] + snprintf.

QUICK WINS: removed the duplicate DRAGON_MAXSCRIPTSIZE #define; pinned the
dead HUSH3-branch NOTARISATION_SCAN_LIMIT_BLOCKS to 1440; fixed init typos
(fRequestShutdown, RPC warmup).

DEDUP: extracted the 19-line try/catch error-mapping block — copy-pasted
identically into all six async operations — into
AsyncRPCOperation::set_error_from_current_exception(), so the mapping is
edited in one place. Behavior-identical (verified all six blocks were byte-
identical first).

Deferred (endorsed by the scoping, better as their own PRs): addrman Select_
dedup, the pow.cpp powLimit helper (consensus file), the miner CreateNewBlock
lock-asymmetry, the wallet monolith splits, and the ~180-global / consensus-
retarget / Komodo-heritage work.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-27 15:55:00 -05: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 0cd2bafa3a Remove unused CLI options and update debian example config 2025-08-12 13:37:44 -04:00
Duke fc8c641cff Remove unused code 2025-08-08 21:58:39 -04:00
Duke 2b3f9ed33f Add -ac_clearnet=0 option so an entire chain can disable clearnet connection, instead of -clearnet=0 which only applies to a single node 2025-08-08 16:09:32 -04:00
Duke 7e63e2f013 We call them HACs now 2025-06-27 05:32:12 -04:00
onryo 58b65f9670 Update copyrights 2024-02-27 23:59:59 +01:00
Duke 51c5d03215 Fix notary code 2023-11-24 07:18:54 -05:00
Duke 620ca45efc Cleanup notary code 2023-11-22 09:48:09 -05:00
Duke 45a5d25230 Update next consensus hardfork to be block 1605555 on Dec 16th 2023 2023-11-22 08:00:26 -05:00
Duke 9f92bdd7dc Decentralized Devtax 2023-06-19 09:32:32 -04:00
Duke e033a2e6eb Update copyrights to 2023 2023-02-09 18:06:03 -05:00
Jonathan "Duke" Leto 005f1e00bc Update copyrights 2022-09-21 08:38:10 -07:00
Duke Leto 05cbc86a00 Fix bug where GetNextWorkRequired did not know about randomx 2022-07-01 13:43:51 -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 3d4123ee88 Cleanup 2021-09-03 12:35:59 -04:00
Duke Leto 085f28a067 Hush does not have elections 2021-09-03 11:44:22 -04:00
Duke Leto 4fecf72ec8 Remove dead code 2021-09-02 15:01:58 -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 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 2e31b7d2dc lol 2021-01-23 22:18:57 -05:00
Duke Leto fe95a524fa Hush dat mempool 2021-01-23 20:51:11 -05:00
Duke Leto 8f70c5c356 HUSHCC 2021-01-23 20:47:44 -05:00
Duke Leto cde6d33ad1 The term 'whitelist' is racist and so we choose to call this feature 'allowlist' 2021-01-10 10:46:22 -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 e4ffb34756 Next height 2020-12-16 04:51:11 -05:00
Duke Leto c2eec1f7a7 Remove Komodo interest code and various other improvements 2020-12-15 13:14:54 -05:00
Duke Leto b58c15b9fb update copyrights 2020-12-10 07:45:36 -05:00
Duke Leto 2b9e993c31 Hush Hush Hush 2020-12-10 06:51:02 -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 b9633591cd Test my node 2020-12-06 19:16:16 -05:00
Duke Leto b7398f812c Winners write the history books 2020-12-06 18:53:32 -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 aae0336733 Playin' dat Long Game with dat Longest Chain 2020-12-06 15:47:04 -05:00
Duke Leto 1f636f4d39 Me love you longest chain 2020-12-06 15:43:56 -05:00
Duke Leto 706c5204cb Hush DPoW notaries are proudly anon, where KMD notaries doxx themselves 2020-12-05 07:54:08 -05:00
Duke Leto a99de09a8b dpow tweaks 2020-12-05 07:52:19 -05:00
Duke Leto 609b223e90 Hush Equihash (N,K) implementation 2020-12-04 20:47:28 -05:00
Duke Leto 0bb1c12874 Hush mining threads 2020-12-04 19:36:24 -05:00
Duke Leto 6c70956f4f Remove -exchange option which jl777 used to steal from KMD miners and notary node ops 2020-12-04 19:31:03 -05:00
Duke Leto d1ed93a703 My voice is still my passport 2020-12-04 13:08:42 -05:00
Duke Leto 5d81cddcad Hush First All The Way 2020-12-04 09:52:41 -05:00
Duke Leto 75424936e3 Set new season + DPoW activation height to 340420
Hard fork heights must form a well-ordered set such that a < b, for every,
pair of heights listed in increasing order. There cannot be a fork height
which is less than a previous fork height, various boolean logic in deep
places will fail.

So we choose a height just after the z2z halving, approximately 9 hours
later at our new blocktime of 75 seconds.
2020-11-19 07:11:10 -05:00
Duke Leto c737c0dfaf We call them Hush Smart Chains around here 2020-11-15 11:54:06 -05:00