HomePhabricator

[backport#18388] Make VerifyWitnessProgram use a Span stack

Description

[backport#18388] Make VerifyWitnessProgram use a Span stack

Summary:
2b0fcff7f26d59fed4bcafd1602325122a206c67 Make VerifyWitnessProgram use a Span stack (Pieter Wuille)

Pull request description:

Here is a follow-up to #18002, again with the goal of simplifying (potential) BIP341 code.

Instead of passing a begin and end iterator of the initial stack to `ExecuteWitnessScript`, they are turned into a `Span<const valtype>`, representing a span of `valtype`s in memory. This allows `VerifyWitnessProgram` to operate on that span directly, instead of juggling iterators around (which would be exacerbated by #17977 if trying to avoid copying the stack).

Ignored the SegWit stuff but brought in the Span functionality, might be
used in the future also less merge conflicts

Backport of Core PR18388

Test Plan:

ninja

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D8495

Details

Provenance
fanquake <fanquake@gmail.com>Authored on Mar 27 2020, 05:07
majcostaCommitted on Nov 22 2020, 02:52
majcostaPushed on Nov 22 2020, 02:52
Reviewer
Restricted Project
Differential Revision
D8495: [backport#18388] Make VerifyWitnessProgram use a Span stack
Parents
rABCc321c8ac8909: Functional tests for descriptor wallets
Branches
Unknown
Tags
Unknown