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

feat: ecAdd / ecMul #880

Merged
merged 5 commits into from
Sep 5, 2024
Merged

feat: ecAdd / ecMul #880

merged 5 commits into from
Sep 5, 2024

Conversation

obatirou
Copy link
Contributor

@obatirou obatirou commented Aug 28, 2024

Pull Request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Resolves: #856

What is the new behavior?

Wrap ecAdd / ecMul

Does this introduce a breaking change?

  • Yes
  • No

This change is Reviewable

@obatirou
Copy link
Contributor Author

blocked by foundry-rs/starknet-foundry#2397

@feltroidprime
Copy link
Contributor

feltroidprime commented Aug 29, 2024

Some note : if ec_add or ec_mul returns None, it shouldn't be interpreted as (0,0) which is a valid way of encoding the point at inifinity. It should be a precompile error

See https://www.evm.codes/precompiled
If the input is not valid, all gas provided is consumed and there is no return data, indicating a precompile contract error. Also, if not enough gas was given, there is no return data.

The Option::None case is reflecting the input is not valid .

@obatirou
Copy link
Contributor Author

obatirou commented Sep 2, 2024

Some note : if ec_add or ec_mul returns None, it shouldn't be interpreted as (0,0) which is a valid way of encoding the point at inifinity. It should be a precompile error

See https://www.evm.codes/precompiled If the input is not valid, all gas provided is consumed and there is no return data, indicating a precompile contract error. Also, if not enough gas was given, there is no return data.

The Option::None case is reflecting the input is not valid .

Thank you for spotting this !
Will make sure to take this into account when working on it again.
This draft PR is not ready as it does not compile due to the blocking issue.

@enitrat
Copy link
Contributor

enitrat commented Sep 4, 2024

@enitrat enitrat marked this pull request as ready for review September 5, 2024 12:19
@enitrat enitrat merged commit 5132b8c into kkrt-labs:main Sep 5, 2024
3 checks passed
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.

feat: create EVM Precompile wrapper around ec_mul and ec_add
3 participants