Commit graph

851 commits

Author SHA1 Message Date
Patrick Lodder d3d688deae
rpc: configure auxpow rpc methods to use Namecoin-compatible API
Allows easy integration with mining software that expects either
a "_target" (Namecoin) or a "target" (Dogecoin) field when
creating auxpow blocks using the -rpcnamecoinapi startup arg.

This saves pools effort in integrating the API they need whenever
a new Dogecoin Core release comes out.
2021-11-01 15:59:23 -04:00
Patrick 2291b6a7cc
rpc: cache aux block per scriptPubKey in createauxblock
- RPC caching source cherry-picked from: btccom@f4b613b2
- Adds addl test scenarios to createauxblock.py tests

Allows pool operators to run multiple sub-pools with different
target addresses from a single dogecoind instance. Without this
enhancement, subsequent calls to createauxblock with differing
addresses ignore the address given and instead just return the
block containing the address that initially triggered generation
of the cached block. This can quickly lead to unpredictable
results as race scenarios between sub-pools come into play.

Note that, like with getauxblock, the cache only resets on aux
block creation, not submission, so submitauxblock will accept
multiple submissions at the same height until createauxblock is
called, resulting in chaintip forks.

Co-Authored-By: leezhen <jasper.li@bitmain.com>
2021-10-30 15:59:46 -04:00
Patrick e90d4437a2
qa: add qa test for createauxblock 2021-10-30 15:59:45 -04:00
Patrick c3cead8737
[rpc] Add dustlimit info to getnetworkinfo 2021-10-28 16:24:33 -04:00
Dakoda Greaves 12202c61bb
qa: Updated pruning test to reflect changes in ca3a26df
The pruning test was outdated in that it was written to test BTC's 288
MIN_BLOCKS_TO_KEEP and 550 MiB MIN_DISK_SPACE_FOR_BLOCK_FILES.
To fix we recalculate arithmetic to accomodate our corresponding 1440
MIN_BLOCKS_TO_KEEP and 2200 MiB MIN_DISK_SPACE_FOR_BLOCK_FILES which
is representative as minimum val we can pass to configure a node to
automatically prune: -prune=2200.

Copied mine_large_blocks from 03d6d238 to speed up the test.

Separated the manual testing from the main test because the values
depend on Bitcoin configuration.
2021-10-19 17:10:42 -07:00
Ross Nicoll fdd1211cdd
Merge pull request #2616 from patricklodder/1.14.5-dustlimit-test
qa: Rework dustlimit test
2021-10-13 20:27:17 +01:00
Patrick Lodder b945c0b208
qa: Rework dustlimit test
Test both hard and soft dust limits for a range of configurations,
making sure that the dust limit parameters work as expected.

Currently implements commonly seen client configurations:
- a 1.10.0-like node that has only a 1 DOGE soft dust limit
- a 1.14.2-like node that has only a 1 DOGE hard dust limit
- a 1.14.5-like node that has a 0.01 soft and 0.001 hard dust limit
- a node that accepts everything standard

Other changes:
- renamed the test to better reflect the test subject
- made sure that all nodes reject non-standard transactions
2021-10-12 17:42:49 +02:00
Patrick Lodder 7739221064
fees: Require dust limit as dust penalty
Changes the dust policy to require transactions to add the dust
limit itself rather than the relay or wallet fee to the fees paid
when creating dust outputs.

This both disincentivizes dust outputs the same as before when dust
and minumum fee were equal and greatly simplifies the rule, as it
no longer requires 2 variables to calculate dust, but just one:

"If an output is under x, add x to the fee."
2021-10-12 02:47:23 +02:00
Ross Nicoll c338c5e6c4
Merge pull request #2606 from patricklodder/1.14.5-split-dust-parametrization
Split the dust definition 3-way to enable lower limits
2021-10-12 00:12:53 +01:00
Patrick Lodder a4d965547e
fees: set the wallet default discard threshold to 1 DOGE
As of writing, 97% of the relay network (for me: 2251 of 2328
peers) enforces a 1 DOGE hard dust limit making attempts to send
smaller outputs extremely unlikely to make it through to miners.

This setting is a temporary measure until a significant portion of
the network accepts lower dust thresholds. The threshold can be
changed by wallet users using the -discardthreshold parameter.
2021-10-10 22:07:12 +02:00
Patrick Lodder fd6da81954
wallet: introduce -discardthreshold
Creates a wallet-specific, configurable dust limit that enables
gradual implementation of the dust limit. Each transaction created
with the wallet will adhere to this threshold rather than the dust
limits used for relay, so that the wallet stays usable while the
network changes (lowers) its dust limits.

This change only implements the parameter but does not change its
default value.
2021-10-10 22:07:00 +02:00
Ross Nicoll 2799811ab1
Update fundrawtransaction.py to match Bitcoin originals
This revises the logic in fundrawtransaction.py to use the 20 small outputs
generated, as inputs to the next transaction. This matches how the original
worked, see https://github.com/bitcoin/bitcoin/blob/v0.14.3/qa/rpc-tests/fundrawtransaction.py#L556
2021-10-10 20:51:47 +01:00
Patrick Lodder c05cd54411
qa: Test relay and mempool policies for fees and dust
Creates a new functional test that ensures relay logic regarding
fee and dust levels
2021-10-10 20:35:54 +02:00
Patrick Lodder 56bc526b59
qa: facilitate MIN_CHANGE higher than COIN in tests
Some tests expect MIN_CHANGE to be less than COIN, which will not
be the case as long as the network enforces a 1 DOGE hard dust
limit.

wallet_tests.cpp: Multiply all inputs by 10 for tests that aren't
                  relative to MIN_CHANGE.

fundrawtransaction.py: make sure there are no outputs smaller than
                       1 DOGE.

importprunedfunds.py: Multiply all outputs by 100
2021-10-09 21:06:25 +02:00
Patrick Lodder 6003cdea85
qa: reduce wallet config impact on importprunedfunds.py
Changes client parametrization and mining frequency inside
importprunedfunds.py to make sure that when wallet configuration
changes, the test still can succeed, by not allowing it to respend
unconfirmed outputs that could otherwise be reused in this test.

The alternative would be to have to change this test every time the
wallet defaults change, which is not the subject of this test.
2021-09-27 21:15:42 +02:00
Patrick Lodder 16764d6e80
fees: Update MIN_CHANGE and document why
Updates MIN_CHANGE to always allow for a subsequent bump from the
change output using RBF or CPFP of at least 2x the recommended
minumum fee, on top of the dust limit, because the previous value
did not allow enough change for performing a CPFP bump, and only
allowed for a single bumfee call, which would spend the entire
change output rather than allowing for optimization.
2021-09-27 21:07:37 +02:00
Patrick Lodder dcc22f1696
qa: test for issues with MIN_CHANGE
Adds a test to bumpfee.py that tests the policy of MIN_CHANGE and
MIN_FINAL_CHANGE parameters when using RBF, making sure that with
the wallet default configuration, RBF can be performed. This test
fails on this commit.
2021-09-27 21:07:15 +02:00
Patrick Lodder c31ff0f095
wallet: change incremental fee for RBF
Sets WALLET_INCREMENTAL_RELAY_FEE to 1/10th of the default
recommended minimum fee, to encourage using RBF over CPFP and
saving the additional blockspace required for child transactions
spending parent transactions.

The previous value was based off a 1 DOGE recommended fee and did
not make sense with the current minimum fee recommendation.
2021-09-25 21:52:21 +02:00
Ross Nicoll 9c6af6d841 Reduce recommended fees
* Reduce DEFAULT_FALLBACK_FEE to 1,000,000 Koinu. Note this by itself has no effect as the required fee is higher.
* Reduce wallet minimum fees to 0.01 DOGE
* Update DEFAULT_DUST_LIMIT
* Revise derived values after updating recommended fees
* Remove fee rounding from RPC tests
* Revert tests back to Bitcoin originals where possible
2021-09-03 10:52:24 +01:00
Micael Malta 82ed8e0cc5 Change key derivation path to be correct for Dogecoin 2021-08-24 01:13:17 +02:00
Ross Nicoll 59da28cb06
Merge pull request #2458 from patricklodder/1.14.4-disconnect-bad-node-test
Test that peers building on invalid blocks get disconnected
2021-08-18 00:41:27 +01:00
Patrick Lodder caf26b77ab
fixup p2p-acceptblock and mininode to test disconnects
without partially backporting a new testframework.

- Adds a condition to NodeConn that when asyncore calls handle_read
  without any data, this must be a disconnect and closes the socket
- Adds a little loop in the p2p-acceptblock client that waits for
  the socket to be in a closed state
- Makes expected disconnects non-optional in p2p-acceptblock
- Syncs the test descriptions and outputs with reality
2021-08-17 20:15:30 +02:00
Dakoda Greaves fb194d7319
p2p-acceptblock: add steps 8, 9 to confirm node disconnects 2021-08-17 20:13:54 +02:00
Ed e90e8e5cba Create feelimit.py test
Create feelimit.py test to verify the updated fee values now rounding has been eliminated.
2021-08-17 08:51:18 +01:00
Ross Nicoll ce6e3d8137 Remove relay-only rounding
Remove rounding of transaction sizes when calculating fee minimums for relaying,
to simplify fee logic.
2021-08-17 08:50:42 +01:00
Patrick Lodder 07be86c147
qa: fix bumpfee now that paytxfee works 2021-08-16 00:17:20 +02:00
Patrick Lodder 2370fc5701
qa: add -paytxfee and -mintxfee interaction test
Test that the interaction between the wallet parameters
-paytxfee and -mintxfee function as intended. This has to
be done using rpc tests rather than unit tests because it
tests the actual parameters passed to the executables.
2021-08-16 00:16:51 +02:00
Patrick Lodder 1374bb47c2
Merge pull request #2450 from xanimo/1.14.4-txn_doublespend
qa: txn_dblspend - fix arithmetic
2021-08-14 21:19:15 +02:00
Dakoda Greaves 1c32538089 fix arithmetic; adds to standard testing 2021-08-13 19:12:16 -07:00
Patrick Lodder 6aff1141f4
qa: fix p2p-acceptblock
This test failed because the sheer number of blocks required to
trigger the max length of a fork we'd keep, exceed the v4 fork
height on regtest.

- Adapted the blocktools.py miner to mine 0x00620004 blocks as done
  elsewhere too (be it suboptimal, but at least consistent)
- Adapted the test to work with 1440 blocks (Dogecoin limit)
  instead of 288 (Bitcoin limit)
- Made p2p-acceptblock a standard test instead of an extended test
2021-08-13 03:44:02 +02:00
Michi Lumin f8813f8e13 fees: Reduce minimum relay fee to 0.001 DOGE, final change from tx to 0.01 2021-08-11 14:16:01 -06:00
Patrick Lodder 4c46af0483
[fees] introduce configurable hard dust limit
Co-authored-by: Ross Nicoll <rnicoll@rnicoll.name>
2021-08-05 18:24:17 +02:00
Michi Lumin 1d2380df56 p2p: Reduce BIP125 replace by fee increment value 2021-08-04 09:29:35 +01:00
xanimo 290faedcc3
tests: mempool_packages.py (#2433)
* Bump fee to 1.0000 from 0.0001 to fix insufficient priority error
2021-08-01 09:36:55 +01:00
Michi Lumin 575f734eec Initial back end framework to separate wallet and relay fees + dust. 2021-07-30 16:07:22 -06:00
Dakoda Greaves 7e541072ce update qa/README.md to reflect working installation instructions 2021-07-28 16:12:52 -07:00
Ross Nicoll 9362186ba7
tests: Fix replace-by-fee values for Dogecoin 2021-07-25 19:48:53 +01:00
rht 33b9f6cb5e
qa: Fix typos 2021-05-18 05:52:06 -04:00
Ross Nicoll 0fa6b5c912 Revert ltc_scrypt -> litecoin_scrypt 2021-02-08 09:05:07 +00:00
Ross Nicoll f9b9a591b8 Halve timeouts 2021-02-07 22:57:46 +00:00
Ross Nicoll a4638bb50f Adapt block download timeouts to Dogecoin
Block download timeouts are expressed as a fraction of block interval time, so Dogecoin values have been too aggressive.
Matching Bitcoin values as a starting point.
2021-02-05 23:36:38 +00:00
Daniel Edgecumbe 59dcceea58
[backport] [rpc] getblockchaininfo: add size_on_disk, prune_target_size, automatic_pruning
Fix pruneheight help text.
Move fPruneMode block to match output ordering with help text.
Add functional tests for new fields in getblockchaininfo.

Rebase-from: bitcoin#b7dfc6c4
2020-07-24 18:45:39 +02:00
Patrick Lodder 89c01f3866
rpc-tests: don't use binary.hex() or binary.fromhex()
To retain compatibility with multiple python3 versions
2020-07-22 13:51:27 +02:00
Patrick Lodder 31e6a818ec
rpc-tests: fix fundrawtransaction coin amounts to not spend dust 2020-07-22 13:51:16 +02:00
Patrick Lodder 9dced9cb98
rpc-tests: write credentials to dogecoin.conf, not bitcoin.conf 2020-07-22 13:51:08 +02:00
Patrick Lodder e3d075f710
rpc-tests: fix listtransactions to not spend dust 2020-07-22 13:51:00 +02:00
Patrick Lodder 01a71ec71d
rpc-tests: fix mempool_limit test
do more rounds of large tx creation to be sure to evict the
targeted tx
2020-07-22 13:49:54 +02:00
Patrick Lodder 022bcfb064
rpc-tests: fix importprunedfunds for use with dogecoin
- use non-dust outputs
- reverse the order of transactions to lowest-first, to not re-spend
  expected outputs for later tests.
2020-07-22 13:49:36 +02:00
Patrick Lodder d0afe42ed2
rpc-tests: fix auxpow calls to use .target instead of ._target
Tests weren't adapted to reflect RPC output
2020-07-22 13:49:05 +02:00
Patrick Lodder e896e90e6e
rpc-tests: revert from litecoin_scrypt to ltc_scrypt
This reflects the dependency installed in the dep script at
qa/pull-tester/install-deps.sh
2020-07-22 13:47:33 +02:00