Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged master 25 #3

Open
wants to merge 3,928 commits into
base: master
Choose a base branch
from
Open

Merged master 25 #3

wants to merge 3,928 commits into from

Conversation

delta1
Copy link
Owner

@delta1 delta1 commented Jan 7, 2025

No description provided.

delta1 added 30 commits October 29, 2024 14:46
ReserveDestination::SetBlindingPubKey was removed since it was only used
in one place (in Wallet::GetNewChangeDestination), and after this change
it was silently breaking blinded change addresses by somehow replacing
the destination with CNoDestination...
delta1 and others added 15 commits February 11, 2025 16:12
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.
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.
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/
#
…tors

test: add discountvsize test vectors
Windows native builds are really a best effort, but not a blocker.
Let's keep running them to see what we can fix, but keeping a green
pipeline. Also disabled a couple of long-running tests due to being
close to the timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants