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

Emulator no longer supports timelocking due to use of earlier protocol version #463

Closed
catch-21 opened this issue May 16, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@catch-21
Copy link
Contributor

catch-21 commented May 16, 2022

Summary

Recent work on the emulator has causes a regression with transaction time validation support. It is no longer possible to check a transaction's time interval in plutus emluator.

@brunjlar located the bug in emulatorGlobals:

emulatorGlobals :: Globals
emulatorGlobals = mkShelleyGlobals
  genesisDefaultsWithBigMaxTxSize
  (fixedEpochInfo (EpochSize 432000) (mkSlotLength 8)) -- Not sure about these values, probably not relevant for the emulator.
  2 -- maxMajorPV

This sets a major protocol version of 2, but that has as a consequence that time handling will not work, because it only starts working with version 6.

Steps to reproduce the behavior

  1. Build https://github.com/james-iohk/plutus-scripts/blob/78f5bd959b7bb94d022fb14906e2fb3c2d40d6f2/src/Deadline.hs
  2. Load Deadline in repl and run runTrace
  3. View output

Actual Result

Paying from script transaction is unsuccessful, script balance at end is 2ada

See error:

Slot 00002: *** CONTRACT STOPPED WITH ERROR: "\"WalletContractError (ValidationError (ScriptFailure (EvaluationError [\\\"Interval(1000000000000,PosInf)\\\"] \\\"CekEvaluationFailure\\\")))\""

Expected Result

Paying from script transaction is successful, script balance at end is 0.
No script validation errors seen.

Describe the approach you would take to fix this

Upgrade emulator from protocol version 2 to 6

System info

plutus-apps: 50290ad

@catch-21 catch-21 added the bug Something isn't working label May 16, 2022
@catch-21
Copy link
Contributor Author

Verified this issue no longer exists on branch #455

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants