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

Introducing OptimizedStack based on uint256 integers #170

Merged
merged 12 commits into from
May 29, 2024

Conversation

Stefan-Ethernal
Copy link

@Stefan-Ethernal Stefan-Ethernal commented Mar 28, 2024

Description

This is the continuation of the #156 PR.

TODOs:

  • Check if sp field field can be removed from optimized stack. (this is the most optimal solution for now).
  • Agree on error handling within optimized stack
  • Evaluate is it safe that pop function returns a pointer.

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

@goran-ethernal goran-ethernal added enhancement New feature or request feature New feature performance-improvements Performance improvements labels Apr 2, 2024
@goran-ethernal goran-ethernal self-requested a review April 2, 2024 08:17
* 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 <100121253+goran-ethernal@users.noreply.github.com>

* 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 <100121253+goran-ethernal@users.noreply.github.com>
Co-authored-by: Stefan Negovanović <stefan@ethernal.tech>
@goran-ethernal goran-ethernal force-pushed the feat/evm-optimized-stack branch from 6a1aa16 to 117edb3 Compare April 16, 2024 07:38
@goran-ethernal goran-ethernal marked this pull request as ready for review April 16, 2024 07:38
@Stefan-Ethernal Stefan-Ethernal merged commit f20097c into develop May 29, 2024
10 checks passed
@Stefan-Ethernal Stefan-Ethernal deleted the feat/evm-optimized-stack branch May 29, 2024 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature New feature performance-improvements Performance improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants