Commit Graph

193 Commits

Author SHA1 Message Date
e3247d946e cleanup: rebrand residual user-facing "HUSH" strings to DragonX
Sweeps the leftover coin-name strings in RPC help text, RPC output, and log
messages that the currency-unit change didn't cover:

- RPC help: "mining reward amount in HUSH" -> DRAGONX (mining.cpp x2);
  "at least minbal HUSH" -> DRAGONX (rpcwallet.cpp); "the HUSH address" /
  "(string) HUSH address" -> DragonX (rawtransaction.cpp)
- RPC output: the SMART_CHAIN_SYMBOL[0]==0 ? "HUSH" : SYMBOL coin-name fallback
  (crosschain/misc/mining/blockchain) -> "DRAGONX"; the notarizations JSON key
  make_pair("HUSH", ...) -> "DRAGONX"
- Logs: "HUSH blocktime changing", "stopping HUSH HTTP/REST/RPC",
  "HUSH raw magic=" -> DragonX

Left untouched (verified): the 82 "HUSH3"/ishush3 chain-symbol consensus checks;
hush_globals.h CURRENCIES[] price-oracle basket (internal lookup, dead feature
on DragonX); hush.h notarization debug printf; a commented-out cout in main.cpp.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 15:37:57 -05:00
4351d5b733 fix(nspv/wallet): bound nSPV request buffers + fix uninitialized fee / null-deref
hush_nSPV_fullnode.h: bound the REMOTERPC method strcpy and json memcpy to their
fixed buffers (method[64], json[11000]); add lower-length and memcpy-source bounds
to the UTXOS/TXIDS coinaddr[64] copies and the MEMPOOL handler. These paths
deserialize attacker-controlled request bytes -> stack overflow / OOB read. The
nSPV server is opt-in via -nspv_msg (off by default; DragonX uses lightwalletd).

rpc/blockchain.cpp: getchaintxstats null-checks pwalletMain (crash under -disablewallet).
wallet/rpcwallet.cpp: z_sendmany initializes nFee to the default miners fee (was read
uninitialized when no fee param supplied).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 15:56:09 -05:00
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
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
752590348b Fix sapling pool persistence and add subsidy/fees to getblock RPC
Lower SPROUT_VALUE_VERSION and SAPLING_VALUE_VERSION constants in
chain.h from upstream Zcash values (1001400/1010100) to 1000000.
When DragonX was rebranded from HUSH3, CLIENT_VERSION was reset from
3.10.5 to 1.0.0, falling below these thresholds. This caused
nSaplingValue to silently skip serialization, so the sapling pool
total reset to 0 on every node restart. Explorer nodes should reindex
once after upgrading.

Add subsidy and fees fields to the getblock RPC response so explorers
can display the correct 3 DRGX block reward separately from fees,
instead of showing the combined coinbase output as the reward.
2026-03-15 16:07:16 -05:00
Duke
04ec2be8c8 Add fullyNotified to getblockchaininfo and use it in tests 2025-08-22 13:17:36 -04:00
Duke
15b4378ff3 Remove unused code 2025-08-08 18:02:25 -04:00
Duke
51462777c8 Remove dead code 2025-07-24 09:07:44 -04:00
Duke
7e63e2f013 We call them HACs now 2025-06-27 05:32:12 -04:00
Duke
bd5f0103a8 Remove more cc code 2024-09-22 12:19:12 -04:00
Duke
3354d45fd3 Make getchaintxstats less noisy in debug log 2024-03-20 16:19:54 -04:00
Duke
8ff5e4aa5e Make getchaintxstats less noisy in debug log 2024-03-20 14:09:02 -04:00
onryo
58b65f9670 Update copyrights 2024-02-27 23:59:59 +01:00
Duke
5fa46e1d8d Delete more CCs #381 2024-02-10 21:46:36 -05:00
duke
95b4371aa4 Merge pull request 'Reduce memory usage' (#332) from reduce_memory into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/332
2023-10-25 15:11:51 +00:00
Duke
31a6b72caf Merge branch 'dev' into reduce_memory 2023-10-16 06:04:56 -04:00
Duke
bacc08e817 Remove sprout data from valuePools
This codebase does not support sprout, the data will always be zero/empty
and is essentially useless cruft, so we delete it.
2023-09-03 08:37:19 -04:00
Duke
b03c8f3108 Remove unused code 2023-06-17 21:31:05 -04: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
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
ce5c8a54e4 Make it work correctly 2022-02-16 09:10:11 -05:00
Duke Leto
c8430665f7 WIP RPC that doesn't quite work yet 2022-02-15 11:26:50 -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
3d4123ee88 Cleanup 2021-09-03 12:35:59 -04:00
Duke Leto
4fecf72ec8 Remove dead code 2021-09-02 15:01:58 -04:00
Duke Leto
ced3ba591d Fix coredump when running hush-cli during RPC warmup 2021-08-19 19:09:05 -04:00
Duke Leto
e829822041 logging to help debug window stats being wrong after restart 2021-06-26 12:27:38 -04:00
Duke Leto
4a536d62dc Update copyrights 2021-04-17 13:03:22 -04:00
Duke Leto
000ef4ac91 Keeping HUSH on the down low 2021-01-27 13:39:27 -05:00
Duke Leto
1f4c4f27e6 Refactoring 2021-01-24 08:51:17 -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
6fd41c3e75 nope nope 2020-12-10 06:55:37 -05:00
Duke Leto
895b624abd nope 2020-12-10 06:53:56 -05:00
Duke Leto
31fc4099df HUSH NSPV 2020-12-09 19:22:51 -05:00
Duke Leto
4f27af7545 Hush DPoW won't attack their own villages, lulz 2020-12-07 08:24:09 -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
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
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
d02fdd4fe5 I originally wrote this function and we call it Hush DPoW around here 2020-11-15 07:34:43 -05:00
Duke Leto
52240c64b1 Tweak test suite and rename to HUSH_INSYNC 2020-11-14 20:00:23 -05:00
Duke Leto
461c10db0e DPoW updates 2020-11-14 16:32:56 -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