Skip to content

Conversation

tcharding
Copy link
Member

Try to do issue: #347

First patch is preparation, adds a macro so each of the test vectors is checked in a separate test so we can debug.

We use the test vectors from Sipa's miniscript/bitcoin/test/miniscript_test.cpp. Two new vectors seem to have been added, patch 2 adds those here (they both pass).

Two of the vectors we have have different values for ops (also one of ours uses nd:and_v instead of d:and_v, however I do not know the implications of this), patch 2 adds the original ones as well (both fail).

With this patch set applied we have:

failures:
    miniscript::tests::check_attributes_15a 
    miniscript::tests::check_attributes_16 
    miniscript::tests::check_attributes_16a
    miniscript::tests::check_attributes_26
    miniscript::tests::check_attributes_27
    miniscript::tests::check_attributes_7

I don't have any idea how to proceed. If anyone has any suggestions I can follow them. Thanks

tcharding added 2 commits May 18, 2022 12:58
Add a macro so that each test vector is run in a separate test. This
makes a failing test easily identifiable.
We use the test vectors from Sipa's
`miniscript/bitcoin/test/miniscript_test.cpp`. Two new vectors seem to
have been added, so add those here (they both pass).

Two of the vectors we have have different values for `ops` (also one of
ours uses `nd:and_v` instead of `d:and_v`), add those two in as
well (both fail).

Currently the following tests are failing

failures:
miniscript::tests::check_attributes_15a
miniscript::tests::check_attributes_16
miniscript::tests::check_attributes_16a
miniscript::tests::check_attributes_26
miniscript::tests::check_attributes_27
miniscript::tests::check_attributes_7
@tcharding tcharding changed the title 05 18 347 ms attributes test Debug ms attributes test May 18, 2022
@sanket1729
Copy link
Member

I will look into this later, but I just looked at 16a for now. This relates to calculations about malleable scripts. The c++ code outputs incorrect values for malleable scripts.

There may be other reasons why there is a discrepancy in other cases and we should resolve this. I would suspect this again relates to the calculation when scripts are malleable.

@tcharding
Copy link
Member Author

Thanks for looking @sanket1729.

@sanket1729
Copy link
Member

Based on some discussion here: bitcoin/bitcoin#24147 (comment), we should only care for these values if the scripts are non-malleable.

We should either

  1. Keep our separate tests
  2. Or only test these values for non-malleable vectors.

@sanket1729
Copy link
Member

In the future, if you need any assistance with a PR, feel free to tag me. I typically ignore the PRs in the marked draft.

@tcharding tcharding closed this Mar 20, 2023
@tcharding tcharding deleted the 05-18-347-ms-attributes-test branch August 7, 2023 07:25
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.

2 participants