plutus icon indicating copy to clipboard operation
plutus copied to clipboard

The CEK machine handles `VConstr` suboptimally

Open effectfully opened this issue 2 weeks ago • 0 comments

There's this in the implementation of the CEK machine:

       (VConstr i _)
         | fromIntegral @_ @Integer i > fromIntegral @Int @Integer maxBound ->

but maxBount :: Int can be converted to the type of i (Word64) directly without converting both to Integer, so it should be

       (VConstr i _)
         | i > fromIntegral @Int @Word64 maxBound ->

And a comment needs to be added to Note [Integral types as Integer] that not only 32-bit systems are banned, but all non-64-bit systems (not that there's a real danger that someone's gonna run a node on a (non-existent?) 128-bit machine).

effectfully avatar Dec 09 '25 00:12 effectfully