BlockstreamResearch / rust-simplicity

Creative Commons Zero v1.0 Universal
58 stars 12 forks source link

`Witness` node constructor does not use provided witness value for typing #230

Open apoelstra opened 2 months ago

apoelstra commented 2 months ago

When we construct a WitnessNode using WitnessNode::witness we can provide a witness. However, this constructor passes through to types::Arrow::witness(NoWitness); i.e., it does not constrain the target type of the witness node based on the type of the witness data.

This allows the construction of broken programs even when pruning is otherwise done correctly.