-
Notifications
You must be signed in to change notification settings - Fork 356
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
feat: Add EcPairing precompile #383
Conversation
/// @param x The x coordinate of the point in Montgomery form. | ||
/// @param y The y coordinate of the point in Montgomery form. | ||
/// @return ret True if the point is on the curve, false otherwise. | ||
function g1AffinePointIsOnCurve(x, y) -> ret { |
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.
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.
Fixed on this commit 99af881
@@ -3,120 +3,127 @@ | |||
"contractName": "AccountCodeStorage", | |||
"bytecodePath": "artifacts-zk/contracts-preprocessed/AccountCodeStorage.sol/AccountCodeStorage.json", | |||
"sourceCodePath": "contracts-preprocessed/AccountCodeStorage.sol", | |||
"bytecodeHash": "0x01000075e8397f3d02eddfe166a8324a2ac31a6da0db8eeebfa8739d3f31aad6", | |||
"sourceCodeHash": "0xfbf66e830201c4b7fda14f0ddf28a53beb7fbb48a8406392bcfd0ef7ea9265c8" | |||
"bytecodeHash": "0x01000081df25f20524a83dc78040b54bdd50e97de2381e220757f07a56a9dd8b", |
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 are there all these changes? did you use a different compiler version?
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.
It seems there was an issue in my environment, although the local setup (yarn sc build
) is not working for me on this branch (i.e. dev
), so it was hard for me to fix; something seems to be broken on the repo setup. I had to hardcode the path to my solc
version 0.8.20
on the typescript code to get it to work properly.
The file is now fixed on commit ccae737 and only the new pairing hashes are added
The table below presents the gas usage reports for the
|
Co-authored-by: Stanislav Bezkorovainyi <[email protected]> Co-authored-by: Lyova Potyomkin <[email protected]> Co-authored-by: Javier Chatruc <[email protected]>
## What ❔ Add `EcPairing` precompile to the system contracts list. This is expected to be merged after the [PR](matter-labs/era-contracts#383) adding the `EcPairing` precompile implementation gets merged into `era-contracts`. The address of the precompile corresponds to the one used in Ethereum (`0x08`). Part of EVM-572 ## Why ❔ <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zk fmt` and `zk lint`. - [ ] Spellcheck has been run via `zk spellcheck`. - [ ] Linkcheck has been run via `zk linkcheck`. --------- Co-authored-by: Javier Chatruc <[email protected]>
## What ❔ Add `EcPairing` precompile to the system contracts list. This is expected to be merged after the [PR](matter-labs/era-contracts#383) adding the `EcPairing` precompile implementation gets merged into `era-contracts`. The address of the precompile corresponds to the one used in Ethereum (`0x08`). Part of EVM-572 ## Why ❔ <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zk fmt` and `zk lint`. - [ ] Spellcheck has been run via `zk spellcheck`. - [ ] Linkcheck has been run via `zk linkcheck`. --------- Co-authored-by: Javier Chatruc <[email protected]> Co-authored-by: Stanislav Bezkorovainyi <[email protected]>
## What ❔ Add `EcPairing` precompile to the system contracts list. This is expected to be merged after the [PR](matter-labs/era-contracts#383) adding the `EcPairing` precompile implementation gets merged into `era-contracts`. The address of the precompile corresponds to the one used in Ethereum (`0x08`). Part of EVM-572 ## Why ❔ <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zk fmt` and `zk lint`. - [ ] Spellcheck has been run via `zk spellcheck`. - [ ] Linkcheck has been run via `zk linkcheck`. --------- Co-authored-by: Javier Chatruc <[email protected]> Co-authored-by: Stanislav Bezkorovainyi <[email protected]>
## What ❔ Add `EcPairing` precompile to the system contracts list. This is expected to be merged after the [PR](matter-labs/era-contracts#383) adding the `EcPairing` precompile implementation gets merged into `era-contracts`. The address of the precompile corresponds to the one used in Ethereum (`0x08`). Part of EVM-572 ## Why ❔ <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zk fmt` and `zk lint`. - [ ] Spellcheck has been run via `zk spellcheck`. - [ ] Linkcheck has been run via `zk linkcheck`. --------- Co-authored-by: Javier Chatruc <[email protected]> Co-authored-by: Stanislav Bezkorovainyi <[email protected]>
What ❔
This PR adds the EcPairing precompile from https://github.com/lambdaclass/zksync_era_precompiles/, commit 4bdfebf831e21d58c5ba6945d4524763f1ef64d4.
Part of EVM-572
Why ❔
Checklist