Skip to content

Conversation

@topologoanatom
Copy link

Related to #337. These changes fix behaviour described in #333.

@delta1
Copy link
Contributor

delta1 commented Jan 16, 2026

I think it would be great to add unit tests that repro #333 / #337 that pass with this change but fail without it

@topologoanatom
Copy link
Author

I think it would be great to add unit tests that repro #333 / #337 that pass with this change but fail without it

I’m currently unable to reproduce bug #333 except by using the full flow described in the issue above. Adding that script to a unit test is difficult, as it requires specific functionality from SimplicityHL

@apoelstra
Copy link
Collaborator

Can you take the reproduction in #337, patch rust-simplicity to add some dbg! calls around the parameters passed to Value::prune, then directly construct the value and type you see in a unit test here?

There's likely also some room to manually reduce the size of the test value.

Alternately let me attempt to write a fuzz test about this..

@topologoanatom
Copy link
Author

Can you take the reproduction in #337, patch rust-simplicity to add some dbg! calls around the parameters passed to Value::prune, then directly construct the value and type you see in a unit test here?

There's likely also some room to manually reduce the size of the test value.

Alternately let me attempt to write a fuzz test about this..

Yes, I will reply here once I have obtained that info

@topologoanatom
Copy link
Author

Can you take the reproduction in #337, patch rust-simplicity to add some dbg! calls around the parameters passed to Value::prune, then directly construct the value and type you see in a unit test here?

There's likely also some room to manually reduce the size of the test value.

Alternately let me attempt to write a fuzz test about this..

Here are the logs taken right before pruning in the node::redeem::prune_with_tracker() function.

https://gist.github.com/topologoanatom/c4288260d7406b69ecfe658c3a11ff62

The first is from before the final conversion (line 443), and the second is from just before the return (line 455).

@apoelstra
Copy link
Collaborator

apoelstra commented Jan 23, 2026

I would dump the padded bit-encoding of both values (using iter_padded) so you can easily reconstruct them in a unit tests. The types you will probably have to construct manually.

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