-
Notifications
You must be signed in to change notification settings - Fork 147
Upgrade to py-evm 0.3.0a8 #1255
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Upgrade to Py-EVM ``0.3.0a8`` adding the planned Istanbul block for mainnet. See all the | ||
`other changes in the latest py-evm <https://py-evm.readthedocs.io/en/latest/release_notes.html#py-evm-0-3-0-alpha-8-2019-11-05>`_ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
|
||
from eth_utils import ( | ||
add_0x_prefix, | ||
encode_hex, | ||
is_address, | ||
is_hex, | ||
is_integer, | ||
|
@@ -25,6 +26,9 @@ | |
apply_formatter_if, | ||
) | ||
|
||
from eth.constants import ( | ||
EMPTY_UNCLE_HASH, | ||
) | ||
from eth.chains.mainnet import ( | ||
MainnetChain, | ||
) | ||
|
@@ -54,21 +58,20 @@ | |
BASE_FIXTURE_PATH = os.path.join(ROOT_PROJECT_DIR, 'fixtures', 'BlockchainTests') | ||
|
||
SLOW_TESTS = ( | ||
'bcExploitTest/SuicideIssue.json', | ||
'Call1024PreCalls_d0g0v0', | ||
'ContractCreationSpam_d0g0v0_Homestead', | ||
'ContractCreationSpam_d0g0v0_Frontier', | ||
'Create2Recursive_d0g0v0', | ||
'Create2Recursive_d0g1v0', | ||
'DelegateCallSpam', | ||
'ForkStressTest', | ||
'stQuadraticComplexityTest/Call50000_d0g1v0.json', | ||
'stQuadraticComplexityTest/QuadraticComplexitySolidity_CallDataCopy_d0g1v0.json', | ||
'stQuadraticComplexityTest/Return50000_2_d0g1v0.json', | ||
'stQuadraticComplexityTest/Return50000_d0g1v0.json', | ||
'stQuadraticComplexityTest/Callcode50000_d0g1v0.json', | ||
'stQuadraticComplexityTest/Call50000_sha256_d0g1v0.json', | ||
'stQuadraticComplexityTest/Call50000_ecrec_d0g1v0.json', | ||
'walletReorganizeOwners', | ||
'bcExploitTest/SuicideIssue.json', | ||
'randomStatetest94_Homestead', | ||
'randomStatetest94_Byzantium', | ||
'randomStatetest94_Constantinople', | ||
'randomStatetest94_ConstantinopleFix', | ||
'ShanghaiLove_Homestead', | ||
'ShanghaiLove_Frontier', | ||
'static_Call1024PreCalls_d1g0v0', | ||
'static_Call1024PreCalls2_d0g0v0', | ||
'static_Call1024PreCalls2_d1g0v0', | ||
|
@@ -91,15 +94,20 @@ | |
'static_LoopCallsThenRevert_d0g0v0', | ||
'static_LoopCallsThenRevert_d0g1v0', | ||
'static_Return50000_2_d0g0v0', | ||
'stQuadraticComplexityTest/Call50000_d0g1v0.json', | ||
'stQuadraticComplexityTest/QuadraticComplexitySolidity_CallDataCopy_d0g1v0.json', | ||
'stQuadraticComplexityTest/Return50000_2_d0g1v0.json', | ||
'stQuadraticComplexityTest/Return50000_d0g1v0.json', | ||
'stQuadraticComplexityTest/Callcode50000_d0g1v0.json', | ||
'stQuadraticComplexityTest/Call50000_sha256_d0g1v0.json', | ||
'stQuadraticComplexityTest/Call50000_ecrec_d0g1v0.json', | ||
'stQuadraticComplexityTest/Call50000_identity2_d0g1v0.json', | ||
'stQuadraticComplexityTest/Call50000_identity_d0g1v0.json', | ||
'stQuadraticComplexityTest/Call50000_rip160_d0g1v0.json', | ||
'stQuadraticComplexityTest/Call50000bytesContract50_1_d0g1v0.json', | ||
'stQuadraticComplexityTest/Call50000bytesContract50_2_d0g1v0.json', | ||
'stQuadraticComplexityTest/Create1000_d0g1v0.json', | ||
'ShanghaiLove_Homestead', | ||
'ShanghaiLove_Frontier', | ||
'DelegateCallSpam', | ||
'walletReorganizeOwners', | ||
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. Don't get confused, I just resorted this list alphabetically (in a separate commit), so there are really only four new tests in that list. |
||
) | ||
|
||
# These are tests that are thought to be incorrect or buggy upstream, | ||
|
@@ -330,6 +338,10 @@ def is_by_hash(at_block): | |
raise ValueError("Unrecognized 'at_block' value: %r" % at_block) | ||
|
||
|
||
def has_uncles(block_fixture): | ||
return block_fixture['blockHeader']['uncleHash'] != encode_hex(EMPTY_UNCLE_HASH) | ||
|
||
|
||
async def validate_transaction_count(rpc, block_fixture, at_block): | ||
if is_by_hash(at_block): | ||
rpc_method = 'eth_getBlockTransactionCountByHash' | ||
|
@@ -398,11 +410,14 @@ async def validate_uncle_count(rpc, block_fixture, at_block): | |
else: | ||
rpc_method = 'eth_getUncleCountByBlockNumber' | ||
|
||
num_uncles = len(block_fixture['uncleHeaders']) | ||
num_uncles = len(block_fixture['uncleHeaders']) if has_uncles(block_fixture) else 0 | ||
await assert_rpc_result(rpc, rpc_method, [at_block], hex(num_uncles)) | ||
|
||
|
||
async def validate_uncle_headers(rpc, block_fixture, at_block): | ||
if not has_uncles(block_fixture): | ||
return | ||
|
||
if is_by_hash(at_block): | ||
rpc_method = 'eth_getUncleByBlockHashAndIndex' | ||
else: | ||
|
@@ -466,6 +481,10 @@ async def test_rpc_against_fixtures(event_bus, chain_fixture, fixture_data): | |
if get_in(['blockHeader', 'hash'], block_fixture) == chain_fixture['lastblockhash']: | ||
await validate_last_block(rpc, block_fixture) | ||
|
||
await validate_accounts(rpc, chain_fixture['postState']) | ||
# Fixtures do not include the `postState` field when its size would be past a certain limit. | ||
# https://github.com/ethereum/tests/issues/637#issuecomment-534072897 | ||
if chain_fixture.get('postState', None): | ||
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. @carver I was a bit worried if we are losing any safety here but it seems that we are doing the same on the Py-EVM side and I think that we are still safe here because even if we do not validate the 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. ❤️ for the link to the convo. After reading it, I agree |
||
await validate_accounts(rpc, chain_fixture['postState']) | ||
|
||
await validate_accounts(rpc, chain_fixture['pre'], 'earliest') | ||
await validate_accounts(rpc, chain_fixture['pre'], 0) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,11 +173,8 @@ def _filter_vm_config(vm_config: VMConfiguration) -> Iterable[VMFork]: | |
ByzantiumVM, | ||
ConstantinopleVM, | ||
PetersburgVM, | ||
IstanbulVM, | ||
) | ||
ALL_VMS_BY_FORK = { | ||
vm_class.fork: vm_class | ||
for vm_class in ALL_VMS | ||
} | ||
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. This was just dead code |
||
|
||
|
||
@to_tuple | ||
|
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.
These ☝️ four tests kept crashing CI (they work locally) and they were also put into the slow tests on the Py-EVM side.
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.
IIRC, veox said something about the tests having high RAM usage.
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.
@cburgdorf That's correct. Those tests need more than 4gb of RAM(discovered here). And they were marked as slow in this commit.