Commit Graph

14 Commits

Author SHA1 Message Date
Ava Chow
9793fb1a87
Merge bitcoin/bitcoin#30340: test: Added coverage to Block not found error using gettxoutsetinfo
8ec24bdad89e2a72c394060ba5661a91f374b874 test: Added coverage to Block not found error using gettxoutsetinfo (kevkevinpal)

Pull request description:

  #### Description
  There were no tests that checked for the `Block not found` error called in `ParseHashOrHeight` when using `gettxoutsetinfo`, this change adds coverage to it.

  You can see there are no tests that do the following by doing the below
  `grep -nri "Block not found.*gettxoutsetinfo" ./test/functional/`

  which leads to no results

ACKs for top commit:
  achow101:
    ACK 8ec24bdad89e2a72c394060ba5661a91f374b874
  tdb3:
    ACK 8ec24bdad89e2a72c394060ba5661a91f374b874
  kristapsk:
    ACK 8ec24bdad89e2a72c394060ba5661a91f374b874
  brunoerg:
    crACK 8ec24bdad89e2a72c394060ba5661a91f374b874
  alfonsoromanz:
    Re ACK 8ec24bdad89e2a72c394060ba5661a91f374b874

Tree-SHA512: 2c61c681e7304c679cc3d7dd13af1b795780e85716c25c7423d68104e253d01271e048e21bc21be35dbc7ec1a4fde94e439542f3cfd669fe5a16478c5fa982ab
2024-10-26 19:14:06 -05:00
MacroFake
766c2c2757
Merge bitcoin/bitcoin#25034: test: add missing stop_node calls to feature_coinstatsindex and feature_prune
a3cd7dbfd8200c580aae9ea0f5473d58107dd582 test: stop node before calling assert_start_raises_init_error (Martin Zumsande)

Pull request description:

  In #24789, I forgot to stop the node before using `assert_start_raises_init_error` in `feature_coinstatsindex`. This resulted in a bitcoind process that is not being terminated after the test finishes.
  `feature_prune` has the same problem and also creates a zombie bitcoind process.

  Also adds an assert to `assert_start_raises_init_error` to make sure the node isn't already running to prevent this sort of mistake in the future.

Top commit has no ACKs.

Tree-SHA512: 902f683ebe7b19ca32ab83ca40d9698e9d91509b1d003f21a7221f79b647e05b6ef5c0c888fbb772cbca5e641d5c9437d522b6671f446c3ab321d79f7c6d0284
2024-10-09 13:44:32 +03:00
Kittywhiskers Van Gogh
f319163815
merge bitcoin#24789: disallow indexes when running reindex-chainstate 2024-10-05 17:09:34 +00:00
Kittywhiskers Van Gogh
dfeeb34d18
test: remove redundant sync after generate* calls in Bitcoin tests 2024-10-04 19:01:05 +00:00
Kittywhiskers Van Gogh
9b3fbdde10
merge bitcoin#23300: Implicitly sync after generate*, unless opted out 2024-10-04 19:01:05 +00:00
Kittywhiskers Van Gogh
7d3c3b4b64
merge bitcoin#22788: Use generate* from TestFramework 2024-10-04 19:01:00 +00:00
Kittywhiskers Van Gogh
234f22a72e
merge bitcoin#23037: fix confusing off-by-one nValue in feature_coinstatsindex.py 2024-09-30 09:03:26 +00:00
MarcoFalke
57b6fe7327
Merge bitcoin/bitcoin#22257: test: refactor: various (de)serialization helpers cleanups/improvements
bdb8b9a347e68f80a2e8d44ce5590a2e8214b6bb test: doc: improve doc for `from_hex` helper (mention `to_hex` alternative) (Sebastian Falbesoner)
191405420815d49ab50184513717a303fc2744d6 scripted-diff: test: rename `FromHex` to `from_hex` (Sebastian Falbesoner)
a79396fe5f8f81c78cf84117a87074c6ff6c9d95 test: remove `ToHex` helper, use .serialize().hex() instead (Sebastian Falbesoner)
2ce7b47958c4a10ba20dc86c011d71cda4b070a5 test: introduce `tx_from_hex` helper for tx deserialization (Sebastian Falbesoner)

Pull request description:

  There are still many functional tests that perform conversions from a hex-string to a message object (deserialization) manually. This PR identifies all those instances and replaces them with a newly introduced helper `tx_from_hex`.

  Instances were found via
  * `git grep "deserialize.*BytesIO"`

  and some of them manually, when it were not one-liners.

  Further, the helper `ToHex` was removed and simply replaced by `.serialize().hex()`, since now both variants are in use (sometimes even within the same test) and using the helper doesn't really have an advantage in readability. (see discussion https://github.com/bitcoin/bitcoin/pull/22257#discussion_r652404782)

ACKs for top commit:
  MarcoFalke:
    review re-ACK bdb8b9a347e68f80a2e8d44ce5590a2e8214b6bb 😁

Tree-SHA512: e25d7dc85918de1d6755a5cea65471b07a743204c20ad1c2f71ff07ef48cc1b9ad3fe5f515c1efaba2b2e3d89384e7980380c5d81895f9826e2046808cd3266e
2024-03-22 10:29:15 -05:00
MarcoFalke
7d601cfa85
Merge bitcoin/bitcoin#23681: test: Remove false coinstatsindex test
c055f6b216659b844c8dcd4ff2a977f181099678 test: Remove false coinstatsindex test (Fabian Jahr)

Pull request description:

  This test never actually tested the behavior that it describes in the comments. This was discovered in #21590 which seems to speed up muhash which lead to the test failing.

  I can vaguely remember that the described behavior was desired by some reviewers of `coinstatsindex`: That `coinstatsindex` should be aware of stale blocks and able to return statistics on them as well. The index actually does this for blocks that it sees while the index is active, i.e. while running `coinstatsindex` all blocks will be indexed and even when they become stale the index (via `gettxoutsetinfo`) will still return a result for them when given the right hash. But this currently does not work for blocks that the node saw and that became stale _before_ the node activated `coinstatsindex`. While the index syncs initially everything but the active chain is ignored and I don't see any indication that this ever worked differently in the past.

  Introducing this behavior seems non-trivial at first glance so, while I will give this a shot, I think the test should be removed so it does not confuse users and does not block #21590.

Top commit has no ACKs.

Tree-SHA512: b05f5dfeea3e453c8bb7c761501d0d896d4412a3f0c08037955951fae9fe388c63402da401792591e18da8fb67734f47f1a297d573cdb66e0ced451698718067
2023-12-26 22:26:20 -06:00
MarcoFalke
56af7d6727
Merge bitcoin/bitcoin#22313: test: Add missing sync_all to feature_coinstatsindex
fafd9165e911bf33d6212ca8a613b71878c82449 test: Add missing sync_all to feature_coinstatsindex (MarcoFalke)

Pull request description:

  Sync the blocks before invalidating them to ensure all nodes are on the right tip. Otherwise nodes[0] might stay on the "stale" block and the test fails (intermittently)

ACKs for top commit:
  jamesob:
    crACK fafd9165e9

Tree-SHA512: ca567b97b839b56c91d52831eaac18d8c843d376be90c9fd8b49d2eb4a46b801a1d2402996d5dfe2bef3e2c9bd75d19ed443e3f42cc4679c5f20043ba556efc8
2023-12-03 20:45:01 -06:00
Kittywhiskers Van Gogh
d97dcb22e1 merge bitcoin#22047: Coinstatsindex follow-ups 2023-08-02 10:19:02 -05:00
Kittywhiskers Van Gogh
28dcd381cd fix: adjust values of gettxoutsetinfo to match Dash's mint rate 2023-08-02 10:19:02 -05:00
Kittywhiskers Van Gogh
31bbd52784 fix: implement subset of GetBlockSubsidy for feature_coinstatsindex
It's highly unlikely the test will ever deal with chains with >4500
blocks, so only the subset of the subsidy logic that is needed to
validate `gettxoutsetinfo` output has been included
2023-08-02 10:19:02 -05:00
Kittywhiskers Van Gogh
040cd922f6 merge bitcoin#19521: Coinstats Index 2023-08-02 10:19:02 -05:00