-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: bytes_i_to_uint256 (#1042)
<!--- Please provide a general summary of your changes in the title above --> <!-- Give an estimate of the time you spent on this PR in terms of work days. Did you spend 0.5 days on this PR or rather 2 days? --> Time spent on this PR: ## Pull request type <!-- Please try to limit your pull request to one type, submit multiple pull requests if needed. --> Please check the type of change your PR introduces: - [ ] Bugfix - [ ] Feature - [x] Code style update (formatting, renaming) - [x] Refactoring (no functional changes, no api changes) - [ ] Build related changes - [ ] Documentation content changes - [ ] Other (please describe): ## What is the current behavior? <!-- Please describe the current behavior that you are modifying, or link to a relevant issue. --> Resolves #897 ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - rename `bytes_i_to_uint256` to `bytes_big_endian_to_uint256` - simplify boolean condition for `is_bytes_len_16_bytes_or_less` - follow conventions by having `bytes_len` before `bytes` - rename `compute_half_uint256` to `compute_half_uint256_from_bytes` - improved readability for `pow256_rev` - use `pow256_rev` instead of `pow` from starkware lib: from 2419 to 1261 steps With `pow` from starkware lib <img width="452" alt="before opti" src="https://github.com/kkrt-labs/kakarot/assets/92337658/0c56d88b-834b-4fae-abba-a3e987955164"> With `pow256_rev` <img width="536" alt="after opti" src="https://github.com/kkrt-labs/kakarot/assets/92337658/f1489bc3-016d-4303-81f7-2b0e1df00fdd"> <!-- Reviewable:start --> - - - This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/kkrt-labs/kakarot/1042) <!-- Reviewable:end --> --------- Co-authored-by: Clément Walter <clement0walter@gmail.com>
- Loading branch information
1 parent
d18b637
commit 1904d37
Showing
6 changed files
with
58 additions
and
76 deletions.
There are no files selected for viewing
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
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
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
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
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
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