Skip to content

Conversation

@ChrisCho-H
Copy link
Contributor

In rust-bitcoin, read_scriptint checks NonMinimalPush, which makes an additional minimal check needless and PushBytes inefficient.

@apoelstra
Copy link
Member

We should add a fuzztest which tries to decode scripts both with master and 0.12.

Can wait til after #780 gets in, since that already includes a similar fuzztest for parsing expression strings.

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK 84d1ad5; successfully ran local tests; yep, I think you are right

@sanket1729
Copy link
Member

Can wait til after #780 gets in, since that already includes a similar fuzztest for parsing expression strings.

Working on it this week

@apoelstra
Copy link
Member

I'm gonna go ahead and merge this. Will add the fuzztest in a later PR.

@apoelstra apoelstra merged commit ce42c66 into rust-bitcoin:master Dec 3, 2024
30 checks passed
heap-coder added a commit to heap-coder/rust-miniscript that referenced this pull request Sep 27, 2025
…emoving unreachable minimal check

84d1ad5932c7e1527a1aa1b46c1efde68a0f0244 feat: optimize pushbytes by removing unreachable minimal check (ChrisCho-H)

Pull request description:

  In [rust-bitcoin](https://github.com/rust-bitcoin/rust-bitcoin/blob/aa25adfc64ea0d742ca202991140f280024aba1b/bitcoin/src/blockdata/script/push_bytes.rs#L312), `read_scriptint` checks `NonMinimalPush`, which makes an additional minimal check needless and `PushBytes` inefficient.

ACKs for top commit:
  apoelstra:
    ACK 84d1ad5932c7e1527a1aa1b46c1efde68a0f0244; successfully ran local tests; yep, I think you are right

Tree-SHA512: d16a199fd5caef13b4fa78584d61c7feb843accb2097b29ca7ccdabfd1cae3e5af9d54d70dc7b7b93f50809c2719f70a87cf4dbba9da53ed55d427568de9eed2
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.

3 participants