-
Notifications
You must be signed in to change notification settings - Fork 479
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
Apply params to validator loaded from file fails #5414
Comments
Please attach the result of this command (as a file or under a spoiler).
What evaluator do you use? This doesn't seem like the syntax that we use in those errors, although I might be wrong about that. Anyway, the error message says that a function is applied to the Scott-encoded ... but actually, thinking about it, wasn't Aiken encoding all data types using I'm going to remove the |
Here's the Aiken's named debruijn of the always pass code listed above via hexdump: Hexdump
Here's the same but from the stdout in terminal: Terminal stdout
And here's the binary file (the upload expires in 6 days) - https://filebin.net/uv538dwurqn2pp0j
I'm using the following tool to run the validator https://github.com/mlabs-haskell/plutus-simple-model
That sounds like the possible problem. compiledFoo :: CompiledCode UntypedValidator
compiledFoo = compiledFooUnapplied `PlutusTx.applyCode` PlutusTx.liftCode FooScriptParams {a = 100} |
No, we do not support If you really need such a thing, your best bet is probably to compile to SOPs using our most recent release and then convert SOPs to I'll take a look at the provided file shortly, thanks for sharing. |
So this is the decoded program: program
The lambda that you apply is the one binding I do not see what the Plutus team can do here, I don't think we're going to support converting SOPs to Data in any observable future (we might decide to do that if we end up implementing a fancy Hence I'm closing the issue, do feel free to reopen if you disagree. |
Thank you very much for your insights again 🙌 |
Happy to help! |
I mean, it's stupid and very slow, but I think we could support this as a datatype compilation mode now. Although I would mostly use it to show how bad it is 😂 |
OK, if there's a serious consideration for us to do it, then I'm reopening this issue. |
Summary
I'm trying to apply parameters to Aiken written validator that is loaded from file in Plutus.
When the validator is non-parametrized, it works fine, but the problem is when applying parameters to a validator.
The problem seems to be that the encoding of parameter application doesn't seem to match but I'm not sure what is the format Plutus is using to apply parameters and whether it could be customised.
Steps to reproduce the behavior
The Aiken's validator is a simple always pass validator that accesses the script parameters.
The following is the Aiken code for reference:
Then using the following transformation to named deBruijn:
aiken build --uplc
aiken uplc encode --to named-debruijn artifacts/foo.spend.uplc > foo.namedDeBruijn
I'm using the following revision of Aiken aiken-lang/aiken@699467a
The following is the loading of the validator encoded in named deBruijn from
foo.namedDeBruijn
into Plutus:Actual Result
Now when executing the
compiledFoo
from the steps to reproduce, I get the following error:Where the
(delay (\i_i0 -> i_i1 100))) []
seems to be the encodedFooScriptParams
.So I'm expecting the problem is in the application of parameters.
Expected Result
Expected is that the parameters get properly applied to the validator and the validator validates.
Describe the approach you would take to fix this
No response
System info
Plutus revision: f003b09
The text was updated successfully, but these errors were encountered: