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

Handle 0 exponent with fudged length correctly in ModExp #549

Conversation

notlesh
Copy link
Contributor

@notlesh notlesh commented Jan 13, 2022

This PR properly handles an exponent of 0 in the ModExp precompile.

@notlesh notlesh requested a review from sorpaas as a code owner January 13, 2022 00:06
frame/evm/precompile/modexp/src/lib.rs Outdated Show resolved Hide resolved
frame/evm/precompile/modexp/src/lib.rs Outdated Show resolved Hide resolved
@notlesh
Copy link
Contributor Author

notlesh commented Jan 13, 2022

I agree with your critiques, @sorpaas , and reverted the changes which made this look less like the original EIP.

tgmichel added a commit to moonbeam-foundation/frontier that referenced this pull request Jan 13, 2022
tgmichel added a commit to moonbeam-foundation/frontier that referenced this pull request Jan 13, 2022
@sorpaas sorpaas merged commit 8a93fdc into polkadot-evm:master Jan 13, 2022
tgmichel pushed a commit to moonbeam-foundation/frontier that referenced this pull request Jan 14, 2022
…m#549)

* Handle 0 exponent with fudged length correctly in ModExp

* cargo fmt

* Revert to following EIP-2565 strictly, subtract after adding terms to prevent underflow

* Update frame/evm/precompile/modexp/src/lib.rs

Clean up test case

Co-authored-by: Wei Tang <[email protected]>

* More revert

* cargo fmt

* Prefer expect to match

Co-authored-by: Wei Tang <[email protected]>
(cherry picked from commit 8a93fdc)
akru added a commit to AstarNetwork/Astar that referenced this pull request Jan 15, 2022
abhijeetbhagat pushed a commit to web3labs/frontier that referenced this pull request Jan 11, 2023
…m#549)

* Handle 0 exponent with fudged length correctly in ModExp

* cargo fmt

* Revert to following EIP-2565 strictly, subtract after adding terms to prevent underflow

* Update frame/evm/precompile/modexp/src/lib.rs

Clean up test case

Co-authored-by: Wei Tang <[email protected]>

* More revert

* cargo fmt

* Prefer expect to match

Co-authored-by: Wei Tang <[email protected]>
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.

3 participants