Skip to content

Conversation

instagibbs
Copy link
Member

@instagibbs instagibbs commented Apr 17, 2025

There is some basic coverage, but I felt like adding some boundary conditions where the only issue is the codesep value would be nice.

@DrahtBot
Copy link
Contributor

DrahtBot commented Apr 17, 2025

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

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32301.

Reviews

See the guideline for information on the review process.

Type Reviewers
Stale ACK sipa

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

Conflicts

No conflicts as of last run.

@DrahtBot DrahtBot added the Tests label Apr 17, 2025
@sipa
Copy link
Member

sipa commented Apr 17, 2025

ACK 1757409

@instagibbs
Copy link
Member Author

rebased due to merge conflict

@@ -849,7 +849,7 @@ def TaprootSignatureMsg(txTo, spent_utxos, hash_type, input_index=0, *, scriptpa
if scriptpath:
ss += TaggedHash("TapLeaf", bytes([leaf_ver]) + ser_string(leaf_script))
ss += bytes([0])
ss += codeseparator_pos.to_bytes(4, "little", signed=True)
ss += codeseparator_pos.to_bytes(4, "little", signed=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change? Having a code separator at position 2**31 or more doesn't seem very plausible given the block weight limit is lower than 2**22, and writing 0xffff_ffff as -1 and 0xffff_fffe as -2 seems fine?

Copy link
Member Author

Choose a reason for hiding this comment

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

Having a code separator at position 231 or more doesn't seem very plausible given the block weight limit is lower than 222

This might be an argument for more coverage, but not against adding coverage. Obviously the case will never make it into the "success" column without a a hardfork.

writing 0xffff_ffff as -1 and 0xffff_fffe as -2 seems fine?

I think writing test code to be obvious is better, all else equal.

@instagibbs
Copy link
Member Author

rebased

@maflcko
Copy link
Member

maflcko commented Aug 18, 2025

CI failure:

[08:01:28.655] �[0;36m                                   OverflowError: can't convert negative int to unsigned�[0m

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants