IntersectMBO / IntersectMBO/plutus
The evaluate-builtins optimization isn't conservative
Open
bug
Good first issue
Internal
optimization
Plutus IR
status: triaged
tech debt
- Dominant language
- Haskell
- Stars
- 1.6k
- Forks
- 508
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 22
Description
`PlutusIR.Transform.EvaluateBuiltins` turns `ifThenElse True x y` into `x`. That is not conservative: if `y` throws then the former term will throw and the latter one won't. So this is a bug that needs to be fixed. It wasn't discussed in the original [PR](https://github.com/IntersectMBO/plutus/pull/5269).
More importantly, this looks like something that the proper property testing should catch. Look like a perfect opportunity for the PIR generators to show their power. So it'd be best to first write a failing property, then fix the bug.
Contributor guide
Assessment
This issue has not been assessed yet.