This repository was archived by the owner on May 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 363
Implemented Subroutines EIP2315 #9
Merged
Merged
Conversation
This file contains hidden or 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
rakita
reviewed
Aug 5, 2020
rakita
approved these changes
Aug 5, 2020
rakita
reviewed
Aug 5, 2020
vorot93
approved these changes
Aug 6, 2020
Comment on lines
+435
to
+437
if self.valid_subroutine_destinations.is_none() { | ||
self.valid_subroutine_destinations = Some(self.cache.jump_and_sub_destinations(&self.params.code_hash, &self.reader.code).1); | ||
} |
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.
Suggested change
if self.valid_subroutine_destinations.is_none() { | |
self.valid_subroutine_destinations = Some(self.cache.jump_and_sub_destinations(&self.params.code_hash, &self.reader.code).1); | |
} | |
self.valid_subroutine_destinations.get_or_insert_with(|| self.cache.jump_and_sub_destinations(&self.params.code_hash, &self.reader.code).1); |
Comment on lines
-447
to
+483
if (instruction == instructions::DELEGATECALL && !schedule.have_delegate_call) || | ||
(instruction == instructions::CREATE2 && !schedule.have_create2) || | ||
(instruction == instructions::STATICCALL && !schedule.have_static_call) || | ||
((instruction == instructions::RETURNDATACOPY || instruction == instructions::RETURNDATASIZE) && !schedule.have_return_data) || | ||
(instruction == instructions::REVERT && !schedule.have_revert) || | ||
((instruction == instructions::SHL || instruction == instructions::SHR || instruction == instructions::SAR) && !schedule.have_bitwise_shifting) || | ||
(instruction == instructions::EXTCODEHASH && !schedule.have_extcodehash) || | ||
(instruction == instructions::CHAINID && !schedule.have_chain_id) || | ||
(instruction == instructions::SELFBALANCE && !schedule.have_selfbalance) | ||
use instructions::*; | ||
if (instruction == DELEGATECALL && !schedule.have_delegate_call) || | ||
(instruction == CREATE2 && !schedule.have_create2) || | ||
(instruction == STATICCALL && !schedule.have_static_call) || | ||
((instruction == RETURNDATACOPY || instruction == RETURNDATASIZE) && !schedule.have_return_data) || | ||
(instruction == REVERT && !schedule.have_revert) || | ||
((instruction == SHL || instruction == SHR || instruction == SAR) && !schedule.have_bitwise_shifting) || | ||
(instruction == EXTCODEHASH && !schedule.have_extcodehash) || | ||
(instruction == CHAINID && !schedule.have_chain_id) || | ||
(instruction == SELFBALANCE && !schedule.have_selfbalance) || | ||
((instruction == BEGINSUB || instruction == JUMPSUB || instruction == RETURNSUB) && !schedule.have_subs) |
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.
One reason to have a single big reformatting/restyling commit before everything else.
Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Backport of 234a287 + 58fde98