Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 9 additions & 29 deletions tests/ported_static/stRandom/test_random_statetest107.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

import pytest
from execution_testing import (
EOA,
Account,
Address,
Alloc,
Bytes,
Environment,
Expand All @@ -28,29 +26,13 @@
["state_tests/stRandom/randomStatetest107Filler.json"],
)
@pytest.mark.valid_from("Cancun")
@pytest.mark.pre_alloc_mutable
def test_random_statetest107(
state_test: StateTestFiller,
pre: Alloc,
) -> None:
"""Test_random_statetest107."""
coinbase = Address(0x945304EB96065B2A98B57A48A06AE28D285A71B5)
contract_0 = Address(0x095E7BAEA6A6C7C4C2DFEB977EFAC326AF552D87)
sender = EOA(
key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8
)

env = Environment(
fee_recipient=coinbase,
number=1,
timestamp=1000,
prev_randao=0x20000,
base_fee_per_gas=10,
)
sender = pre.fund_eoa()

pre[sender] = Account(balance=0xDE0B6B3A7640000)
# Source: raw
# 0x6000355415600957005b60203560003555
coinbase = pre.deploy_contract( # noqa: F841
code=Op.JUMPI(
pc=0x9,
Expand All @@ -62,11 +44,7 @@ def test_random_statetest107(
key=Op.CALLDATALOAD(offset=0x0), value=Op.CALLDATALOAD(offset=0x20)
),
balance=46,
nonce=0,
address=Address(0x945304EB96065B2A98B57A48A06AE28D285A71B5), # noqa: E501
)
# Source: raw
# 0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe457fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7f000000000000000000000000945304eb96065b2a98b57a48a06ae28d285a71b50960005155 # noqa: E501
contract_0 = pre.deploy_contract( # noqa: F841
code=Op.PUSH32[
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE
Expand All @@ -79,13 +57,16 @@ def test_random_statetest107(
+ Op.SSTORE(
key=Op.MLOAD(offset=0x0),
value=Op.MULMOD(
Op.PUSH32[0x945304EB96065B2A98B57A48A06AE28D285A71B5],
Op.PUSH32[coinbase],
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE, # noqa: E501
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, # noqa: E501
),
),
nonce=0,
address=Address(0x095E7BAEA6A6C7C4C2DFEB977EFAC326AF552D87), # noqa: E501
)

env = Environment(
fee_recipient=coinbase,
prev_randao=0x20000,
)

tx = Transaction(
Expand All @@ -100,11 +81,10 @@ def test_random_statetest107(
post = {
contract_0: Account(
storage={
0: 0xFFFFFFFFFFFFFFFFFFFFFFFF6BACFB1469F9A4D5674A85B75F951D72D7A58E4A, # noqa: E501
0: 2**256 - 1 - int.from_bytes(coinbase),
},
nonce=0,
),
coinbase: Account(storage={}, nonce=0),
coinbase: Account(storage={}),
sender: Account(storage={}, code=b"", nonce=1),
}

Expand Down
29 changes: 21 additions & 8 deletions tests/ported_static/stRandom/test_random_statetest111.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

Ported from:
state_tests/stRandom/randomStatetest111Filler.json
state_tests/stRandom2/randomStatetest560Filler.json
"""

import pytest
Expand All @@ -21,7 +22,10 @@


@pytest.mark.ported_from(
["state_tests/stRandom/randomStatetest111Filler.json"],
[
"state_tests/stRandom/randomStatetest111Filler.json",
"state_tests/stRandom2/randomStatetest560Filler.json",
],
)
@pytest.mark.valid_from("Cancun")
def test_random_statetest111(
Expand All @@ -31,15 +35,24 @@ def test_random_statetest111(
"""Test_random_statetest111."""
sender = pre.fund_eoa(amount=0xDE0B6B3A7640000)

# Source: raw
# 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000c35059a17f0000000000000000000000000000000000000000000000000000000000000001f38f07bf60005155 # noqa: E501
target = pre.deploy_contract(
code=bytes.fromhex(
"7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000c3507f000000000000000000000000ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000c35059a17f0000000000000000000000000000000000000000000000000000000000000001f38f07bf60005155" # noqa: E501
),
code=Op.PUSH32[
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
]
+ Op.PUSH32[0xC350]
+ Op.LOG1(
offset=Op.MSIZE,
size=Op.PUSH32[0xC350],
topic_1=Op.PUSH32[0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF],
)
+ Op.PUSH32[0x1]
+ Op.RETURN
+ Op.DUP16
+ Op.SMOD
+ Bytes("bf")
+ Op.MLOAD(offset=0x0)
+ Op.SSTORE,
)
# Source: raw
# 0x6000355415600957005b60203560003555
coinbase = pre.deploy_contract(
code=Op.JUMPI(
pc=0x9,
Expand Down
7 changes: 1 addition & 6 deletions tests/ported_static/stRandom/test_random_statetest144.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,15 @@
["state_tests/stRandom/randomStatetest144Filler.json"],
)
@pytest.mark.valid_from("Cancun")
Comment thread
danceratopz marked this conversation as resolved.
Resolved
@pytest.mark.pre_alloc_mutable
@pytest.mark.execute(pytest.mark.skip(reason="needs a high-nonce contract"))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as here: stRandom 347 deploys target at nonce 233 and addr at nonce 89 and checks both in post, so it will fail in execute too, and its skip should match this one. I asked my agent to scan stRandom and stRandom2 for other high-nonce deploys, and 347 is the only one left without the skip (647 only checks the sender). It isn't in this PR, so happy for it to be a follow-up.

Suggested diff (fills on Cancun to Bogota: 5 passed)
diff --git a/tests/ported_static/stRandom/test_random_statetest347.py b/tests/ported_static/stRandom/test_random_statetest347.py
index 295db1c944..0e16c11d5a 100644
--- a/tests/ported_static/stRandom/test_random_statetest347.py
+++ b/tests/ported_static/stRandom/test_random_statetest347.py
@@ -25,6 +25,7 @@ REFERENCE_SPEC_VERSION = "N/A"
     ["state_tests/stRandom/randomStatetest347Filler.json"],
 )
 @pytest.mark.valid_from("Cancun")
+@pytest.mark.execute(pytest.mark.skip(reason="needs a high-nonce contract"))
 def test_random_statetest347(
     state_test: StateTestFiller,
     pre: Alloc,

def test_random_statetest144(
state_test: StateTestFiller,
pre: Alloc,
) -> None:
"""Test_random_statetest144."""
coinbase = Address(0xB0085A57673C8F7D78FB870418F622E42FD686E4)
addr = Address(0x19BCDBCD094C63DF253C825B4B8E6DFFC45C21A4)
sender = pre.fund_eoa(amount=0x71E90493E6EB4C59)

pre[addr] = Account(balance=0x2401AC5958344E85, nonce=53)
# Source: raw
# 0x621da82575e942e4fd977abdb407069cf700116e02b4f9b25d866b6d13163fff2b8ef03cf8ab5d662afb7bb5c9e68462741090bc0976c9705b40411efe39e80c20b572c5e3d75f788f9be2f0981672b8de37f9e2d1515046cb77cc3ee74646fb096eadce98908499b6fd54725f3c6a725968761ba50494d1ecaf1e787db9a052952427c4f271c28d3e25728b2b76439a3166cd0ed37f30ec2421ed38ebd3b00b89ba9208391dc274e4eefa69161a37dfff7111756dd7971065f05aa9de4867609e7d847a290d0eeb08cde2ff294ae11dd16f8a3e32494d943fa0622cc04cd7476b6d2a1008e4ad1e2c33e2928e707c797f2a1a586bbf78658189bf58172ff77130be2ffc9bbf7f171939be260b30eb65b46a6cf107be1c9ed5c92c99d69fe0559389600e6013601c60096016601260016001600c6017016d200351654b9773409608aaa7db1f67b518d025727bdc6e0463b2bc334b658536d84dadc47a2288da62c36b9a35bf8934e3781a4c44e91637ce5c6b2f916d76706529d728b6f5ee076013601e601960086005601c6013601d96423568ce21a850c04a77ceb9 # noqa: E501
target = pre.deploy_contract(
code=Op.PUSH3[0x1DA825]
+ Op.PUSH22[0xE942E4FD977ABDB407069CF700116E02B4F9B25D866B]
Expand Down Expand Up @@ -108,7 +104,6 @@ def test_random_statetest144(

post = {
target: Account(storage={}, nonce=89),
addr: Account(storage={}, code=b"", nonce=53),
sender: Account(storage={}, code=b"", nonce=1),
coinbase: Account(storage={}, code=b"", nonce=0),
}
Expand Down
10 changes: 5 additions & 5 deletions tests/ported_static/stRandom/test_random_statetest146.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

Ported from:
state_tests/stRandom/randomStatetest146Filler.json
state_tests/stRandom2/randomStatetest632Filler.json
"""

import pytest
Expand All @@ -21,7 +22,10 @@


@pytest.mark.ported_from(
["state_tests/stRandom/randomStatetest146Filler.json"],
[
"state_tests/stRandom/randomStatetest146Filler.json",
"state_tests/stRandom2/randomStatetest632Filler.json",
],
)
@pytest.mark.valid_from("Cancun")
def test_random_statetest146(
Expand All @@ -31,8 +35,6 @@ def test_random_statetest146(
"""Test_random_statetest146."""
sender = pre.fund_eoa(amount=0xDE0B6B3A7640000)

# Source: raw
# 0x434243434444424350303614f20a
target = pre.deploy_contract(
code=Op.NUMBER
+ Op.TIMESTAMP
Expand All @@ -43,8 +45,6 @@ def test_random_statetest146(
+ Op.EXP(Op.CALLCODE, Op.EQ(Op.CALLDATASIZE, Op.ADDRESS)),
balance=0xDE0B6B3A7640000,
)
# Source: raw
# 0x6000355415600957005b60203560003555
coinbase = pre.deploy_contract(
code=Op.JUMPI(
pc=0x9,
Expand Down
12 changes: 1 addition & 11 deletions tests/ported_static/stRandom/test_random_statetest150.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
)
from execution_testing.vm import Op

from tests.ported_static.constants import HIGH_GAS_LIMIT

REFERENCE_SPEC_GIT_PATH = "N/A"
REFERENCE_SPEC_VERSION = "N/A"

Expand All @@ -26,16 +24,13 @@
["state_tests/stRandom/randomStatetest150Filler.json"],
)
@pytest.mark.valid_from("Cancun")
@pytest.mark.valid_until("Prague")
def test_random_statetest150(
state_test: StateTestFiller,
pre: Alloc,
) -> None:
"""Test_random_statetest150."""
sender = pre.fund_eoa(amount=0xDE0B6B3A7640000)

# Source: raw
# 0x6000355415600957005b60203560003555
coinbase = pre.deploy_contract(
code=Op.JUMPI(
pc=0x9,
Expand All @@ -48,8 +43,6 @@ def test_random_statetest150(
),
balance=46,
)
# Source: raw
# 0x668254d76c6f24d4806677d83f3a46a1a66f20ae2688cf4b75842ac7265966f5f5ca603e6062a268aba89067dc278e1f86710462dae624ac683889038d26894af02617c06b39c4988a5a60a12c0d9ad0ca65839c92f7c75c6ad3d6a7b617ac7fbd41f5a29377ca6ad48748a94e31302254147fb3b5857568e516cb6e8aa23577af85d0e508dc17dc50e246130be577cb59826adc86af6c107fd8a98f47cccd9d22a867a43cd8ad77bbe8bb737af5acc0be67fd7b054f7281e771891dc4aad180996b9cb71c6016d0f6a9148c775e57ac8456a883eedc3182623898f32b5c83760465a2061c7652e785e7eef7a97b0aa6d6c15b5c296bcf05ee2e9b87aa60b5741b3f7d69a1df03df117b848b3a75f81c12dee2244f76e56bb261e9c75fb5ccc769db72bfaeadee3f68cf22bbca665b0647ac74c1409778c71b73ed4adaa2c6ba1c181b0747c27506478c403b3943129e79223e788bf8b81f60abecb73be035d03a8bbdfa112cd8cb2f7a1065250292740d2d72259b4d7e3ef844783da8118b72912b9f96a61f6168f160ef69d7dd3dfc7e4ef204766f789cbaf2abeceadcf5bdd8dddfef773f0a628afdf3988861662b77882a5cebffc61e75f11835b109e81f7c915a91c13b09097b792d3d59de0ef5b0f00f95ea49860917656263925da2fd6685359c6d7e4c3c4d2001a30111de14c56503788453df98a29b8715561b2c2021cf78e0ccc4701b192ebf67bb6f522656788b3d21428b50a2fa16224d926ce2ea5944760d501bfa0774238c6351dd224b743d3fc4d5a309166016a71b1c230fe9afd6479324716e71e3b27bdd3fb18cccc42f6ec973129f7958435f45da181aeb1608ed31713c33330ab4d2d4af54dd92d1df1560086014601d601f636b1d9a3573<contract:target:0x095e7baea6a6c7c4c2dfeb977efac326af552d87>632aec0540f16cfb040c16bd7c3761bdb86dd6be658d2aefe157396217393663769965a66479176d702e7e2d5697681aac1beccc55825241cd77551f39526cfa77838faa9c4759aafa5c64df5e9199976f35f8298acd398d1913c1fd2ddacbbeac7cc29daee12c057385808f19d07110f30cfd900a130b0a713468bceaf4236153ab6c7bdc39cf86d0a5b03684624d187473b42a2968f1128872724b3d42218dbac11f5a9492651f09a866f61a72535c373274618d5914163abc7481bb7789394e62f247e78e7f83af55a5686926972af7c6519658aee40a564e3c2950f874def7a2110af0526f75629b20a108e1cfba0db03fcdee497ee2f8bcf78ef14317 # noqa: E501
target = pre.deploy_contract(
code=Op.PUSH7[0x8254D76C6F24D4]
+ Op.DUP1
Expand Down Expand Up @@ -134,17 +127,14 @@ def test_random_statetest150(
),
)

env = Environment(
fee_recipient=coinbase, prev_randao=0x20000, gas_limit=HIGH_GAS_LIMIT
)
env = Environment(fee_recipient=coinbase, prev_randao=0x20000)

tx = Transaction(
sender=sender,
to=target,
data=Bytes(
"70afe04f9b9074d39383f0718bb0b14ecdb6680c54b4c20ae65044c572a5c832c15f55e8c1b63ffbb7da41d4c8faa43f087b1960b54938bbdb14f35e3552723ad2053a3c74b98d0320f74bbe4ff06630f30e1caa6e13797a14d07bb94ae4972ce38da7aefa2ab07aedb81397137b698a63675aa8895c5b1207be9262507b0866acfa180cfbbdff5572fb9a74b245d1180e80a93b2dc5bcf891e1b84d6c66ab13b03e937d4268f4e9be0381417c1db9b7341c9912e685e38ee499f1fb82b027b84e01ef235f18b95b0bf567fcfcc5181f51c6dd0465d063d0f11f267ccd81aa8d4fda65e7e213e5ae4a6da0c6493209753a089323c5bfdde091556681b0648f59b8b2684d82a240f7d5b8eefd645e6320270660e960467877a8561129b7114a617d36423905813b7dc594d88b0eb751ba946f54595f624b07da116f0971fc6e540a966364c8a1df698688b1ba91f9ac7a74f878a61c87ad3240d656c9ee80fd90d4f8c01ca89c8bc537380df079ba8a2e6f2a3cbeb6bfb9687a7cc323f2a9eafd81789ae783355764b23354ba3f693c4d774ed6ab89da8846604172ad96ab938a4beff64adf9594812f491a0ba98e6f77d4c40454047c20cfb2625c43608dc26d032e6f8b53bfc1243fbd23a14c077e2071997635fdb2ffb317cd0e116f1ea7649dcf80ead9dea010cc4e456893f16d7c534f980d27c3312f34fbf5c8ba9b" # noqa: E501
),
gas_limit=2042667010,
value=0x6C44FB37,
)

Expand Down
10 changes: 5 additions & 5 deletions tests/ported_static/stRandom/test_random_statetest151.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

Ported from:
state_tests/stRandom/randomStatetest151Filler.json
state_tests/stRandom2/randomStatetest456Filler.json
"""

import pytest
Expand All @@ -21,7 +22,10 @@


@pytest.mark.ported_from(
["state_tests/stRandom/randomStatetest151Filler.json"],
[
"state_tests/stRandom/randomStatetest151Filler.json",
"state_tests/stRandom2/randomStatetest456Filler.json",
],
)
@pytest.mark.valid_from("Cancun")
def test_random_statetest151(
Expand All @@ -31,14 +35,10 @@ def test_random_statetest151(
"""Test_random_statetest151."""
sender = pre.fund_eoa(amount=0xDE0B6B3A7640000)

# Source: raw
# 0x41424143445a42f35b10773574016c9f
target = pre.deploy_contract(
code=bytes.fromhex("41424143445a42f35b10773574016c9f"),
balance=0xDE0B6B3A7640000,
)
# Source: raw
# 0x6000355415600957005b60203560003555
coinbase = pre.deploy_contract(
code=Op.JUMPI(
pc=0x9,
Expand Down
12 changes: 1 addition & 11 deletions tests/ported_static/stRandom/test_random_statetest154.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
)
from execution_testing.vm import Op

from tests.ported_static.constants import HIGH_GAS_LIMIT

REFERENCE_SPEC_GIT_PATH = "N/A"
REFERENCE_SPEC_VERSION = "N/A"

Expand All @@ -26,16 +24,13 @@
["state_tests/stRandom/randomStatetest154Filler.json"],
)
@pytest.mark.valid_from("Cancun")
@pytest.mark.valid_until("Prague")
def test_random_statetest154(
state_test: StateTestFiller,
pre: Alloc,
) -> None:
"""Test_random_statetest154."""
sender = pre.fund_eoa(amount=0xDE0B6B3A7640000)

# Source: raw
# 0x6000355415600957005b60203560003555
coinbase = pre.deploy_contract(
code=Op.JUMPI(
pc=0x9,
Expand All @@ -48,8 +43,6 @@ def test_random_statetest154(
),
balance=46,
)
# Source: raw
# 0x7db1267c8bba268d1408f7b3e269afee3fea86c5bc8aec8108fd6aaa954f5173b7d0e2328333e94698e0d570db9b316cba0adbae609d611ba1a2326004600d6005600f632de40a2773<contract:target:0x095e7baea6a6c7c4c2dfeb977efac326af552d87>635c2491eef1 # noqa: E501
target = pre.deploy_contract(
code=Op.LOG2(
offset=0x1BA1,
Expand All @@ -69,17 +62,14 @@ def test_random_statetest154(
),
)

env = Environment(
fee_recipient=coinbase, prev_randao=0x20000, gas_limit=HIGH_GAS_LIMIT
)
env = Environment(fee_recipient=coinbase, prev_randao=0x20000)

tx = Transaction(
sender=sender,
to=target,
data=Bytes(
"7767cc78eeac8d9db5297bde12b635c487b138a0dd4601a9236656945997db45a668500a3ba6eac5489fca6a1a60998fdd14d1f8b6df2f71d56852c0f085c7c3ba826a746e9dce4335b97488b092df3db7c8097366963ffc1f51e7f4740935567fc404dab22917cbb1e5cf6252d6e99952a889ec687e6bcdb9b3358f2b287d5d38793a6e6105063e96947760c35c317e5798e9a5f3cfef9030ea32917ec50268953856b1eae69744b4815f4808e2bcceaa482030b32689f51807af6e6840942dae7592985e688975e0ee12dbdc39eedbf43aabc2563df850d6781ed002fe78bd48083bb42742ee243eea1ecd201eef18f00f330fee8836df1234700f5824b76290232dd1863a69ca84d2786e74eed98d42b740cc037b156dd261441220cfaf15857c6e8b6f5e1eb9aee8d63ad473477df11660ac765fa5eebfccfed05bacf2809818d01db511686cde018f146e78fee9bff3ffe90a1b54cdc57ec52b6fda22f7f81fc1d9724b375ce206d29176797f9e42c2ec1ef6b468f7f8fbdb5011c4ddcddd72a6adde7d3d077cf96f9d13893a46aaaf5acc241eabd8712b6a2deea63f6f91cf162e2d6d65579257a17d7c66e07570d11280dc99" # noqa: E501
),
gas_limit=1617280826,
value=0x651C295B,
)

Expand Down
Loading
Loading