Ports qa/rpc-tests from 6 python3 files to 18. Ran every ported test against
the freshly built v1.3.0 dragonxd. Results, honestly:
PASS (1) getblocktemplate_proposals.py
NOT APPLICABLE (7) wallet.py, walletbackup.py, wallet_protectcoinbase.py,
wallet_listnotes.py, wallet_mergetoaddress.py,
getblocktemplate.py, wallet_shieldcoinbase.py
BLOCKED (4) wallet_sapling, wallet_nullifiers, wallet_persistence,
wallet_treestate
The "not applicable" seven are inherited Zcash/Hush-era tests that exercise
features DragonX deliberately removed. They assume transparent t->t value
transfer, but ASSETCHAINS_PRIVATE=1 (hush_utils.h:1826) makes sendtoaddress
and sendmany consensus-refuse; they assume Sprout joinsplits, which are gone
from the RPC layer entirely; and they hardcode Bitcoin economics (10 coin/block,
100-block maturity) against DragonX's 3 DRGX and COINBASE_MATURITY=1. They are
ported and left in place rather than deleted, but they cannot pass on this chain
without being rewritten around z_shieldcoinbase/autoshield.
Three framework fixes in test_framework/util.py, each of which broke every
multi-node test:
- initialize_chain() passed -connect=0, and init.cpp soft-sets -listen=0 when
-connect is present, so cache node0 never opened its p2p port and nodes 1-3
could never sync to it -- initialize_chain() hung forever in sync_blocks().
Now passes -listen=1 -bind=127.0.0.1 -dnsseed=0 explicitly (an explicit arg
beats SoftSetBoolArg) while keeping the cache nodes off the public network.
- cache cleanup removed files from <datadir> when dragonxd writes them one
level deeper into the net-specific <datadir>/regtest.
- set_node_times() did print("..." + t) with t an int -> TypeError.
- default binary paths corrected to src/dragonxd and src/dragonx-cli.
The four BLOCKED tests are blocked by a daemon assert, not by the port; see the
follow-up commit/report on BLOCK_VALID_CONTEXT.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FU87LdsJZiZkfq1eXubpeo
Follow-up to 5e0a70683, which got start_node() working. Three more
defects sat behind it:
- initialize_chain() builds the 4-node cache with its own daemon
invocation, which 5e0a70683 did not touch. It therefore still omitted
-regtest (so those cache nodes ran on MAINNET) and -asmap (so they
refused to start at all). Every test that uses the cache -- which is
most of the wallet suite -- died there.
- reindex.py and getblocktemplate_longpoll.py each carried a single
python2 print statement, which is the whole reason they would not even
parse under python3. Shebangs updated to match.
The suite still does not pass: initialize_chain hits a remaining py2
str+int concatenation, and getblocktemplate.py reaches a real test
assertion. Both are beyond this commit, but the harness now gets far
enough to start nodes, answer RPC and begin building the shared chain,
which it could not do before.
The integration suite has never run against DragonX. Six independent
defects stacked up, each only visible once the previous was fixed:
1. test_framework used python2 implicit relative imports
("from authproxy import ..."), removed in python3, so every test died
at import. Made explicit relative imports.
2. It wrote ZZZ.conf -- a Komodo assetchain convention -- while DragonX
reads DRAGONX.conf. The daemon therefore never saw the generated
config, fell back to mainnet defaults and tried to bind RPC 21769,
which on a seed node is already held by the real node.
3. start_node() was hard-wired for the -ac_name=ZZZ assetchain tests: it
took the RPC port from extra_args[3], passed extra_args[0] as argv[0]
of the CLI, and only wrote a config when extra_args[0] matched. Any
test that passes no extra args crashed on len(None). The generic path
now takes the port from rpc_port(i) -- the same helper
initialize_datadir() already used -- and drives the CLI with -datadir.
4. dragonxd refuses to start without an asmap file, which no test datadir
had. initialize_datadir() now provisions one.
5. -asmap relative paths resolve against the NET-SPECIFIC datadir, so a
copy in <datadir> is never found. Pass an absolute path.
6. Worst: -regtest was only ever set as "regtest=1" in the conf file,
which DragonX ignores. Every "regtest" node therefore ran on MAINNET:
real genesis, real seeds, real peers. An observed run synced 196,180
live blocks and 679MB into /tmp before the test timed out. -regtest is
now passed as a command-line flag, with -connect=0 so an isolated
regtest node stays off the public network.
With these, nodes start, RPC answers, and tests run to a real result.
They do not all pass yet -- getblocktemplate.py reaches an assertion --
but that is now a test outcome rather than a harness failure.
So much has changed since I originally got the RPC tests working many years ago,
most notably modern Linux distros don't even have a way to install python2 via
packages, you have to install from source. Continuing with python2 does not seem
like a good idea, so we begin migrating thigns to Python 3.
Currently running ./test.sh will successfully spin up a test chain but then
the test suite crashes when attempting to send an RPC request, which looks
to be caused by the test suite internals still expecting python2.
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.
* Remove voutsum check
* Teach RPC interface about dpow-enabled minconfs (#1231)
* Make minconfs dpow-aware in z_listunspent + z_listreceivedbyaddress
* Add dpow-related test files to test suite
* Add dpow simulation to regtest every 7 blocks
* Fix compiler errors
* Fix link error
* Fix stdout spam when running regtests
* Dpowminconfs for listreceivedbyaddress
* dpowconfs tests
* Start adding specific tests for dpowminconfs in listreceivedbyaddress
* Get dpowminconfs tests for listreceivedbyaddress working
* Add dpowminconfs to getreceivedbyaddress + listunspent
* Add test for listtransactions + getreceivedbyaddress support
* Reliably passing dpowminconf tests. We only check for notarized-ness now, not exact confirmation numbers, to avoid race conditions
* Poll for the expected notarization info before running further tests; add support for getbalance
* Migrate tx_height() to a place where asyncrpcoperation_sendmany.cpp can use it
* fix
* Teach GetFilteredNotes about dpowconfs
Many RPCs rely on this internal function, which now correctly uses
dpowconfs to filter by the minconf/maxconf parameters.
* Fix sendmany when using non-default minconf
* inline seems to make things happy
* cleanup
* Add some code to test z_sendmany, which points out https://github.com/jl777/komodo/issues/1247
* try this
* Use already calculated value of dpowconfs instead of calculating it again
* Cleanup .pack file
* Remove
* Remove .pack
Strictly speaking this is not a true deduplication; the test output will be
slightly different (due to inconsistent print statements) but I think this is
close enough.