forked from 0xPolygon/polygon-edge
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Introducing OptimizedStack based on uint256 integers. #156
Merged
Stefan-Ethernal
merged 15 commits into
Ethernal-Tech:feat/evm-optimized-stack
from
cokicm:stack-improvement
Mar 28, 2024
Merged
Introducing OptimizedStack based on uint256 integers. #156
Stefan-Ethernal
merged 15 commits into
Ethernal-Tech:feat/evm-optimized-stack
from
cokicm:stack-improvement
Mar 28, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This is very nice work. Left comments, nothing big. Please keep in mind of the Lint errors that are being reported.
Co-authored-by: Goran Rojovic <[email protected]>
…ith unrolled loop. This allows CPU to execute multiple instructions in parallel providing >200% increased speed compared to uint256.WriteToSlice() implementation. If needed, can be additionally implemented for different array lengths.
TODO:
|
Stefan-Ethernal
changed the base branch from
develop
to
feat/evm-optimized-stack
March 28, 2024 09:31
Stefan-Ethernal
merged commit Mar 28, 2024
8ca41b1
into
Ethernal-Tech:feat/evm-optimized-stack
10 checks passed
14 tasks
goran-ethernal
added a commit
that referenced
this pull request
Apr 16, 2024
* Introducing OptimizedStack based on uint256 integers. * Replacing big.int with uint256 for jump instruction. * Update state/runtime/evm/instructions.go Co-authored-by: Goran Rojovic <[email protected]> * Code review fixes. * opMStore is changed to use newly introduced WriteToSlice() function with unrolled loop. This allows CPU to execute multiple instructions in parallel providing >200% increased speed compared to uint256.WriteToSlice() implementation. If needed, can be additionally implemented for different array lengths. * Fixing linter errors. * setBytes to use uint256 instead of big.int. * Fixing linter errors. * Go mod tidy * Lint fix * Revert go version * Address comments * Remove pointer dereferencing and use value type reference --------- Co-authored-by: Goran Rojovic <[email protected]> Co-authored-by: Stefan Negovanović <[email protected]>
Stefan-Ethernal
added a commit
that referenced
this pull request
May 29, 2024
* Introducing OptimizedStack based on uint256 integers (#156) * Introducing OptimizedStack based on uint256 integers. * Replacing big.int with uint256 for jump instruction. * Update state/runtime/evm/instructions.go Co-authored-by: Goran Rojovic <[email protected]> * Code review fixes. * opMStore is changed to use newly introduced WriteToSlice() function with unrolled loop. This allows CPU to execute multiple instructions in parallel providing >200% increased speed compared to uint256.WriteToSlice() implementation. If needed, can be additionally implemented for different array lengths. * Fixing linter errors. * setBytes to use uint256 instead of big.int. * Fixing linter errors. * Go mod tidy * Lint fix * Revert go version * Address comments * Remove pointer dereferencing and use value type reference --------- Co-authored-by: Goran Rojovic <[email protected]> Co-authored-by: Stefan Negovanović <[email protected]> * Updating tracer to use optimized stack directly, instead of big.int. * Removing remaining big.int references from instructions.go and state.go where possible. Removing unused functions and constants. * Adding error handling for invalid balance and invalid message value. * Adding benchmark tests for OptimizedStack. * Group dependencies * Fixing state error code name for errInvalidBalanceValue. --------- Co-authored-by: cokicm <[email protected]> Co-authored-by: Goran Rojovic <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Previous version of stack was made as an array of pointers to big.int instances. This PR introduces new stack that uses uint256 values based stack for improved performance.
Changes include
Checklist
Testing