Commit graph

4631 commits

Author SHA1 Message Date
Pablo Greco
b63f7ab9b5
Merge pull request #1433 from kilrau/reduce-default-dust-relay-fee
feat: reduce default dust relay fee
2025-03-13 08:00:07 -07:00
Byron Hambly
721d55b9f3
test: use bitcoin default dustrelayfee in transaction_tests 2025-03-13 09:38:10 +02:00
Martin Zumsande
33c7e40662 p2p: always set nTime for self-advertisements
If we self-advertised to an inbound peer with the address they gave us,
nTime was left default-initialized, so that our peer wouldn't relay it
any further along.

Github-Pull: #25314
Rebased-From: 99b9e5f3a9
2025-03-10 16:22:03 +00:00
Ryan Ofsky
7e7dbadf44 test: Add tests for GetArg methods / settings.json type coercion
Just add tests. No changes to application behavior. Tests will be
updated in the next commit changing & improving current behavior.

Include a Qt test for GUI startup crash reported by Rspigler in
https://github.com/bitcoin/bitcoin/issues/24457 caused by GetArg
behavior that happens if settings.json contains an integer value for any
of the configuration options which GUI settings can currently clash with
(-dbcache, -par, -spendzeroconfchange, -signer, -upnp, -natpmp, -listen,
-server, -proxy, -proxy, -onion, -onion, -lang, and -prune).

Github-Pull: bitcoin/bitcoin#24498
Rebased-From: 84b0973e35
2025-03-10 11:49:53 +00:00
Russell O'Connor
3a80782963 Avoid double free in simplicity pointer when copying PrecomputedTransactionData
We cannot put a raw pointer into a class that has a default copy constructor.
2025-03-03 17:35:07 -05:00
Jon Atack
7f56623441 Put lock logging behind DEBUG_LOCKCONTENTION preprocessor directive 2025-02-15 00:22:57 -08:00
Andrew Poelstra
a2d24eff9e
fuzz: remove dead code from simplicity_tx.cpp 2025-02-13 23:09:51 +00:00
Andrew Poelstra
69c241592f
fuzz: update simplicity_tx target to hit simplicity CMR error 2025-02-13 23:08:57 +00:00
Andrew Poelstra
3fe5d12c57
fuzz: simplicity: use zero CMR for invalid programs
When we have an invalid program, use a zero CMR and create a valid
control block/taptweak. Otherwise we fail to hit the Simplicity logic at
all with bad programs.

#
# You are committing on CAMUS
#

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch 2024-12--simple-fuzz
# Changes to be committed:
#	modified:   src/test/fuzz/simplicity_tx.cpp
#
# Untracked files:
#	reduced-corpus/
#	run-fuzz-merge-dir-CPzq/
#	run-fuzz-merge-dir-sscf/
#
2025-02-11 16:12:29 +00:00
Andrew Poelstra
eea423e3d6
fuzz: add second simplicity fuzz test
The first fuzztest takes a Simplicity program and a transaction and
directly calls the Simplicity interpreter with some context cobbled
together from the transaction. It also tries messing with the budget
and computes AMRs to check that the AMR-check works, even though on
the blockchain AMRs are never used.

It also attempts mangling programs to directly fuzz the parser, type
inference and CMR checking.

THIS test, on the other hand, takes a transaction, looks for Simplicity
programs (or witnesses which look like Simplicity programs), computes
their CMRs to produce a correct corresponding scriptPubKey, creates
scriptchecks, and executes them. This should do an end-to-end coverage
of the whole Simplicity consensus logic, including all the new branches
in interpreter.cpp.

To produce seeds for this, I have a a local fuzz target which uses
rust-simplicity and rust-elements to produce programs, deep Taproot trees,
and transactions. I run this to get high coverage, then dump the
resulting complete transactions to disk, where they can be used as
seeds for this test.
2025-02-11 16:12:29 +00:00
Andrew Poelstra
a87e4cf70b
simplicity: rewrite fuzz target
This fuzz target takes its seeds in a simple and well-defined format: a
four-byte LE budget, then a transaction, Simplicity program and witness,
each prefixed by a four-byte LE length. The fuzz target extracts any
additional randomness it needs from the txid of the first input of the
transaction, since this data is not interpreted in any other way we
therefore won't confuse the fuzzer.

The reason for this design, rather than a more typical "just query the
fuzzer when you need stuff", is to make it possible to fairly easily
generate test vectors from sources other than this fuzz test. (For
example, I have an alternate target which uses Rust code to generate
well-formed Simplicity programs, which quickly gets high coverage at the
expense of being an unmaintainable mess.)

This commit includes a .c file with a small function to comute the AMR
of a program. This is needed to pass a correct AMR to the Simplicity
interpreter, to exercise all the AMR-checking paths. In practice this is
not really necessary; Elements passes NULL to disable these AMR checks.
2025-02-11 16:12:28 +00:00
Byron Hambly
52642b1afd
simplicity: add fuzz target 2025-02-11 16:12:28 +00:00
Hennadii Stepanov
f8b1bb7070 build: Fix Boost.Process test for Boost 1.78
(cherry picked from commit 532c64a726)
2025-02-11 06:14:51 -08:00
Andrew Poelstra
363c5101c2
fuzz: change int to unsigned in witness_program
Avoids a signed/unsigned integer conversion.
2025-02-11 04:04:25 +00:00
Andrew Poelstra
86d740b5eb
fuzz: fix crash on null pointer in witness_program target 2025-02-11 02:53:44 +00:00
Andrew Poelstra
ff6482fc29
fuzz: add SelectParams to rbf.cpp
We cannot fuzz RBF (or do anything mempool-related, really) without
chainparams. This has been true since 2019 at least. I suspect this fuzz
test has never really been run.
2025-02-06 21:31:47 +00:00
Russell O'Connor
31d94775b3 Update to latest Simplicity
The main difference is that there is now explicit simplicity deallocation functions to go with the allocation functions in the API.
There are some minor changes to error message text.
The deserialization code is now automatically generated.
The are some other minor internal changes.
2025-02-04 12:14:25 -05:00
Christian Lewe
508836028e Asset tests: Check script error
Compare the expected script error, parsed from JSON, with the actual
error that VerifyScript returns. If the JSON does not include an
expected error, then skip this check.
2024-10-07 14:39:10 -04:00
Russell O'Connor
4ca2411795 Asset tests: Parse Elements script errors
Take the existing function to parse script errors and extend it to parse
Elements errors. SCRIPT_ERR_ERROR_COUNT is not included because it is a
pseudo error.
2024-10-07 14:39:10 -04:00
Russell O'Connor
bcd508f409 Add Simplicity Deployment structure 2024-10-07 14:39:10 -04:00
James Dorfman
08010b821f test: fix failing schnorr sig creation in bip341_keypath_test_vectors 2023-11-09 06:31:49 +00:00
James Dorfman
82a2555ad3
build: fix further ASAN issues in CI 2023-09-08 09:24:32 +02:00
Byron Hambly
69e09aa2ea
fix: comment out unused variable until tests are fixed 2023-09-07 16:06:03 +02:00
Byron Hambly
54660d006f
ci: fix unused member function warning in checkqueue.cpp 2023-09-07 13:32:06 +02:00
Byron Hambly
3911e7e2b3
build: fix compilation warnings 2023-09-01 16:39:08 +02:00
Byron Hambly
941940e946
Fix unnecessary pvChecks arg introduced in df8f97d63b in merge of Bitcoin PR bitcoin/bitcoin#23157 2023-08-08 10:10:00 +02:00
James Dorfman
265ba04f55 Add extra optimization initally left out during the merge of bitcoin/bitcoin#23114 in 81d5607ec8 2023-07-21 01:58:35 +00:00
James Dorfman
2ab19eb125 Fix failing unit tests left over from the merge of bitcoin/bitcoin#24343 in eef2269720 2023-07-21 01:34:39 +00:00
Byron Hambly
8dbf577aaa Merge cfc10a5dd6 into merged_master (Elements PR #1232) 2023-07-03 13:48:57 +00:00
Byron Hambly
6f90a02548 Merge 30308cc380 into merged_master (Bitcoin PR bitcoin/bitcoin#20196) 2023-07-03 11:17:52 +00:00
Byron Hambly
b4dbe6d445 Merge 08bcfa2767 into merged_master (Bitcoin PR bitcoin/bitcoin#24375) 2023-07-03 10:26:26 +00:00
Byron Hambly
5b079a5ef1 Merge 8b6cd42c62 into merged_master (Bitcoin PR bitcoin/bitcoin#24165) 2023-07-03 10:16:01 +00:00
Byron Hambly
1dc6ad6ea9 Merge ba11eb354b into merged_master (Bitcoin PR bitcoin/bitcoin#23542) 2023-07-03 09:44:18 +00:00
Byron Hambly
a573a48bf9 Merge 292a841553 into merged_master (Bitcoin PR bitcoin/bitcoin#24449) 2023-07-02 16:32:16 +00:00
Byron Hambly
b80c04e05a Merge 358fe779cb into merged_master (Bitcoin PR bitcoin/bitcoin#24381) 2023-07-02 14:47:05 +00:00
Byron Hambly
6c57005ffe Merge 16d05cf6b9 into merged_master (Bitcoin PR bitcoin/bitcoin#24406) 2023-07-02 14:13:58 +00:00
Byron Hambly
0e89b30f95 Merge 8add59d77d into merged_master (Bitcoin PR bitcoin/bitcoin#24367) 2023-07-02 07:33:56 +00:00
Byron Hambly
a7beef6e4a Merge bc49650b7c into merged_master (Bitcoin PR bitcoin/bitcoin#24310) 2023-07-02 06:52:34 +00:00
Byron Hambly
1fe3769ff8 Merge e44423c9d3 into merged_master (Bitcoin PR bitcoin/bitcoin#24224) 2023-07-02 06:23:04 +00:00
Byron Hambly
eef2269720 Merge 72f97289c4 into merged_master (Bitcoin PR bitcoin/bitcoin#24343)
Had to change some hashes in descriptor_tests, presumably because of the
differences between when Elements and Bitcoin when it comes to Taproot.

Please review this carefully and investigate the FIXME
2023-07-02 05:17:22 +00:00
Byron Hambly
9f8cb83e1f Merge edc0d327f1 into merged_master (Bitcoin PR bitcoin/bitcoin#24349) 2023-06-30 21:12:13 +00:00
Byron Hambly
ca0735a437 Merge 003523d239 into merged_master (Bitcoin PR bitcoin/bitcoin#24338) 2023-06-30 20:58:14 +00:00
Byron Hambly
fe4ab59cf5 Merge df0825046a into merged_master (Bitcoin PR bitcoin/bitcoin#24331) 2023-06-30 19:41:59 +00:00
Byron Hambly
91a6746c79 Merge 3ce40e64d4 into merged_master (Bitcoin PR bitcoin/bitcoin#24309) 2023-06-30 16:14:06 +00:00
Byron Hambly
207c1ce338 Merge e0367e84b3 into merged_master (Bitcoin PR bitcoin/bitcoin#24301) 2023-06-30 15:43:32 +00:00
Byron Hambly
5649610340 Merge 3dc0bb9552 into merged_master (Bitcoin PR bitcoin/bitcoin#24298) 2023-06-30 11:46:17 +00:00
Byron Hambly
04cea6bf40 Merge 8c0f02c69d into merged_master (Bitcoin PR bitcoin/bitcoin#24265) 2023-06-30 11:33:00 +00:00
Byron Hambly
0e3beacc89 Merge 5e8e0b3d7f into merged_master (Bitcoin PR bitcoin/bitcoin#24253) 2023-06-30 11:19:38 +00:00
Byron Hambly
dfc4ef427a Merge fa65f26f4d into merged_master (Bitcoin PR bitcoin/bitcoin#24237) 2023-06-30 09:30:02 +00:00
Byron Hambly
85c276279a Merge 1e7564eca8 into merged_master (Bitcoin PR bitcoin/bitcoin#24251) 2023-06-30 09:07:50 +00:00