Conversation
699118a to
12e6832
Compare
5dd1bd0 to
379e655
Compare
| {-# LANGUAGE TupleSections #-} | ||
| {-# LANGUAGE ViewPatterns #-} | ||
|
|
||
| module PlutusCore.Value.Internal |
There was a problem hiding this comment.
Most of the Value builtins are moved here, to avoid cyclic dependency between Value and Data.
|
Implementation looks reasonable, I'll give a more thorough review tomorrow. I'm not entirely sure what the purpose of this addition is. The only benefit of having Also, it would be nice if you can write out the reason why |
|
Confirmed at (PlutusV3, newestPV): The gate needs to reject |
| | 121 <= t && t < 128 -> | ||
| Constr (fromIntegral t - 121) <$> decodeListOf go | ||
| t | ||
| | 1280 <= t && t < 1401 -> |
There was a problem hiding this comment.
| | 1280 <= t && t < 1401 -> | |
| | 1280 <= t && t < valueTag -> |
The more you do with the Value, the more the cost of |
|
This looks good to me. I strongly encourage adding |
This PR adds the
Vconstructor toData. It hasn't been decided whether or not to pursue this, but if yes, then this is how it could be done.Backwards compatibility is not trivial and not obvious. We need to think through it and review the implementation carefully, to make sure it won't cause any split between old and new node versions.
The idea is:
Serialiseinstance forDataNO LONGER ROUNDTRIPS:encodeacceptsV, butdecoderejects it. There's a separatedecodeDataAcceptingValuesfunction that accepts it.decodeacceptV, and add a separatedecodeDataLegacythat rejectsV? Because it complicates ledger integration - the ledger must replace all existingdecodecalls withdecodeDataLegacy.encoderejectV, and add a separateencodeDataAcceptingValues? We can do that for the sake of satisfying the roundtrip property, but it isn't otherwise needed.DataSTILL ROUNDTRIPS, and both encoding and decoding acceptV. To preventVin Plutus V1-V3, a separate check is added inPlutusLedgerApi.Common.SerialisedScript.@lehins The ledger integration should be fairly straightforward (though I'm not certain). It basically amounts to: before Dijkstra, use
decodeordecodeData. After Dijkstra, usedecodeDataAcceptingValues.cc @colll78 @kwxm @SeungheonOh