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

engine-modexp bug fixes and performance improvements with unusual exponents #814

Merged
merged 2 commits into from
Aug 7, 2023

Conversation

guidovranken
Copy link
Contributor

Description

  • Fixes a panic with empty exponent
  • Ensure correct result with zero exponent
  • Fix performance issues with exponents with large zero padding

Performance / NEAR gas cost considerations

The performance is increased for some cases (those with exponents with a large amount of leading zeroes) and remains the same for all other cases.

Testing

Fuzzing and tests added.

How should this be reviewed

Additional information

Copy link
Member

@birchmd birchmd left a comment

Choose a reason for hiding this comment

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

Nice find!

Copy link
Contributor

@joshuajbouw joshuajbouw left a comment

Choose a reason for hiding this comment

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

Nice!

@joshuajbouw joshuajbouw added this pull request to the merge queue Aug 7, 2023
Merged via the queue into aurora-is-near:develop with commit 0cfda46 Aug 7, 2023
18 checks passed
aleksuss added a commit that referenced this pull request Aug 10, 2023
…xponents (#814)

## Description

- Fixes a panic with empty exponent
- Ensure correct result with zero exponent
- Fix performance issues with exponents with large zero padding

## Performance / NEAR gas cost considerations

The performance is increased for some cases (those with exponents with a
large amount of leading zeroes) and remains the same for all other
cases.

## Testing

Fuzzing and tests added.

## How should this be reviewed

## Additional information

---------

Co-authored-by: Oleksandr Anyshchenko <oleksandr.anyshchenko@aurora.dev>
@aleksuss aleksuss mentioned this pull request Aug 10, 2023
aleksuss added a commit that referenced this pull request Aug 10, 2023
### Changes

- Added a view transaction `factory_get_wnear_address` for returning
address for the `wNEAR` ERC-20 contract by [@aleksuss]. ([#807])

### Fixes

- Fixed a bug where standalone engine can crash on tracing transactions
with too large contract deployment by [@birchmd]. ([#817])
- Fixed a bug and performance improvements with unusual exponents in the
`engine-modexp` crate by [@guidovranken]. ([#814])

---------

Co-authored-by: Guido Vranken <guidovranken@users.noreply.github.com>
Co-authored-by: Michael Birch <michael.birch@aurora.dev>
Co-authored-by: Joshua J. Bouw <joshua@aurora.dev>
This pull request was closed.
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.

5 participants