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 |
|
I have some questions about this proposed change:
|
@Unisay You did some evaluation on the overhead of
Right, as currently implemented, V1-V3 won't be able to contain a Data constant that uses I considered simply making And this is just one of the reasons why this is a complex change, and must be thought through very carefully to ensure there's no unintended consequences. Hence why I said it would take time to merge and I'm leaning against doing this.
Yes |
|
Data is in #7738: standalone Summary: the conversion is 64% of the builtin lookup cost at 1 token and 98% at 101 tokens (21.7M of 22.1M CPU); |
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
Also see this comment: #7910 (comment)