Skip to content

Commit

Permalink
Plutus: Re-enable simplification on inline, but conservatively
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ch1bo committed May 23, 2024
1 parent 13e596f commit 821d541
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
As a minor extension, we also keep a semantic version for the `UNRELEASED`
changes.

## [0.18.0] - UNRELEASED

- **BREAKING** Change `plutus-tx` flags when building `hydra-plutus` scripts, resulting in a script hash change.

## [0.17.0] - 2024-05-20

- **BREAKING** Change `hydra-node` API `/commit` endpoint for committing from scripts [#1380](https://github.com/input-output-hk/hydra/pull/1380):
Expand Down
2 changes: 1 addition & 1 deletion hydra-plutus/hydra-plutus.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.2
name: hydra-plutus
version: 0.17.0
version: 0.18.0
synopsis: Hydra Plutus Contracts
author: IOG
copyright: 2022 IOG
Expand Down
4 changes: 2 additions & 2 deletions hydra-plutus/scripts/mHead.plutus

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions hydra-plutus/scripts/vCommit.plutus
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "PlutusScriptV2",
"description": "hydra-vCommit-0.15.0-181-g9e65bbf07",
"cborHex": "5907b45907b10100003232323322323233223232323232222533533223530060052225323233500713300249010343303100323301922533500110172213500222325335333573400203a038260280042600e00866e3c008028004d4c0040188888888888880204cc0092401034330320033018225335001101622135002223253353335734002038036260280042600e00866e3c008024d54cd4d4c0040188888888888880284c0592401035054380022100222220032350012200222533500110151335738004028646464a66a64666ae68004048044cdc3a400000422440022a66a64666ae68004048044cdc3a400400422440042602401e6aae78008d55ce8009baa0023232323253353335734002024022264646644246600200600464646464a66a666ae6800406005c4c8c8c8c8c8c8c8c8c8c8cc8ccccccc8ccc8ccc88888888888848cccccccccccc00403403002c02802402001c01801401000c008cc07c8c8c8c8c94cd4ccd5cd00081501489991091980080180118139aba10023006357426ae880084c0ac0a0cdc3a40000046aae78008d55ce8009baa0013574201e6ae84034cc07c004d5d0806119191919299a999ab9a001029028132323233332222123333001005004003002323232325335333573400206005e266442466002006004603c6ae84008cc014074d5d09aba20021303102e3370e90000011aab9e00235573a0026ea8d5d080298049aba1003323232325335333573400206005e22444006264a66a666ae680040c40c04c84888c004010dd71aba100313253353335734002064062264244460040086ae840104c0cc0c0cdc3a400800866e1d20020033370e90000011aab9e00235573a0026ea8d5d080119800bae357426ae8800888c8c8c8c94cd4ccd5cd0008188180891000899299a999ab9a00103203113212230020033007357420062606606066e1d20000033370e90010011aab9e00235573a0026ea8004d5d10009aba20021302a0273370e90000011aab9e00235573a0026ea8004c004d5d080518009aba10093001300175a6ae8401cd5d08031aba10053301d75c6ae84010d5d08019980090009aba1002232230023756002604c446666aae7c00480888c8cd4088cc8848cc00400c008dd71aab9d001300535573c00260086ae8800cd5d08010139aba1357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10010980c80b19b8748000008d55cf0011aab9d00137546ae84010c8c8c8c94cd4ccd5cd00080c00b8990911118018029bae35742004264a66a666ae680040640604c848888c004014c058d5d0801899299a999ab9a00101a019132122223002005300735742008264a66a666ae6800406c0684c848888c010014c8c8c8c94cd4ccd5cd00080f80f09909111111180280418061aba10021325335333573400204003e26424444444600e010601a6ae8400c4c94cd4ccd5cd00081081009991091111111980300480418071aba1004375c6ae84d5d1002099299a999ab9a001022021133221222222233002009008375c6ae84014dd71aba13574400a264a66a666ae6800408c0884cc8848888888cc004024020dd71aba1006375a6ae84d5d1003099299a999ab9a0010240231122222220041325335333573400204a0482244444440062604c04666e1d200c0083370e900500399b8748020018cdc3a400c00a66e1d20040043370e900100199b8748000008d55cf0011aab9d00137546ae840144c070064cdc3a400c00a66e1d20040043370e900100199b8748000008d55cf0011aab9d00137546ae84d5d1002119191919299a999ab9a0010180171321223002003300635742004264a66a666ae680040640604c8ccc888488ccc00401401000cdd69aba1004375a6ae84004dd69aba1357440026ae8800c4c06805ccdc3a400400666e1d200000235573c0046aae74004dd5000919191919299a999ab9a0010170161321223002003375c6ae840084c94cd4ccd5cd00080c00b89909118008019bae357420062603202c66e1d20020033370e90000011aab9e00235573a0026ea80044c04c040cdc3a40000046aae78008d55ce8009baa00110101300f49010350543500322323232325335333573400202001e264666444246660020080060046eb8d5d080198039aba1001375c6ae84d5d10009aba20021301100e3370e90000011aab9e00235573a0026ea8004c0108c8c8c94cd4c8ccd5cd00080780719b87480000084cc8848cc00400c008c02cd5d08009bae357426ae880044c03c030d55cf0011aab9d0013754002601844a66a00220144426a0044464a66a666ae6800404003c4c8c8ccd5cd00080900899b87003001337029000240042600e00866e3c008020c02c894cd40044024884d400888c94cd4ccd5cd000807807099199ab9a00101000f3370e00490010980380219b8f0020074890b4879647261486561645631002322300237580026014446666aae7c00480188cd4014c010d5d080118019aba200200b122002122122330010040032323232325335333573400201000e26644246600200600464646464a66a666ae6800403002c4dd71aba10021300d00a3370e90000011aab9e00235573a0026ea8d5d08011bad357426ae880084c024018cdc3a40000046aae78008d55ce8009baa00149010350543100122002122001232633573800200424002464600200244660066004004003"
"description": "hydra-vCommit-0.17.0-19-gf343c67202",
"cborHex": "5906cc5906c9010000323233223322323232323323232322222533533300430050033232325333573466e1d2000002112200115333573466e1d200200211220021300c00b35573c0046aae74004dd50011991919191911919192999ab9a3370e90000010999109198008018011919192999ab9a3370e9000001099191919191919191919199999999999911111111111091999999999998008068060058050048040038030028020018011980e11919192999ab9a3370e900000109991091980080180118109aba10013016357426ae880044c08c088d55cf0011aab9d00137540026ae8402cd5d08051980e0091aba100933301675ca02a6ae84020ccc059d7280a9aba10073574200c6ae84014d5d08021980e3ae357420066ae84008ccc059d710009aba1001357426ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba20011301501435573c0046aae74004dd51aba10013232325333573466e1d2000002132122223003005375c6ae8400454ccd5cd19b87480080084c848888c004014c04cd5d08008a999ab9a3370e900200109909111180100298049aba100115333573466e1d20060021321222230040053232325333573466e1d2000002132122222223005008300c357420022a666ae68cdc3a400400426424444444600e01060186ae8400454ccd5cd19b87480100084cc8848888888cc018024020c030d5d08009bae357426ae8800454ccd5cd19b87480180084cc8848888888cc008024020dd71aba1001375c6ae84d5d10008a999ab9a3370e90040010999109111111198008048041bae357420026eb4d5d09aba200115333573466e1d200a00211222222200415333573466e1d200c0021122222220031301801735573c0046aae74004dd51aba10011301501435573c0046aae74004dd51aba135744002260240226aae78008d55ce8009baa0013223232325333573466e1d200000213232333322221233330010050040030023232325333573466e1d2000002133221233001003002300c35742002660140166ae84d5d10008980b80b1aab9e00235573a0026ea8d5d0801999805bae500a35742004646464a666ae68cdc3a4000004224440062a666ae68cdc3a4004004264244460020086eb8d5d08008a999ab9a3370e9002001099091118010021aba10011301701635573c0046aae74004dd51aba10013300775c6ae84d5d10009aba200135744002260240226aae78008d55ce8009baa001223232325333573466e1d2002002112200115333573466e1d20000021321223002003300535742002260240226aae78008d55ce8009baa00123232325333573466e1d200000213212230020033005357420022a666ae68cdc3a400400426466644424466600200a0080066eb4d5d08011bad357420026eb4d5d09aba2001357440022602001e6aae78008d55ce8009baa00123232325333573466e1d20000021321223002003375c6ae8400454ccd5cd19b87480080084c8488c00400cdd71aba10011300f00e35573c0046aae74004dd5000899800bae75a4464460046eac004c05088cccd55cf800900a91919a80a9991091980080180118031aab9d001300535573c00260086ae8800cd5d0801007000880509804a4903505435003223232325333573466e1d200000213233322212333001004003002375c6ae84008c018d5d08009bae357426ae88004d5d1000898048041aab9e00235573a0026ea8004c0048c8c8c94ccd5cd19b87480000084cc8848cc00400c008c018d5d08009bae357426ae880044c02001cd55cf0011aab9d0013754002464460046eb0004c03488cccd55cf8009007119a80698021aba100230033574400400e4646464a666ae68cdc3a4000004266442466002006004646464a666ae68cdc3a400000426eb8d5d0800898048041aab9e00235573a0026ea8d5d08009bad357426ae880044c018014d55cf0011aab9d001375400292103505431003232222350032223232533500713300a49010343303100300135300900622222222222200813300a49010343303200300235533535300900622222222222200a1300b491035054380022100222220033013225335001101022135002225333573466e3c0080204c0480044c01800cc048894cd4004403c884d4008894ccd5cd19b8f0020071301200113006003235001220022253350011008133573800400e464c66ae7000400848004c01c894cd40044010884d4008894ccd5cd19b8f00200c1333573466e1d2001001009008130060033006225335001100322135002225333573466e3c00802c4ccd5cd19b874800800402001c4c01800c488008488004488008488488cc00401000d22010b4879647261486561645631002323001001223300330020020011"
}
4 changes: 2 additions & 2 deletions hydra-plutus/scripts/vHead.plutus

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions hydra-plutus/scripts/vInitial.plutus

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions hydra-plutus/src/Hydra/Contract/Commit.hs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-specialize #-}
-- Avoid trace calls to be optimized away.
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:conservative-optimisation #-}
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:defer-errors #-}
-- Avoid trace calls to be optimized away when inlining functions.
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:no-simplifier-inline #-}
-- Plutus core version to compile to. In babbage era, that is Cardano protocol
-- version 7 and 8, only plutus-core version 1.0.0 is available.
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:target-version=1.0.0 #-}
Expand Down
4 changes: 2 additions & 2 deletions hydra-plutus/src/Hydra/Contract/Head.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-specialize #-}
-- Avoid trace calls to be optimized away.
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:conservative-optimisation #-}
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:defer-errors #-}
-- Avoid trace calls to be optimized away when inlining functions.
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:no-simplifier-inline #-}
-- Plutus core version to compile to. In babbage era, that is Cardano protocol
-- version 7 and 8, only plutus-core version 1.0.0 is available.
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:target-version=1.0.0 #-}
Expand Down
4 changes: 2 additions & 2 deletions hydra-plutus/src/Hydra/Contract/HeadTokens.hs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-specialize #-}
-- Avoid trace calls to be optimized away.
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:conservative-optimisation #-}
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:defer-errors #-}
-- Avoid trace calls to be optimized away when inlining functions.
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:no-simplifier-inline #-}
-- Plutus core version to compile to. In babbage era, that is Cardano protocol
-- version 7 and 8, only plutus-core version 1.0.0 is available.
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:target-version=1.0.0 #-}
Expand Down
4 changes: 2 additions & 2 deletions hydra-plutus/src/Hydra/Contract/Initial.hs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-specialize #-}
-- Avoid trace calls to be optimized away.
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:conservative-optimisation #-}
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:defer-errors #-}
-- Avoid trace calls to be optimized away when inlining functions.
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:no-simplifier-inline #-}
-- Plutus core version to compile to. In babbage era, that is Cardano protocol
-- version 7 and 8, only plutus-core version 1.0.0 is available.
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:target-version=1.0.0 #-}
Expand Down

0 comments on commit 821d541

Please sign in to comment.