-
Notifications
You must be signed in to change notification settings - Fork 649
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
Add create2 #269
Merged
Merged
Add create2 #269
Changes from 9 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
78da048
update sharding transaction intrinsic gas calculation
NIC619 1a19232
add prepare_child_shard_message in BaseComputation
NIC619 18fc399
add CREATE2 address check in execute_transaction
NIC619 9e9ed39
add CREATE2 opcode
NIC619 f77eb52
rename generate_create2_contract_address to generate_CREATE2_contract…
NIC619 e617837
remove CREATE from sharding opcodes
NIC619 9e8e9fe
fix sharding transaction intrinsic gas calculation
NIC619 849d9f8
fix on cleaned up state_db context
NIC619 ad81d76
add CREATE2 contract add test
NIC619 b843645
add edge case test cases for CREATE2 contract deployment
NIC619 e1998b2
fix missing CREATE2 gas cost and logger naming
NIC619 0268f65
update consumed gas check in test_sharding_vm.py
NIC619 9fda613
flake8'ed
NIC619 fb421a9
remove opcode by cytoolz.dissoc and improve function argument passing…
NIC619 362d82e
update state_db usage in CREATE2 based on #276
NIC619 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -186,4 +186,5 @@ | |
DELEGATECALL = 0xf4 | ||
STATICCALL = 0xfa | ||
REVERT = 0xfd | ||
CREATE2 = 0xfe | ||
SELFDESTRUCT = 0xff |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import copy | ||
from cytoolz import merge | ||
|
||
from evm import constants | ||
from evm import opcode_values | ||
from evm import mnemonics | ||
|
||
from evm.opcode import as_opcode | ||
from evm.logic import ( | ||
context, | ||
system, | ||
) | ||
|
||
from evm.vm.forks.byzantium import BYZANTIUM_OPCODES | ||
from evm.vm.forks.byzantium.opcodes import BYZANTIUM_OPCODES | ||
|
||
|
||
NEW_OPCODES = { | ||
|
@@ -18,10 +20,18 @@ | |
mnemonic=mnemonics.SIGHASH, | ||
gas_cost=0, | ||
), | ||
opcode_values.CREATE2: system.Create2.configure( | ||
name='opcode:CREATE2', | ||
mnemonic=mnemonics.CREATE2, | ||
gas_cost=constants.GAS_CREATE2, | ||
)(), | ||
} | ||
|
||
|
||
SHARDING_OPCODES = merge( | ||
copy.deepcopy(BYZANTIUM_OPCODES), | ||
NEW_OPCODES | ||
) | ||
|
||
|
||
SHARDING_OPCODES.pop(opcode_values.CREATE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of popping this value out, can we do the following a few lines up. from cytoolz import dissoc
SHARDING_OPCODES = merge(
dissoc(copy.deepcopy(BYZANTIUM_OPCODES), opcode_values.CREATE),
NEW_OPCODES
) |
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
Oops, something went wrong.
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.
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.
Is there a reason for inheriting
CreateEIP150
instead ofCreateByzantium
?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.
CreateByzantium
andCreate2
both override__call__
function so I makeCreate2
inherit fromCreateEIP150
and copy theis_static
check fromCreateByzantium
.