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

Speedup modexp #4780

Merged
merged 19 commits into from
Dec 7, 2022
Merged

Speedup modexp #4780

merged 19 commits into from
Dec 7, 2022

Conversation

shemnon
Copy link
Contributor

@shemnon shemnon commented Dec 5, 2022

PR description

Speed up the gas calculation and execution of the modexp precompile.

Fixed Issue(s)

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if
    updates are required.

Changelog

Increate the speed of ModExp gas calculations.

Signed-off-by: Danno Ferrin <[email protected]>
Use a native lib for modexp precompile.

Signed-off-by: Danno Ferrin <[email protected]>
Signed-off-by: Danno Ferrin <[email protected]>
update native libs

Signed-off-by: Danno Ferrin <[email protected]>
Signed-off-by: Danno Ferrin <[email protected]>
Signed-off-by: Danno Ferrin <[email protected]>
Signed-off-by: Danno Ferrin <[email protected]>
Update the acceptance test containers to be more in line with the build
containers.  Ubuntu 22.04, etc.

Signed-off-by: Danno Ferrin <[email protected]>
Signed-off-by: Danno Ferrin <[email protected]>
Signed-off-by: Danno Ferrin <[email protected]>
Signed-off-by: Danno Ferrin <[email protected]>
Signed-off-by: Danno Ferrin <[email protected]>
Copy link
Contributor

@jflo jflo left a comment

Choose a reason for hiding this comment

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

Minor suggestion and a typo found.

*
* @param a first value
* @param b second value
* @return value of a times b if no over/underflows or Long.MAX_VALUE/Long.MIN_VALUE otherwise
Copy link
Contributor

Choose a reason for hiding this comment

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

probably meant Integer in these docs.

Bytes num;
if (offset + length <= input.size()) {
num = input.slice(offset, length).trimLeadingZeros();
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: the else case behavior wouldn't be intuitive to me as a caller, might warrant a javadoc explaining that you can request more bytes back than available from your offset.

Signed-off-by: Danno Ferrin <[email protected]>
@shemnon shemnon enabled auto-merge (squash) December 7, 2022 20:02
Signed-off-by: Danno Ferrin <[email protected]>
@shemnon shemnon merged commit 89ce75a into hyperledger:main Dec 7, 2022
Gabriel-Trintinalia pushed a commit to Gabriel-Trintinalia/besu that referenced this pull request Dec 8, 2022
Increate the speed of ModExp gas calculations by using primitive types.
Use a native lib for modexp precompile.

Signed-off-by: Danno Ferrin <[email protected]>

* Native modexp

Signed-off-by: Gabriel-Trintinalia <[email protected]>
ahamlat pushed a commit to ahamlat/besu that referenced this pull request Dec 18, 2022
Increate the speed of ModExp gas calculations by using primitive types.
Use a native lib for modexp precompile.

Signed-off-by: Danno Ferrin <[email protected]>

* Native modexp

Signed-off-by: Ameziane H <[email protected]>
macfarla pushed a commit to macfarla/besu that referenced this pull request Jan 10, 2023
Increate the speed of ModExp gas calculations by using primitive types.
Use a native lib for modexp precompile.

Signed-off-by: Danno Ferrin <[email protected]>

* Native modexp

Signed-off-by: Sally MacFarlane <[email protected]>
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
Increate the speed of ModExp gas calculations by using primitive types.
Use a native lib for modexp precompile.

Signed-off-by: Danno Ferrin <[email protected]>

* Native modexp
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.

2 participants