IntersectMBO / IntersectMBO/plutus

Plutus Core specification: be careful about sizes of builtin arguments of integral types

Open
#6,310 0 comments 0 reactions 1 assignee Claimed by @kwxm View on GitHub
bug Builtins Internal Specification status: triaged
Dominant language
Haskell
Stars
1.6k
Forks
508
Avg merge
3d 10h
Merged PRs (30d)
22

Description

The builtins machinery allows you to define a builtin which takes arguments of PLC type `integer` and have them automatically converted into values of fixed-width Haskell types like `Int` and so on which are supplied to the denotation when the builtin is called. There's a [range check](https://github.com/IntersectMBO/plutus/blob/0c024899c7aa4ec65802e181206c33f804700452/plutus-core/plutus-core/src/PlutusCore/Default/Universe.hs#L385) when the builtin is called which will cause an error if the argument doesn't fit in to the smaller type: this happens with the indices in `sliceByteString` for example. These range restrictions aren't mentioned in the specification, but they should be.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.