-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Traces simplified away #5460
Comments
Can you try running with |
@michaelpj That works as well. Would you recommend |
Yes, You probably only want to use it for your tests, though. Also a UX question: this flag basically controls whether we optimize more (good for on-chain usage) at the cost of messing with traces (bad for debugging and testing). We have some disagreement about whether it should be on by default with a way to turn it off (as it is today), or off by default with a way to turn it on. What would you prefer? |
I would expect traces to stay in the program unless I configure the compiler to remove them. Optimizations should not remove them as not seeing the traces messes with my understanding of which code path was executed on-chain. My intuition of an optimization is that the code behaves the same when observed at the system boundary (i.e. only inner workings change and size or cpu/memory consumption is optimized) |
Me too. We've run into this issue internally as well and we're going to have a discussion about it. |
We've discussed this issue internally and we agree that this behavior is pretty much a bug. We're going to fix it soon. |
@zliu41 do you happen to know what the status of this issue is? |
I think it's still on my todo list! |
@ch1bo You don't need I think we should be able to let users fine tune the different behaviors controlled by |
According to IntersectMBO/plutus#5460 this should be enough to ensure traces are not simplified away, but still allow for some simplifications and potential smaller / faster code.
According to IntersectMBO/plutus#5460 this should be enough to ensure traces are not simplified away, but still allow for some simplifications and potential smaller / faster code.
According to IntersectMBO/plutus#5460 this should be enough to ensure traces are not simplified away, but still allow for some simplifications and potential smaller / faster code.
According to IntersectMBO/plutus#5460 this should be enough to ensure traces are not simplified away, but still allow for some simplifications and potential smaller / faster code.
@zliu41 I tried using the conservative optimization only, but our benchmarks degraded. We saw significantly higher memory budget usage: cardano-scaling/hydra#1450 |
Summary
When updating https://github.com/input-output-hk/hydra from using
plutus
1.1.1.0
to1.7.0.0
, we saw our so-called mutation tests fail. These tests do run transaction validation on mutated txs, expecting the validators to fail with a specific error.At this commit, for example, the mutation tests for the
abort
transaction fail:When disabling
INLINABLE
, as seen in this commit, the problem goes away!When using
dump-pir
one can see that the error code we expect (H30
) is included in theinitial
pir, but not in thesimplified
pir.Consequently, using
no-simplifier-inline
in the plutus-tx plugin solves this problem (see this commit), but might have other adverse effects (increased cost? UPDATE: seems not the case)Steps to reproduce the behavior
Try to build & run the specific tests using the commits above.
Actual Result
The validator fails, but the trace does not include our error code.
Expected Result
The traces remain in the code throughout simplification.
Describe the approach you would take to fix this
No response
System info
GHC 9.2.8 (problem appeared only on upgrading plutus, GHC upgrade from 8.10.7 itself did not change anything)
Plutus 1.7.0.0
The text was updated successfully, but these errors were encountered: