Giter Site home page Giter Site logo

shrinker's Introduction


P L U T O N O M I C O N

Hercules-ci Cachix Cache

Introduction

The Plutonomicon is a developer-driven guide to the Plutus smart contract language in practice.

Since this ecosystem is moving at a breakneck speed, we ask that ANY information posted that is not confirmed to work on chain be labelled as 🔧 work in progress.

Available resources

We currently provide the following resources, broadly organized by topic.

Fundamentals and explanations

Design patterns

Testing and optimization

Script Optimization Techniques:

Plutus Vulnerabilities:

Discussion

To discuss the projects and the content under the Plutonomicon umbrella, join our Discord: https://discord.gg/722KnTC8jF

Running the website

If you'd like to run a live version of the website locally:

nix run

As you edit1 and save the Markdown files, the browser view should update instantly without requiring a manual refresh. Run nix build to build the statically generated website. See Emanote guide for further information.

Please note the Markdown writing conventions:

  • There must be zero or one level 1 heading (# A heading) as the first line.
    • If a level 1 heading is not specified, title will be derived from the filename.
  • All other headings must be level 2 or greater.

Footnotes

  1. Try Obsidian or VSCode with vscode-memo for editing.

shrinker's People

Contributors

darthpjb avatar geometer1729 avatar l-as avatar matthewcroughan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

shrinker's Issues

Why plutus-pab and playground deps?

I wonder why do we need plutus-pab and playground dependencies in the compiled code optimization library.
Can you please remove them if they are not used.

Got compilation error

I've tried to use shrinker but got this on compilation:

Configuring library for shrinker-0.1..
Preprocessing library for shrinker-0.1..
Building library for shrinker-0.1..
[1 of 9] Compiling Shrink.Types     ( src/Shrink/Types.hs, dist/build/Shrink/Types.o, dist/build/Shrink/Types.dyn_o )
[2 of 9] Compiling Shrink.ScopeM    ( src/Shrink/ScopeM.hs, dist/build/Shrink/ScopeM.o, dist/build/Shrink/ScopeM.dyn_o )
[3 of 9] Compiling Shrink.Tactics.Util ( src/Shrink/Tactics/Util.hs, dist/build/Shrink/Tactics/Util.o, dist/build/Shrink/Tactics/Util.dyn_o )
[4 of 9] Compiling Shrink.Tactics.Safe ( src/Shrink/Tactics/Safe.hs, dist/build/Shrink/Tactics/Safe.o, dist/build/Shrink/Tactics/Safe.dyn_o )
[5 of 9] Compiling Shrink.Tactics.Tactics ( src/Shrink/Tactics/Tactics.hs, dist/build/Shrink/Tactics/Tactics.o, dist/build/Shrink/Tactics/Tactics.dyn_o )
[6 of 9] Compiling Shrink.Names     ( src/Shrink/Names.hs, dist/build/Shrink/Names.o, dist/build/Shrink/Names.dyn_o )
[7 of 9] Compiling Shrink           ( src/Shrink.hs, dist/build/Shrink.o, dist/build/Shrink.dyn_o )
[8 of 9] Compiling Shrink.PlutusTX  ( src/Shrink/PlutusTX.hs, dist/build/Shrink/PlutusTX.o, dist/build/Shrink/PlutusTX.dyn_o )

src/Shrink/PlutusTX.hs:26:9: error:
    • The constructor ‘SerializedCode’ should have 3 arguments, but has been given 2
    • In the pattern: SerializedCode _ maybePirByteString
      In a case alternative:
          SerializedCode _ maybePirByteString
            -> SerializedCode scriptBc maybePirByteString
      In the expression:
        case comped of
          SerializedCode _ maybePirByteString
            -> SerializedCode scriptBc maybePirByteString
          DeserializedCode _ maybePir -> DeserializedCode prog maybePir
   |
26 |         SerializedCode _ maybePirByteString -> SerializedCode scriptBc maybePirByteString
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cabal: Failed to build shrinker-0.1 (which is required by
test:gero-onchain-test from gero-gov-0.1.0.0, test:gero-gov-test from
gero-gov-0.1.0.0 and others). See the build log above for details.

Maybe it's caused by plutus version mismatch.
we use on our project plutus: c8c5183f7facd967d48fe07b3b14465b8dd48fe7 (2021-12-27)

Shrinker hangs

Without shrinker it takes about 9 sec to run test suite on the gero-gov project.
When I've added shrinker I had to stop it on 7th minute. 100% cpu with memory slowly rising.

If you have access to gero-gov, you can try it out in this branch:
ak/try-shrinker

Incomplete substitutions

When I feed shrinkScript this UPLC: "(program 1.0.0 ((\i0 -> force i1 (\i0 -> \i0 -> \i0 -> i2)) ((\i0 -> \i0 -> \i0 -> (\i0 -> \i0 -> i2 i4 6 "Hello") (\i0 -> \i0 -> \i0 -> delay (\i0 -> i1 i4 i3 i2)) (\i0 -> i1)) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1)) (\i0 -> i1))))"`

I get "(program 1.0.0 (force ((\\i0 -> delay (\\i0 -> i1 (delay (\\i0 -> \\i0 -> i1)) 6 i2)) \"Hello\") (\\i0 -> \\i0 -> \\i0 -> i2)))"

but there's obvious opportunity to reduce it further: (\\i0 -> delay (\\i0 -> i1 (delay (\\i0 -> \\i0 -> i1)) 6 i2)) \"Hello\") ==> (delay (\\i0 -> i1 (delay (\\i0 -> \\i0 -> i1)) 6 \"Hello\")))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.