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

Remove all Yul references in EVM placeholder base #46

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

hgedia
Copy link
Contributor

@hgedia hgedia commented May 26, 2023

Changes under should not be merged to master.

This pull request removes all yul asm and re-write sections in pure solidity. It also removes asm code which we no
longer refer. The contents of this branch will be used to transpile to cairo using warp.

There are some outstanding functions which need to be written in cairo field.sol as the current implementations are
solidity hacks and might have a better implemention/library in cairo.

Due to re-writing in solidity , i am experiencing errors on deployment of the contracts due to contract size limitations/estimations going out of bounds. Thus no testing was possible in this step.

@hgedia hgedia requested review from Zerg1996 and ETatuzova May 26, 2023 12:04
@hgedia hgedia linked an issue May 26, 2023 that may be closed by this pull request
Copy link
Contributor

Choose a reason for hiding this comment

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

If we work with solidity code it's better to do simple math opernation unchecked{}. It decreases gas consumption.
Is it important for starKnet?

I think blob-parsing function is good second step in transpiling this to starknet.
Fist one -- simple math operations

Copy link
Contributor

Choose a reason for hiding this comment

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

We definitely need something like expmod_static and inversed_static functions in this branch. We cannot run verifier without them. We need to think, what is the best way to do it using pure solidity.

Copy link
Contributor

Choose a reason for hiding this comment

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

Need to be tested. Good third step.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can create a small test for Merkle trees and try to transpile it to CIAIRO.
It's a good small task, that can be done in a rather short time.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point for another small test.

Copy link
Contributor

Choose a reason for hiding this comment

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

Need to be tested

@hgedia hgedia changed the title 44 pure solidity version of verifier Remove all Yul references in EVM placeholder base Jun 5, 2023
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.

Pure solidity version of verifier
2 participants