-
-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tx simulate plutus v3 #997
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KtorZ
force-pushed
the
tx-simulate-plutus-v3
branch
3 times, most recently
from
August 10, 2024 14:07
bbd9516
to
81c0152
Compare
And rework scripts to run them in anticipation of new v3 contexts.
…ons carrying Plutus v3 scripts.
More specifically, that is simply mimicking the script context from v2, minus the new governance features.
This is intense, as we still want to preserve the serializer for V1 & V2, and I've tried as much as possible to avoid polluting the application layer with many enum types such as: ``` pub enum TxOut { V1(TransactionOutput), V2(TransactionOutput), V3(TransactionOutput), } ``` Those types make working with the script context cumbersome, and are only truly required to provide different serialisation strategies. So instead, we keep one top-level `TxInfo V1/V2/V3` type, and we ensure to pass serialization strategies as type wrappers. This way, the strategy propagates through the structure up until it's eliminated when it reaches the relevant types. All-in-all, this strikes a correct balance between maintainability and repetition; and it makes it possible to define _different but mostly identical_ encoders for the various versions. With it, I've been able to successfully encode a V3 script context and match it against one produced using the Haskell libraries. More to come.
Better reflect its actual semantic. The name probably slipped through a wrong copy pasting.
Alongside a bunch of other stuff from the coverage list. In particular, the mint transaction contains: - reference inputs - multiple outputs, with assets, and type-0, type-1 and type-6 addresses. - an output with a datum hash - an output with an inline script - carries an extra datum witness, preimage of the embedded hash - mint, with 2 policies purposely ordered wrongly, with 1 and 2 assets purposely ordered wrong. One of the mint is actually a burn (i.e. negative quantity)
This covers every proposal procedures but protocol parameters, this one is yet to be done. It spans over 30+ fields, and felt like it is a big enough piece to tackle it on its own.
We can now simulate transactions with protocol parameters voting procedures. Cost models remain to be done, though.
KtorZ
force-pushed
the
tx-simulate-plutus-v3
branch
from
August 13, 2024 08:57
eda6ddf
to
bfc93bf
Compare
KtorZ
force-pushed
the
tx-simulate-plutus-v3
branch
from
August 13, 2024 15:17
cdf7fa7
to
fe5c565
Compare
There were some odd discrepancy for `integerToByteString` on the mem side. Either 1 or about 1000 mem units off; which I couldn't quite figure out. Yet, it proves useful to validate builtin at large and ensure we have a valid cost model for v3.
…teger As well as fixing a couple of other issues thanks to conformance tests. Some functions like multiply_integer or verify_ed25519_signature have also slightly changed their costing function.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📍 Move script context e2e tests under a nested 'v2' directory.
And rework scripts to run them in anticipation of new v3 contexts.
📍 Upgrade pallas to v0.0.29, and start support for simulating transactions carrying Plutus v3 scripts.
📍 Further remove todos for v3, and reduce duplication in transaction evaluation
📍 Fix Plutus v3 validator hash calculation in blueprint.
📍 Actually decode Conway transaction in 'aiken tx simulate'
📍 implement a strict subset of PlutusV3 transaction info
More specifically, that is simply mimicking the script context from
v2, minus the new governance features.
📍 define UPLC machine default cost models for Plutus V3.
📍 Fix ToPlutusData serializer for V3
This is intense, as we still want to preserve the serializer for V1 &
V2, and I've tried as much as possible to avoid polluting the
application layer with many enum types such as:
Those types make working with the script context cumbersome, and are
only truly required to provide different serialisation strategies. So
instead, we keep one top-level
TxInfo V1/V2/V3
type, and we ensureto pass serialization strategies as type wrappers.
This way, the strategy propagates through the structure up until it's
eliminated when it reaches the relevant types.
All-in-all, this strikes a correct balance between maintainability and
repetition; and it makes it possible to define different but mostly
identical encoders for the various versions.
With it, I've been able to successfully encode a V3 script context and
match it against one produced using the Haskell libraries. More to
come.
📍 Write down first e2e script context test for v3.
📍 Rename function variable in parser
Better reflect its actual semantic. The name probably slipped through a wrong copy pasting.
📍 Improve / fix machine and uplc error reporting.
📍 Support multi-validator in script context accept test.
📍 test 'mint' purpose and script context creation.
Alongside a bunch of other stuff from the coverage list. In
particular, the mint transaction contains:
addresses.
assets purposely ordered wrong. One of the mint is actually a
burn (i.e. negative quantity)