-
Notifications
You must be signed in to change notification settings - Fork 483
Add cardano open oracle protocol scripts for plutus-benchmark
#7156
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
base: master
Are you sure you want to change the base?
Conversation
|
3ae1bc2
to
51947b9
Compare
NamedDeBruijn -> BSL.fromStrict . flat .UPLC.UnrestrictedProgram . toNamedDeBruijnUPLC | ||
Named -> BSL.fromStrict . flat . UPLC.UnrestrictedProgram | ||
DeBruijn -> BSL.fromStrict . flat . UPLC.UnrestrictedProgram . toDeBruijnUPLC | ||
NamedDeBruijn -> BSL.fromStrict . flat . UPLC.UnrestrictedProgram . toNamedDeBruijnUPLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to resist here
51947b9
to
2998015
Compare
2998015
to
df25a6e
Compare
certMp :: CompiledCode (CertMpParams -> BuiltinData -> BuiltinData -> BuiltinUnit) | ||
certMp = $$(compile [|| \p r sc -> certMp' p (unsafeFromBuiltinData r) (unsafeFromBuiltinData sc) ||]) | ||
|
||
fsMp' :: FsMpParams -> FsMpRedeemer -> ScriptContext -> BuiltinUnit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm aware there's Data backed versions, which I found out later. Sadly, pattern synonym doesn't work with wildcards.
We need to have discussion around this. I think we should just have arbitrary datatype to have configurable underlying representation, which allows other optimizations as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remember to bring up this topic at the next technical discussion meeting!
dab1baa
to
5194009
Compare
5194009
to
8c9964f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explicit imports!
I was expecting all types from the Plutus Ledger API to be imported from the PlutusLedgerApi.V3
namespace (or the PlutusLedgerApi.Data.V3
). Could you verify this is the case, please?
import PlutusLedgerApi.V2 | ||
import PlutusTx.AssocMap | ||
import PlutusLedgerApi.V1.Value (Value (Value), flattenValue, valueOf, withCurrencySymbol) | ||
import PlutusLedgerApi.V2 (CurrencySymbol, Datum (Datum), DatumHash, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why V2 not V3 ?
The original scripts were V2 scripts; I replicated original script exactly for both ease of testing and following code |
It could be that we've improved something in V3 so I see no point in bringing something potentially sub-optimal.
Sorry, I don't understand how using V2 makes it easier to test or follow 🤷🏼♂️ |
@@ -20,6 +20,7 @@ module PlutusLedgerApi.V3.MintValue | |||
( MintValue (..) -- Constructor is exported for testing | |||
, emptyMintValue | |||
, mintValueToMap | |||
, mintValueToValue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, mintValueToValue |
V2 makes comparison more effective in this case because of two reasons mainly:
|
What is it you're comparing it against? |
The plutarch implementation: https://github.com/mlabs-haskell/cardano-open-oracle-protocol |
@zliu41 Do we want this comparison against plutarch to be inside of |
I have a task to collect and write down such requirements, its in progress. For now I'd say it is enough to do a minimal thing, as we haven't agreed yet on what the maximal thing is going to be. |
Implements Cardano Open Oracle Protocol scripts.