Skip to content
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

Infrastructure for the UKM semantics #143

Merged
merged 2 commits into from
Oct 4, 2024
Merged

Infrastructure for the UKM semantics #143

merged 2 commits into from
Oct 4, 2024

Conversation

virgil-serbanuta
Copy link
Member

@virgil-serbanuta virgil-serbanuta commented Oct 3, 2024

Closes #129

@virgil-serbanuta virgil-serbanuta marked this pull request as ready for review October 3, 2024 15:40

configuration
<k>
ukmDecodePreprocessedCell($PGM:Bytes)
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do we envision placing into the ukmDecodePreprocessedCell? Is it the hooks from the UKM module?

Copy link
Member Author

Choose a reason for hiding this comment

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

The argument for the ukmDecodePreprocessedCell will be the bytes produced by ukmEncodePreprocessedCell.

ukmDecodePreprocessedCell will rewrite (in one or more steps) to .K. While doing so, it will "restore" the <ukm-full-preprocessed> cell (https://github.com/Pi-Squared-Inc/rust-demo-semantics/pull/143/files#diff-ab754f8b0d12c81607fb49790ffed6b962aeea3393f07b73f475aa5acc1f2e9aR28) to the state encoded in the Bytes argument.

This state will contain the normal content of the <preprocessed> cell in the Rust semantics (https://github.com/Pi-Squared-Inc/rust-demo-semantics/pull/143/files#diff-a93e9e66bc324710e7b57700a6758c826c8b7b704cda1ec9ae9e86c495ff0622R15) which contains, roughly, the "compiled" Rust code (we don't actually compile the code right now, we only do some sort of indexing, but, if the future we will probably do more, e.g. we will resolve imported symbols and so on). This state will also contain some contract-specific state (the <ukm-preprocessed> cell), e.g. it will hold a TypePath for the contract's trait, perhaps some other things, too.


configuration
<k>
crateParser($CRATE1:Crate)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you please elaborate on what we will use to fill these 4 crate slots for both configuration and testing?

Copy link
Member Author

Choose a reason for hiding this comment

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

I can't :) . It is meant as an example that we would change as needed, its purpose is to signal that we are loading a list of random crates. Actually, I think I can do even better than this, so I'll rewrite this code.

One of them will be the contract. Another one will be, perhaps, the Rust code for the "helpers" trait. The others will be the "header files" that Everett mentioned, one of which will contain the functions for calling the hooks.

Copy link
Collaborator

@ACassimiro ACassimiro left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@virgil-serbanuta virgil-serbanuta merged commit 347a887 into main Oct 4, 2024
2 checks passed
@virgil-serbanuta virgil-serbanuta deleted the ukm-setup branch October 4, 2024 15:28
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.

Add a compilation target
2 participants