128 Commits

Author SHA1 Message Date
chromatic
1cabf8dfb1 Change Bitcoin to Dogecoin in qa/ files
This changes all occurrences of `BITCOIN` to `DOGECOIN` and `bitcoind`
to `dogecoind` in all files in `qa/`. It does not change copyright
information.
2024-06-22 09:07:27 -07:00
Ricardo Velhote
69a7fc7cd6 [RPC] Add an uptime command that displays the amount of time that bitcoind has been running
Cherry-picked from: c07475294a

Resolved conflict:
- change path to qa\rpc-tests\uptime.py and qa\pull-tester\rpc-tests.py
- src\util.cpp

Manually executed:
- qa\rpc-tests\uptime.py: overridden setup_network(), skip connecting nodes
- doc\rpc-maturity.md: add uptime rpc

Co-Authored-By: danielw86dev <67072678+danielw86dev@users.noreply.github.com>
2024-04-02 13:37:27 +02:00
Patrick Lodder
7237da74b8
update inline copyright years
adds a line when no copyright for Dogecoin Core Developers exists
but the file has been edited by us, to the last year found in git
log, or extends the year range on an existing line when a file
has been modified since the year previously listed.

Excludes subtrees.
2024-02-25 13:12:26 -05:00
chromatic
c7f0d6d7d0
Merge pull request #3382 from patricklodder/1.14.7-walletnotify-test-2
qa: test walletnotify
2024-02-22 17:39:45 -08:00
chromatic
17e899d1c3 [QA] Check command-line arguments for test runner
Before this change, if you made a typo such as `-parellel-8` when trying to run
tests, you'd get a backtrace that's difficult to interpret. With this change,
you'll get a better error message and a non-zero exit code.
2024-02-18 14:00:54 -08:00
chromatic
9bbf8c8363
Merge pull request #3297 from alamshafil/getblockstats
rpc: Add getblockstats
2024-02-10 10:57:33 -08:00
alamshafil
4307c56951 rpc: Add getblockstats 2024-02-08 14:08:37 -05:00
Patrick Lodder
88b36f18cc
qa: test walletnotify
Tests 5 scenarios:
1. Notifying for a new transaction into mempool
2. Notifying again for a mined known transaction
3. Notifying for a reversal and subsequent remine
4. Notifying for a reversal and subsequent doublespend
5. Notifying for a transaction that wasn't in mempool first
2023-12-20 21:14:00 -05:00
Dakoda Greaves
dd2bc7261e
utiltime: refactor nMockTime and add getmocktime
-adds simple qa test to verify getmocktime works
2023-08-29 13:37:33 -07:00
alamshafil
714e586978
qa: Add getblock test 2023-08-03 00:16:56 -04:00
Patrick Lodder
87bd548807
Update copyright headers in files
Detected changes since fork from Bitcoin Core 0.14 and either
updated the Dogecoin Core developer copyright, or added a line
for it.

Script can be found at:

https://gist.github.com/patricklodder/210a449896ece9ca4a8f872328198e3f
2022-07-16 20:18:50 +02:00
Patrick Lodder
ae38534692
qa: add transaction download test
Tests 5 scenarios for transaction download scheduling:

1. Whether eventually, after a series of timeouts, all our peers
   that announced a transaction are sent a getdata request
2. Whether outbound peers are prioritized over inbound peers when
   a getdata request takes longer than optimal
3. That we honor the maximum in-flight capacity, that this is on
   a per-peer basis and that it resets itself after timeout
4. That when we have an inflight getdata request when a peer
   disconnects, we recover after the initial 30 second timeout
   and fetch the transaction from another peer
5. That we recover after a peer sends us a notfound message for
   a tx we had an inflight getdata request for.
2022-07-12 02:57:00 +02:00
chromatic
f74e27da05 Add rescan RPC command 2022-06-22 22:34:42 -07:00
Old Dip Tracker
5121eef492
Merge pull request #3003 from patricklodder/1.14.6-fix-p2p-policy
qa: harden the p2p-policy test
2022-06-21 10:34:54 -04:00
Patrick Lodder
f209f710af
qa: harden the p2p-policy test
the p2p-policy test has a number of issues because it is a real-
time relay test that can at the moment not be mocked and it is
insufficiently hardened against signature length variation.

This makes 2 changes to the test to make it more reliable:

1. Increase the maximum wait time for transactions to be relayed to
   2 minutes instead of 30 seconds. This gives us more certainty
   that the PoissonNextSend() function doesn't schedule outside of
   our window.
2. Whenever we sign a transaction with an unexpected signature
   length, retry constructing the transaction (with a different
   input). Fees are changed to be 100% exact.

Note that this makes the test potentially take a longer time to
complete, so we move it up in the list of the test runner, to
be triggered early.
2022-06-20 19:08:54 +02:00
Patrick Lodder
8c5dc302ba
net: constrain the memory usage of manually added nodes
Each node keeps a registry of manually added nodes (through the
addnode parameter, rpc call or UI) but there are currently no
limits imposed on that usage, which is a bit sloppy and can lead
to situations where memory is being used for storing addresses
that are never connected to, because the maximum number of
connections used for addnode entries is hardcoded as 8. This
could prevent smaller systems that host nodes (like those
running on an ARM SoC) to optimally use the available memory.

This enhancement limits the addnode functionality as follows:

1. Whenever over 799 nodes are added to the registry, require
   the user to remove an entry before a new one can be added
2. Disallow very large addresses (more than 256 characters).
   This limit provides for at least 4 levels of subdomains as
   specified under RFC1035.

See https://datatracker.ietf.org/doc/html/rfc1035#section-2.3.1
2022-06-20 01:54:31 +02:00
Old Dip Tracker
5eb3a70cdc
Merge pull request #2988 from alamshafil/liststucktx
Add an RPC method showing wallet transactions that are not in the mempool
2022-06-19 19:00:29 -04:00
Patrick Lodder
022bb18a78
qa: add test for liststucktransactions
Creates a wallet with stuck transactions and then tests the
liststucktransactions rpc method on that wallet
2022-06-17 11:20:38 -04:00
Old Dip Tracker
b3beca6cc4
Merge pull request #2758 from patricklodder/1.14.6-maxlocsz
net: Introduce a maximum size for locators
2022-06-17 08:05:37 -04:00
Patrick Lodder
231066d78d
qa: add tests for p2p addr messages
This creates a baseline for future work on addr messages
2022-06-06 11:59:07 +02:00
chromatic
d871cda81a Add RPC command to set max connections 2022-05-04 17:38:03 -07:00
Patrick Lodder
c93ea51273
qa: Add p2p_invalid_locator test
Adds a custom mininode implementation to test connects and
disconnects based on the number of allowed locators

Inspired by: fa85c985
Original Author: MarcoFalke <falke.marco@gmail.com>
2021-12-17 19:02:42 -04:00
MarcoFalke
cd0444871e
wallet: Avoid leaking locktime fingerprint when anti-fee-sniping
Cherry-picked from: fa48baf23

Conflicts:
- Missing chain().lock(), moved assignment until after locking
  cs_main.
- Different structure and version of test framework required:
  - Different block heights
  - Different way of documenting test steps
  - Removal of wallet check, our tests don't run without a wallet
2021-12-17 16:26:07 -04:00
Patrick
e90d4437a2
qa: add qa test for createauxblock 2021-10-30 15:59:45 -04: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
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
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
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
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
Ross Nicoll
9362186ba7
tests: Fix replace-by-fee values for Dogecoin 2021-07-25 19:48:53 +01: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
Patrick Lodder
294d408d70
pull-tester: don't hard depend on python 3.6
every script depends on "python3" not "python3.6"
2020-07-22 13:46:52 +02:00
Ross Nicoll
9c3a11b248 Clean up RPC tests (#1465)
* Enable full block tests
* Fix invalidblocktest
* Move watch only address funding to immediately before it's used, so node 0 doesn't spend the output before it checks it later.
* Fix `fundrawtransaction` tests and sanitize fee calculation at the same time
* Correct resolution of chain parameters when validating tx inputs, especially from previous coinbase transactions
* Set block versions on full block tests so that the generated blocks are AuxPoW compatible
2018-09-19 22:11:47 +01:00
Ross Nicoll
b6b5ee7502 Update RPC tests for Dogecoin (#1431)
* Make most of the RPC tests pass
* Add AUXPoW rpc tests
- Tests the auxpow rpc interface `getauxblock`
- Tests consensus constraints for auxpow:
  - Minimum block height
  - Valid scrypt proof of work
  - Foreign chain ID
2018-09-19 22:11:47 +01:00
Wladimir J. van der Laan
e87ce95fbd
Merge #9720: net: fix banning and disallow sending messages before receiving verack
d943491 qa: add a test to detect leaky p2p messages (Cory Fields)
8650bbb qa: Expose on-connection to mininode listeners (Matt Corallo)
5b5e4f8 qa: mininode learns when a socket connects, not its first action (Matt Corallo)
cbfc5a6 net: require a verack before responding to anything else (Cory Fields)
8502e7a net: parse reject earlier (Cory Fields)
c45b9fb net: correctly ban before the handshake is complete (Cory Fields)
2017-02-14 14:42:29 +01:00
Cory Fields
d9434918d2 qa: add a test to detect leaky p2p messages
This is certainly not exhaustive, but it's better than nothing. Adds checks
for:

- Any message received before sending a version
- Any message received other than version/reject before sending a verack

It also tries to goad the remote into sending a pong, address, or block
announcement.
2017-02-13 18:56:03 -05:00
Matt Corallo
66f861ade9 Add a test for P2P inactivity timeouts 2017-02-09 17:34:03 -05:00
Wladimir J. van der Laan
727a798360
Merge #9516: Bug-fix: listsinceblock: use fork point as reference for blocks in reorg'd chains
7ba0a00 Testing: listsinceblock should not use orphan block height. (Karl-Johan Alm)
ee5c1ce Bug-fix: listsinceblock: use closest common ancestor when a block hash was provided for a chain that was not the main chain. (Karl-Johan Alm)
2017-01-23 16:16:37 +01:00
mrbandrews
cc0243ad32 [RPC] bumpfee
This command allows a user to increase the fee on a wallet transaction T, creating a "bumper" transaction B.
T must signal that it is BIP-125 replaceable.
T's change output is decremented to pay the additional fee.  (B will not add inputs to T.)
T cannot have any descendant transactions.
Once B bumps T, neither T nor B's outputs can be spent until either T or (more likely) B is mined.

Includes code by @jonasschnelli and @ryanofsky
2017-01-19 11:29:29 -05:00
Karl-Johan Alm
7ba0a00aae Testing: listsinceblock should not use orphan block height. 2017-01-18 12:31:20 +09:00
Wladimir J. van der Laan
2ca9dcd5b9 test: Add test for RPC named arguments
Add RPC testcase for RPC named arguments.
2017-01-05 11:30:20 +01:00
Russell Yanofsky
d8c0b9f525 [qa] Add test for rescan feature of wallet key import RPCs
Covers importaddress, importpubkey, importprivkey, and importmulti RPCs.
2016-12-12 10:18:11 -05:00
Alex Morcos
e2184ccc1d Reorder RPC tests for running time 2016-12-03 15:46:33 -05:00
MarcoFalke
fab0f07dec [qa] rpc-tests: Apply random offset to portseed
This helps to skip over resources, which are blocked by regtest bitcoind
zombie nodes
2016-11-08 10:50:31 +01:00
Pedro Branco
cb08fdbf78 Add importmulti rpc call 2016-10-19 15:17:13 +01:00
Wladimir J. van der Laan
7f71a3c591
Merge #6996: Add preciousblock RPC
5805ac8 Add preciousblock tests (Pieter Wuille)
5127c4f Add preciousblock RPC (Pieter Wuille)
2016-10-18 21:36:38 +02:00