Skip to content

test: Add test case for spending bare multisig - #29120

Merged
achow101 merged 1 commit into
bitcoin:masterfrom
BrandonOdiwuor:spending-bare-multisig
May 1, 2024
Merged

achow101 merged 1 commit into
bitcoin:masterfrom
BrandonOdiwuor:spending-bare-multisig

Conversation

@BrandonOdiwuor

Copy link
Copy Markdown
Contributor

Fixes #29113

@DrahtBot

DrahtBot commented Dec 20, 2023 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK ajtowns, willcl-ark, maflcko, achow101
Stale ACK rkrux

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #29309 (Add a -permitbarepubkey option by vostrnad)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@DrahtBot DrahtBot added the Tests label Dec 20, 2023
Comment thread test/functional/mempool_accept.py Resolved
Comment thread test/functional/mempool_accept.py Resolved
@luke-jr

luke-jr commented Dec 26, 2023

Copy link
Copy Markdown
Contributor

Title has a typo. Maybe should test that it works with both values for -permitbaremultisig?

@BrandonOdiwuor BrandonOdiwuor changed the title test: Add test case for speding bare multisig test: Add test case for spending bare multisig Dec 28, 2023
@BrandonOdiwuor
BrandonOdiwuor force-pushed the spending-bare-multisig branch from f21da15 to e2fa191 Compare January 8, 2024 11:51
@maflcko

maflcko commented Jan 17, 2024

Copy link
Copy Markdown
Member

Could also update the documentation of the setting to clarify that it refers to the relay of transactions which create bare outputs, and not to the relay of transactions spending them?

@nsvrn

nsvrn commented Jan 20, 2024

Copy link
Copy Markdown

I compiled with #28217, which sets default value of permitbaremultisig to false in policy.h and tried to run this test case with 'allowed': False for expected result but the test fails.
I would have expected that one to pass the test.

@ajtowns

ajtowns commented Jan 22, 2024

Copy link
Copy Markdown
Contributor

I compiled with #28217, which sets default value of permitbaremultisig to false in policy.h and tried to run this test case with 'allowed': False for expected result but the test fails. I would have expected that one to pass the test.

The test case already explicitly sets permitbaremultisig=0, so changing the default should have no effect. These spends should always be allowed, so if you change the test to assert that it's not allowed, the test should fail.

@BrandonOdiwuor

Copy link
Copy Markdown
Contributor Author

@maflcko could you elaborate more on this

#29120 (comment)

Could also update the documentation of the setting to clarify that it refers to the relay of transactions which create bare outputs, and not to the relay of transactions spending them?

@maflcko

maflcko commented Feb 21, 2024

Copy link
Copy Markdown
Member

@maflcko could you elaborate more on this

Sure, what is the question?

@BrandonOdiwuor

Copy link
Copy Markdown
Contributor Author

was asking what you meant by this?

Could also update the documentation of the setting to clarify that it refers to the relay of transactions which create bare outputs, and not to the relay of transactions spending them?

#29120 (comment)

@maflcko

maflcko commented Feb 21, 2024

Copy link
Copy Markdown
Member

I mean that the documentation in init.cpp can be clarified that it refers to outputs, not inputs.

@BrandonOdiwuor
BrandonOdiwuor force-pushed the spending-bare-multisig branch from e2fa191 to 9c7b2d0 Compare March 28, 2024 11:36
@BrandonOdiwuor

Copy link
Copy Markdown
Contributor Author

@maflcko I have updated the PR to include the suggested documentation change

@rkrux rkrux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK 9c7b2d0

Make successful, all functional tests successful.
Asked a question for clarity.

Comment thread test/functional/mempool_accept.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BrandonOdiwuor For my understanding, why is prepending bytes(CScript([OP_0])) to the script sig required after having gone through sign_input_legacy?

@willcl-ark willcl-ark Apr 25, 2024 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is due to the OP_CHECKMULTISG off-by-one bug. See for example: https://bitcoin.stackexchange.com/questions/116960/why-checkmultisig-bug-cant-be-solved

@instagibbs I think your suggestion here is incorrect? We do need to append the scriptsig otherwise the tx is simply invalid.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this clarification @willcl-ark

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@willcl-ark yeah my comment was nonsense, deleted

@BrandonOdiwuor
BrandonOdiwuor force-pushed the spending-bare-multisig branch from 9c7b2d0 to e504b1f Compare April 25, 2024 13:23

@willcl-ark willcl-ark left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 9c7b2d0d37b31f01403f7a0f2ea25b60b126c841

Confirmed this tests that when the -permitbaremultisig=0 policy is set, the mempool still permits spending (confirmed) bare multisig outputs. Mempool rejection of this output type is already tested earlier in the same test file.

@DrahtBot

Copy link
Copy Markdown
Contributor

🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the
documentation.

Possibly this is due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.

Leave a comment here, if you need help tracking down a confusing failure.

Debug: https://github.com/bitcoin/bitcoin/runs/24252720432

@ajtowns

ajtowns commented Apr 30, 2024

Copy link
Copy Markdown
Contributor

ACK e504b1f ; LGTM and just checking the 1-of-3 case seems fine

@DrahtBot
DrahtBot requested review from rkrux and willcl-ark April 30, 2024 13:17

@willcl-ark willcl-ark left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reACK e504b1f

Appears to only a rebase on master since my previous ack

git range-diff 9c7b2d0d37b31f01403f7a0f2ea25b60b126c841...e504b1fa1fa4d014b329dea81bfdf1aa55db238f

@maflcko

maflcko commented May 1, 2024

Copy link
Copy Markdown
Member

utACK e504b1f

@achow101

achow101 commented May 1, 2024

Copy link
Copy Markdown
Member

ACK e504b1f

@achow101
achow101 merged commit d73245a into bitcoin:master May 1, 2024
@BrandonOdiwuor
BrandonOdiwuor deleted the spending-bare-multisig branch May 2, 2024 00:13
@bitcoin bitcoin locked and limited conversation to collaborators May 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test case for spending bare multisig?

10 participants