Skip to content
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

The error trace logs are ignored in compiled contract #6511

Closed
mesudip opened this issue Sep 24, 2024 · 2 comments
Closed

The error trace logs are ignored in compiled contract #6511

mesudip opened this issue Sep 24, 2024 · 2 comments

Comments

@mesudip
Copy link

mesudip commented Sep 24, 2024

Summary

It appears that plutus compiler removes the logs for optimization in compiled contract.
It is evident from the use of check' function instead of builitin check with same code.

Steps to reproduce the behavior

No response

Actual Result

Case 1:

check' :: Bool -> BuiltinUnit
check' b = if b then BI.unitval else traceError "MINT5"

{-# INLINEABLE mintValidator #-}
mintValidator :: TxOutRef -> CurrencySymbol ->  Value ->  BuiltinUnit
mintValidator nftOutRef ownCS  mint =
  check' ...

Message

CekError : An error has occurred:\nThe machine terminated because of an error, 
  either from a built-in function or from an explicit use of 'error'. : []

Case 2:

{-# INLINEABLE mintValidator #-}
mintValidator' :: TxOutRef -> CurrencySymbol ->  Value ->  BuiltinUnit
mintValidator' nftOutRef ownCS mint =
  check ...

Message

CekError : An error has occurred:\nThe machine terminated because of an error, 
  either from a built-in function or from an explicit use of 'error'. : [\"PT5\"]

Expected Result

check' should also show the Cek error with the MINT5 text when evaluating.

Describe the approach you would take to fix this

Have a way to enable the trace logging somewhere

System info

No response

@mesudip mesudip added the bug label Sep 24, 2024
@github-actions github-actions bot added the status: needs triage GH issues that requires triage label Sep 24, 2024
@zliu41
Copy link
Member

zliu41 commented Sep 24, 2024

Hi @mesudip, have a look at this and see if it helps.

@zliu41 zliu41 added status: needs info from the reporter and removed status: needs triage GH issues that requires triage labels Sep 24, 2024
@effectfully
Copy link
Contributor

Hi @mesudip, have a look at this and see if it helps.

It really should, so I'm closing the issue, given that it's been two weeks. If the fix doesn't help, please reopen the issue, we'll look into it further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants