Skip to content

Move certifier to plutus-metatheory and expose it as a library #7067

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

Merged
merged 6 commits into from
May 5, 2025

Conversation

ana-pantilie
Copy link
Contributor

@ana-pantilie ana-pantilie commented May 1, 2025

As part of https://github.com/IntersectMBO/plutus-private/issues/1348, I'm moving the certifier to the plutus-metatheory package.

The reason behind this is that it doesn't make sense for plutus-tx-plugin to depend on plutus-executables, since it will call the certifier as a library function and not as some separate executable.

All of the certifier's Agda code lives in plutus-metatheory, so it would make sense for its Haskell code to live there as well. If we were to create a separate package for the certifier then we should move both the Haskell and the Agda code there, and I'm not sure if the effort is worth it (at least for now).

Note: I wanted to move all of the Haskell modules used for calling Haskell code from Agda into the FFI directory, however moving Raw.hs there resulted in some weird behavior from cabal. I have opened an issue about this: https://github.com/IntersectMBO/plutus-private/issues/1562

@ana-pantilie ana-pantilie changed the title Add the certifier to the plugin Move certifier to plutus-metatheory May 2, 2025
@ana-pantilie ana-pantilie self-assigned this May 2, 2025
@ana-pantilie ana-pantilie changed the title Move certifier to plutus-metatheory Move certifier to plutus-metatheory and expose it as a library May 2, 2025
@ana-pantilie ana-pantilie marked this pull request as ready for review May 2, 2025 15:43
@ana-pantilie ana-pantilie requested review from a team and ramsay-t May 2, 2025 15:44
Copy link
Member

@zliu41 zliu41 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we'll need to release plutus-metatheory on CHaP (please open an issue), and we probably don't need most of the existing plutus-metatheory, do we? If so, perhaps a good idea to split it into smaller libraries, but not critical.

@ana-pantilie
Copy link
Contributor Author

ana-pantilie commented May 2, 2025

So we'll need to release plutus-metatheory on CHaP (please open an issue), and we probably don't need most of the existing plutus-metatheory, do we? If so, perhaps a good idea to split it into smaller libraries, but not critical.

@zliu41 What would be the benefit of splitting the metatheory up? Would it outweigh the effort required to figure out a way to do it?

The certifier depends on the formalization of UPLC which constitutes quite a large part of the metatheory.

Maybe we could split the plutus-metatheory package up into the UPLC syntax and various semantics.
I'm not very familiar with the semantics side, from a quick look I can see that we have a CEK formalization and a reduction semantics, a CC machine and a CK machine (I couldn't tell you much more though).

Anyway, in the future we'll need to rely on a semantics for the certifier as well, but it will be a new semantics. So conceptually we could split it up into UPLC syntax + one package for each semantics, and the certifier would depend only on the syntax + the "special" semantics for the certifier, but I don't know whether there are any current or future interdependencies.

There's also the question of build complexity: right now we rely on Setup.hs which does some preprocessing in order to build the metatheory, and things might get quite complicated if we split it up into multiple packages (or it might not, but we'll need to consider this).

@ana-pantilie
Copy link
Contributor Author

Opened issue for releasing the metatheory: https://github.com/IntersectMBO/plutus-private/issues/1563.

@zliu41
Copy link
Member

zliu41 commented May 2, 2025

which constitutes quite a large part of the metatheory.

In that case no need to split. That said, we should consider a different name - "metatheory" specifically refers to the formalization of the Plutus Core language. If the certifier is now part of it, a different name would be more appropriate.

@ana-pantilie
Copy link
Contributor Author

That said, we should consider a different name - "metatheory" specifically refers to the formalization of the Plutus Core language. If the certifier is now part of it, a different name would be more appropriate.

I'm pretty bad at naming things! 😄 Do you (or @ramsay-t) have any suggestions?

@zliu41
Copy link
Member

zliu41 commented May 2, 2025

I'm very bad too, but perhaps something like plutus-formal or plutus-fm

@ana-pantilie ana-pantilie merged commit 1f161fc into master May 5, 2025
13 checks passed
@ana-pantilie ana-pantilie deleted the ana/certifier-plugin branch May 5, 2025 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants