Commit Graph
145 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 5.5 93f8b3768b rpc: read the peer list under cs_vNodes in getinfo/getnetworkinfo; z_getoperationstatus without cs_main
From origin/perf/wallet-scan-rpc-costs, both still on dev:

- getinfo and getnetworkinfo read vNodes.size() and iterated vNodes without cs_vNodes, racing the
  network threads that add and remove peers (a reallocation mid-iteration is undefined behaviour).
  Both now count through one helper that takes the lock.
- z_getoperationstatus and z_listoperationids took cs_main and cs_wallet, though they only read the
  async queue (which has its own mutex) and each operation's status. GUIs poll them, so every poll
  contended with block validation. Regtest: z_getoperationstatus reports a running sweep normally.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-20 20:10:01 -06:00
DanSandClaude Opus 5.5 c59b445ac1 zaddr: reject Sapling addresses that cannot receive funds
DecodePaymentAddress accepted any 43 bytes with a valid bech32 checksum.
An address whose diversifier has no valid g_d, or whose pk_d is not a
point in Jubjub's prime-order subgroup, can never receive a note, yet
z_validateaddress reported it as valid and z_sendmany queued the send.
The async operation then failed in TransactionBuilder::Build
("Invalid sapling note commitment!", surfaced as "Failed to build
transaction.") and took every other recipient in the batch with it.
A mining pool's payouts stalled for 10.5 hours on one such miner
address.

Add SaplingPaymentAddress::is_valid(), which runs
librustzcash_sapling_compute_cm: the same check the builder runs on
every output. DecodePaymentAddress now returns InvalidEncoding when it
fails. As a result:
- z_validateaddress returns isvalid:false for these addresses.
- z_sendmany fails up front with -8 "unknown address format: <addr>".
- Every other RPC and startup option that takes a zaddr rejects them
  through its existing invalid-address path.

The check is the builder's own, so it cannot reject an address the
builder would accept. Wallet-derived addresses are always valid, and
wallet.dat stores addresses in binary rather than decoding these
strings, so existing wallets are unaffected.

Tests: new gtest SaplingAddressValidity covers three real-world
unpayable addresses, constructed small-order, non-canonical, off-curve
and bad-diversifier cases, derived and hardcoded good addresses, and
is_valid() agreeing with SaplingNote::cm(). With the decoder check
reverted, 2 of the 4 tests fail. The full gtest suite passes (100/100),
and the change was verified end to end on regtest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 10:33:00 -06:00
DanSandClaude Opus 4.8 aff6101987 hygiene: Phase 2 — DragonX-authored cleanup (13 findings)
Second phase of the code-hygiene remediation, covering the items the
DragonX team introduced or the rebrand missed. No consensus behavior
changes; validated on a local self-mining node.

Log cruft:
- chainparams: route the startup ">>>>>>>>>>" banner and the port line
  through LogPrintf/LogPrint("net") instead of fprintf(stderr).
- pow: drop the fprintf(stderr) hash-mismatch dump that duplicated the
  LogPrintf copy verbatim.
- miner: gate the RandomXDatasetManager per-alloc/per-VM address dumps and
  MemDiag /proc reads behind LogPrint("randomx"); keep a one-line
  "allocated shared dataset (N GB)" summary at default verbosity.

Named constants (single source of truth in wallet.h):
- DEFAULT_AUTOSHIELD_FEE/INTERVAL, MIN_AUTOSHIELD_INTERVAL,
  DEFAULT_AUTOSHIELD_MIN_UTXOS, AUTOSHIELD_MIN/MAX_FEE for the autoshield
  option parsing and help text (were bare 10000/25/5 literals repeated
  across init.cpp and wallet.h).
- AUTO_OP_TARGET_HEIGHT_OFFSET replaces the three copy-pasted
  `blockHeight + 5` async-op scheduling offsets.
- AUTO_OP_EXPIRY_DELTA replaces the three per-file *_EXPIRY_DELTA=15
  constants (sweep/consolidation/autoshield) with one shared value.
- Move DEFAULT_AUTOSHIELD_FEE out of the op header into wallet.h so it no
  longer collides when both headers are included.

Error surfacing:
- init: report clamped/out-of-range -autoshieldinterval/-autoshieldfee via
  InitWarning() (surfaces to GUI/log) instead of fprintf(stderr).

Rebrand / dead foreign-chain code (approved removals):
- server: drop the HUSH3 special-cases in stop() and HelpExampleCli; the
  cli example now shows "dragonx-cli" instead of "hush-cli".
- getinfo (misc): remove the stale dPoW notarization block (notarized,
  prevMoMheight, notarizedhash, notarizedtxid, notarizedtxid_height,
  HUSHnotarized_height, notarized_confirms) — DragonX is a private chain
  from genesis with no active dPoW. Also fixes the hardcoded "HUSH3" that
  made getinfo query a foreign chain's notarization.
- delete the dead Komodo notary RPCs getera/getdragonjson/
  getnotarysendmany/geterablockheights (getera returned 0;
  getnotarysendmany was marked "this is broke") and their registrations.
- remove the dead ASSETCHAINS_EQUIHASH reporting branches in getinfo and
  getmininginfo — DragonX is RandomX-only.

chainparams: document why the upstream Equihash params and the literal
Bitcoin genesis are retained under RandomX (do not "fix" them).

Deferred: the hdSeedOrigin int->string switch in z_autoshieldstatus
(no shared helper exists to reuse; low value).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-27 12:24:04 -05:00
DanSandClaude Opus 4.8 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
DanSandClaude Opus 4.8 a520441e3a fix(rpc): guard z_validateaddress against null pwalletMain under -disablewallet
#11 (HIGH) z_validateaddress locked LOCK2(cs_main, pwalletMain->cs_wallet) with
no availability guard; under -disablewallet pwalletMain is NULL, so the member
deref SIGSEGVs the daemon (execute() only catches std::exception). Use the
null-safe LOCK2 idiom already used by sibling RPCs so validation still works
without a wallet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 11:21:28 -05:00
Duke 7e63e2f013 We call them HACs now 2025-06-27 05:32:12 -04:00
Duke f5cae3b403 getinfo rpc needs a cs_wallet lock
Without it we get an AssertLockHeld when calling GetKeyPoolSize .
We could probably make this lock apply to less code, possibly only
the single line that calls GetKeyPoolSize() needs it.
2024-09-13 04:37:48 -04:00
Duke 64f59552b3 They are called Hush Arrakis Chains (HACs) now 2024-03-15 13:32:46 -04:00
onryo 58b65f9670 Update copyrights 2024-02-27 23:59:59 +01:00
Duke b41785a684 Delete more CCs #381 2024-02-10 22:56:34 -05:00
Duke 620ca45efc Cleanup notary code 2023-11-22 09:48:09 -05:00
Duke e2521ac2fa Remove unused sproutfunds argument 2023-09-03 08:48:06 -04:00
Duke bd38a12512 Remove useless sprout key from coinsupply RPC 2023-09-03 08:40:06 -04:00
Duke e033a2e6eb Update copyrights to 2023 2023-02-09 18:06:03 -05:00
Duke Leto 1b7f200d29 Fix typo in getsnapshot docs 2022-12-01 14:55:53 -05:00
Duke Leto 9bd41875d7 Return getinfo algo as a single key 2022-07-12 23:20:57 -04:00
jahway603 f55b77f652 changed algo N & K to equihash N & K 2022-07-12 17:19:00 -04:00
jahway603 e6ec40190c algo now reflects N & K if equihash 2022-07-06 11:50:39 -04:00
jahway603 dfc3056ede algo twerking 2022-07-06 01:08:55 -04:00
jahway603 642ac9bda1 algo all day long 2022-07-06 00:12:13 -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 b30fae8238 clean up some more 2021-09-01 11:13:08 -04:00
Duke Leto e424a997a7 Cleanup 2021-08-26 00:08:37 -04:00
Duke Leto 63e1ede162 Also report work queue threads in rpcinfo 2021-08-09 11:51:25 -04:00
Duke Leto 236d79b3f8 Add rpcinfo rpc to debug deadlocks
We seem to have deadlock bugs in our RPC system, most likely inherited from ZEC or BTC.
Since some Hush RPC's take longer (such as anything with Sietch protections), the deadlocks
are more likely to occur. Eventually all RPC slots are used up and no more RPC commands
can be sent to hushd. This is why the "plz_stop" feature was implemented, but that is just
a workaround to restart the server. We must find and fix the root cause.

This rpc will allow us to see when we are getting close to our maximum work queue depth
and hopefully help us learn exactly what is happening.
2021-08-05 12:44:30 -04:00
Duke Leto 5a3f5b4152 . 2021-07-10 14:05:20 -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 482990936f Cleanup 2021-01-23 22:30:56 -05:00
Duke Leto 2e31b7d2dc lol 2021-01-23 22:18:57 -05:00
Duke Leto d5477ab3ab Disable build_date for now, which causes race condition bugs in the build system 2021-01-07 15:57:34 -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 c2eec1f7a7 Remove Komodo interest code and various other improvements 2020-12-15 13:14:54 -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 575e5351e5 fix compiler unhappiness 2020-12-10 06:56:46 -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 8db68f55c6 Cleanup 2020-12-07 08:21:38 -05:00
Duke Leto b7398f812c Winners write the history books 2020-12-06 18:53:32 -05:00
Duke Leto 6533b7740e update validateaddress help 2020-12-06 15:53:47 -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 62ddb079bc Remove JUMBLR dingleberries 2020-12-06 15:42:03 -05:00
Duke Leto c737c0dfaf We call them Hush Smart Chains around here 2020-11-15 11:54:06 -05:00
Duke Leto a23b0e8388 Remove the unsupported concept of staked notaries 2020-11-15 10:28:53 -05:00
Duke Leto 52240c64b1 Tweak test suite and rename to HUSH_INSYNC 2020-11-14 20:00:23 -05:00
Duke Leto ce3039d96c Delete the failed jl777 experiment called JUMBLR 2020-10-25 21:32:27 -04:00