Skip to content
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

Fix tests for EIP-3860 #1125

Merged
merged 4 commits into from
Jan 6, 2023
Merged
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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

31 changes: 19 additions & 12 deletions GeneralStateTests/EIPTests/stEIP3860/create2InitCodeSizeLimit.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"create2InitCodeSizeLimit" : {
"_info" : {
"comment" : "",
"filling-rpc-server" : "evm version 1.11.0-unstable-8b819aea-20221123",
"filling-tool-version" : "retesteth-0.2.3-postmerge+commit.1de2b4bd.Linux.g++",
"generatedTestHash" : "fe9d6d1cf77b75d85877453a642f3736c5f30c7fa43085fd8a220a8390bcfdc2",
"filling-rpc-server" : "evm version 1.11.0-unstable-f485063a-20230102",
"filling-tool-version" : "retesteth-0.2.3-postmerge+commit.9190dff4.Linux.g++",
"generatedTestHash" : "73e3a35399dc59111e55f18896d42c59a50417d7df7dd03f6e628b8246ddfe16",
"labels" : {
"0" : "valid",
"1" : "invalid"
},
"lllcversion" : "Error getting LLLC Version",
"lllcversion" : "Version: 0.5.14-develop.2021.4.29+commit.14c9d5de.Linux.clang",
"solidity" : "Version: 0.8.17-develop.2022.9.30+commit.8df45f5f.Linux.clang",
"source" : "src/GeneralStateTestsFiller/EIPTests/stEIP3860/create2InitCodeSizeLimitFiller.yml",
"sourceHash" : "46d699ada12059f561e441a99ce80e3e3ccfff38c5723087b065ad4728163cef"
"sourceHash" : "c11e7cfccb6c735543ccdbb43de87230c208cc9df76241e20eb1a25bd3c9a6dc"
},
"env" : {
"currentBaseFee" : "0x0a",
Expand All @@ -27,7 +27,7 @@
"post" : {
"Merge" : [
{
"hash" : "0x91919fd9e9bd89632e9f43f859b93f078826e0bd3cf74afe6eef00f34c8be161",
"hash" : "0xedacd100b4cc31f6ea378bd5871113718551c73e8f0e78e0265cda28b45bbe96",
"indexes" : {
"data" : 0,
"gas" : 0,
Expand All @@ -37,7 +37,7 @@
"txbytes" : "0xf880800a83e4e1c094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80a0000000000000000000000000000000000000000000000000000000000000c0001ba0110f52aeb16c3e91943160d2e89c416b06dc47c7484a882324c6d0d362a26cd0a0774c7a35a3503be3867e7bb56885a9056ab1b7e5bfad19b1b0a3550d49a89d6f"
},
{
"hash" : "0x72a8647bfb3a00104bc799cc8317312a61101db77598678fdd918455669f9fc3",
"hash" : "0x51235df0a4a90e09f020115aced82b4bf568295160740e002264e966e8454a69",
"indexes" : {
"data" : 1,
"gas" : 0,
Expand All @@ -47,9 +47,9 @@
"txbytes" : "0xf880800a83e4e1c094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80a0000000000000000000000000000000000000000000000000000000000000c0011ca0fa5e0f7c53cba5169bd5b239b479ba8668cf69d8c06d24b00a585b995a1c2c67a056382ddd27880d6393b3f905dc75db8a0c30eeb1c9a8443ac53723ca4feba37c"
}
],
"Merge+3860" : [
"Shanghai" : [
{
"hash" : "0xbc6ec94a191c2a51b198b7041ddc7aaaf580ee5354139617618f733588c41f03",
"hash" : "0x812b09db30c2a7eb6ddb5d973f5ec54790cc7368528392fb729e8468e248d051",
"indexes" : {
"data" : 0,
"gas" : 0,
Expand All @@ -59,7 +59,7 @@
"txbytes" : "0xf880800a83e4e1c094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80a0000000000000000000000000000000000000000000000000000000000000c0001ba0110f52aeb16c3e91943160d2e89c416b06dc47c7484a882324c6d0d362a26cd0a0774c7a35a3503be3867e7bb56885a9056ab1b7e5bfad19b1b0a3550d49a89d6f"
},
{
"hash" : "0xdbb3e4a20d8e96a0d8bcdcc315ce1731902c388919ad063dff8f5e883b95af83",
"hash" : "0x94f5d6edcef1db40d0aeab8586a8980b952ce1f94d579e2d873148cbfec620a9",
"indexes" : {
"data" : 1,
"gas" : 0,
Expand All @@ -80,7 +80,14 @@
},
"0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x00",
"code" : "0x7f600a80600080396000f3000000000000000000000000000000000000000000006000526000355a600082600080f55a8203600a558060005560018055505050",
"code" : "0x6000356000526000803660008073c94f5374fce5edbc8e2a8697c15331677e6ebf0b62989680f1806000556001805550",
"nonce" : "0x00",
"storage" : {
}
},
"0xc94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x00",
"code" : "0x7f600a80600080396000f3000000000000000000000000000000000000000000006000526000355a63deadbeef82600080f55a8203600a5580600055505050",
"nonce" : "0x00",
"storage" : {
}
Expand All @@ -104,4 +111,4 @@
]
}
}
}
}
31 changes: 19 additions & 12 deletions GeneralStateTests/EIPTests/stEIP3860/createInitCodeSizeLimit.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"createInitCodeSizeLimit" : {
"_info" : {
"comment" : "",
"filling-rpc-server" : "evm version 1.11.0-unstable-8b819aea-20221123",
"filling-tool-version" : "retesteth-0.2.3-postmerge+commit.1de2b4bd.Linux.g++",
"generatedTestHash" : "b330c887912eb92c0e69dea6f127cbe8aa6910eba091355d21070b2c1db518e5",
"filling-rpc-server" : "evm version 1.11.0-unstable-f485063a-20230102",
"filling-tool-version" : "retesteth-0.2.3-postmerge+commit.9190dff4.Linux.g++",
"generatedTestHash" : "1a7169d0539991e3bba18dcf080850a37c9ac7f1affb1c9398f5aedf205bdf35",
"labels" : {
"0" : "valid",
"1" : "invalid"
},
"lllcversion" : "Error getting LLLC Version",
"lllcversion" : "Version: 0.5.14-develop.2021.4.29+commit.14c9d5de.Linux.clang",
"solidity" : "Version: 0.8.17-develop.2022.9.30+commit.8df45f5f.Linux.clang",
"source" : "src/GeneralStateTestsFiller/EIPTests/stEIP3860/createInitCodeSizeLimitFiller.yml",
"sourceHash" : "861b77bf26c2f94a76086292fe35ee5fb4f9fb037e1c2caaccfb8a78ffc4bbbe"
"sourceHash" : "79a85c908a13ed3bc2aaee208dc6db88e12da70fad1ecead09aada1478421378"
},
"env" : {
"currentBaseFee" : "0x0a",
Expand All @@ -27,7 +27,7 @@
"post" : {
"Merge" : [
{
"hash" : "0x150699ad823e7d079fad2b574f929c81fa962752564c27cc873d238c54068946",
"hash" : "0xab66169bc16a65cfe02912507c76b534aefefbbd471644beece2eeaedfb73b4d",
"indexes" : {
"data" : 0,
"gas" : 0,
Expand All @@ -37,7 +37,7 @@
"txbytes" : "0xf880800a83e4e1c094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80a0000000000000000000000000000000000000000000000000000000000000c0001ba0110f52aeb16c3e91943160d2e89c416b06dc47c7484a882324c6d0d362a26cd0a0774c7a35a3503be3867e7bb56885a9056ab1b7e5bfad19b1b0a3550d49a89d6f"
},
{
"hash" : "0x08fdfe2b2c1ce03d3d879c140bd0c2f809a030aaf4f5654f7636225910d5d34d",
"hash" : "0x56b9238a5c3cc3e0e8dd77d6e376444c62081b3a86ea68ded1a5450e87e518a7",
"indexes" : {
"data" : 1,
"gas" : 0,
Expand All @@ -47,9 +47,9 @@
"txbytes" : "0xf880800a83e4e1c094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80a0000000000000000000000000000000000000000000000000000000000000c0011ca0fa5e0f7c53cba5169bd5b239b479ba8668cf69d8c06d24b00a585b995a1c2c67a056382ddd27880d6393b3f905dc75db8a0c30eeb1c9a8443ac53723ca4feba37c"
}
],
"Merge+3860" : [
"Shanghai" : [
{
"hash" : "0x972831e08af5f60350afb977e576ca952ef0fc832221288c41ef2c9b60e679bd",
"hash" : "0x3f3ccd2d0daae88cd08551e0c993d6c1729b4910fbf87b74346682f5d78e34d1",
"indexes" : {
"data" : 0,
"gas" : 0,
Expand All @@ -59,7 +59,7 @@
"txbytes" : "0xf880800a83e4e1c094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80a0000000000000000000000000000000000000000000000000000000000000c0001ba0110f52aeb16c3e91943160d2e89c416b06dc47c7484a882324c6d0d362a26cd0a0774c7a35a3503be3867e7bb56885a9056ab1b7e5bfad19b1b0a3550d49a89d6f"
},
{
"hash" : "0x96efede720d48405f640c41837a8da4775e970271046b2bfa00a2491572775f4",
"hash" : "0x695742bae619ff06d6bf217f9b24480a3d5b7911adbd7eb3f88810777c40484c",
"indexes" : {
"data" : 1,
"gas" : 0,
Expand All @@ -80,7 +80,14 @@
},
"0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x00",
"code" : "0x7f600a80600080396000f3000000000000000000000000000000000000000000006000526000355a81600080f05a8203600a558060005560018055505050",
"code" : "0x6000356000526000803660008073c94f5374fce5edbc8e2a8697c15331677e6ebf0b62989680f1806000556001805550",
"nonce" : "0x00",
"storage" : {
}
},
"0xc94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x00",
"code" : "0x7f600a80600080396000f3000000000000000000000000000000000000000000006000526000355a81600080f05a8203600a5580600055505050",
"nonce" : "0x00",
"storage" : {
}
Expand All @@ -104,4 +111,4 @@
]
}
}
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ create2InitCodeSizeLimit:
nonce: 0
storage: {}
b94f5374fce5edbc8e2a8697c15331677e6ebf0b:
balance: 0
code: |
:yul
{
mstore(0, calldataload(0))
let call_result := call(10000000, 0xc94f5374fce5edbc8e2a8697c15331677e6ebf0b, 0, 0, calldatasize(), 0, 0)
sstore(0, call_result)
sstore(1, 1)
}
nonce: 0
storage: {}
c94f5374fce5edbc8e2a8697c15331677e6ebf0b:
balance: 0
code: |
:yul
Expand All @@ -25,10 +37,9 @@ create2InitCodeSizeLimit:
// get initcode size from calldata
let initcode_size := calldataload(0)
let gas_before := gas()
let create_result := create2(0, 0, initcode_size, 0)
let create_result := create2(0, 0, initcode_size, 0xdeadbeef)
sstore(10, sub(gas_before, gas()))
sstore(0, create_result)
sstore(1, 1)
}
nonce: 0
storage: {}
Expand Down Expand Up @@ -58,10 +69,13 @@ create2InitCodeSizeLimit:
nonce: 1
b94f5374fce5edbc8e2a8697c15331677e6ebf0b:
storage:
'0': '7b453b2ba212f731bec025f8f441f01547d79bfb'
'1': 1
'10': 52467
7b453b2ba212f731bec025f8f441f01547d79bfb:
'0': 1 # subcall successful
'1': 1 # test successful, no OOG
c94f5374fce5edbc8e2a8697c15331677e6ebf0b:
storage:
'0': '9e7a3337d18c31fe4c1fe51ab2da6cfd3629923d' # created account
'10': 52467 # gas used by CREATE
9e7a3337d18c31fe4c1fe51ab2da6cfd3629923d:
balance: 0
code: '0x600a80600080396000f3'
nonce: 1
Expand All @@ -76,10 +90,13 @@ create2InitCodeSizeLimit:
nonce: 1
b94f5374fce5edbc8e2a8697c15331677e6ebf0b:
storage:
'0': '094147686c565aa7ccac18000c3b7b4d099f92d3'
'1': 1
'10': 52482
094147686c565aa7ccac18000c3b7b4d099f92d3:
'0': 1 # subcall successful
'1': 1 # test successful, no OOG
c94f5374fce5edbc8e2a8697c15331677e6ebf0b:
storage:
'0': '67d49ae27e912b3b508d62ce1e463298db6edf32' # created account
'10': 52482 # gas used by CREATE
67d49ae27e912b3b508d62ce1e463298db6edf32:
balance: 0
code: '0x600a80600080396000f3'
nonce: 1
Expand All @@ -88,17 +105,20 @@ create2InitCodeSizeLimit:
- indexes:
data: ':label valid'
network:
- 'Merge+3860'
- 'Shanghai'
result:
a94f5374fce5edbc8e2a8697c15331677e6ebf0b:
nonce: 1
b94f5374fce5edbc8e2a8697c15331677e6ebf0b:
storage:
'0': '7b453b2ba212f731bec025f8f441f01547d79bfb'
'1': 1
'0': 1 # subcall successful
'1': 1 # test successful, no OOG
c94f5374fce5edbc8e2a8697c15331677e6ebf0b:
storage:
'0': '9e7a3337d18c31fe4c1fe51ab2da6cfd3629923d' # created account
# Difference with Merge is the charge for initcode 49152 // 32 * 2 = 3072 gas
'10': 55539
7b453b2ba212f731bec025f8f441f01547d79bfb:
'10': 55539 # gas used by CREATE
9e7a3337d18c31fe4c1fe51ab2da6cfd3629923d:
balance: 0
code: '0x600a80600080396000f3'
nonce: 1
Expand All @@ -107,15 +127,16 @@ create2InitCodeSizeLimit:
- indexes:
data: ':label invalid'
network:
- 'Merge+3860'
- 'Shanghai'
result:
a94f5374fce5edbc8e2a8697c15331677e6ebf0b:
nonce: 1
b94f5374fce5edbc8e2a8697c15331677e6ebf0b:
nonce: 0
storage:
'0': 0
'1': 1
'10': 50458
094147686c565aa7ccac18000c3b7b4d099f92d3:
'0': 0 # subcall aborted
'1': 1 # test successful, no OOG
c94f5374fce5edbc8e2a8697c15331677e6ebf0b:
storage: {}
67d49ae27e912b3b508d62ce1e463298db6edf32:
shouldnotexist: 1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ createInitCodeSizeLimit:
nonce: 0
storage: {}
b94f5374fce5edbc8e2a8697c15331677e6ebf0b:
balance: 0
code: |
:yul
{
mstore(0, calldataload(0))
let call_result := call(10000000, 0xc94f5374fce5edbc8e2a8697c15331677e6ebf0b, 0, 0, calldatasize(), 0, 0)
sstore(0, call_result)
sstore(1, 1)
}
nonce: 0
storage: {}
c94f5374fce5edbc8e2a8697c15331677e6ebf0b:
balance: 0
code: |
:yul
Expand All @@ -28,7 +40,6 @@ createInitCodeSizeLimit:
let create_result := create(0, 0, initcode_size)
sstore(10, sub(gas_before, gas()))
sstore(0, create_result)
sstore(1, 1)
}
nonce: 0
storage: {}
Expand Down Expand Up @@ -58,10 +69,13 @@ createInitCodeSizeLimit:
nonce: 1
b94f5374fce5edbc8e2a8697c15331677e6ebf0b:
storage:
'0': 'f1ecf98489fa9ed60a664fc4998db699cfa39d40'
'1': 1
'10': 43248
f1ecf98489fa9ed60a664fc4998db699cfa39d40:
'0': 1 # subcall successful
'1': 1 # test successful, no OOG
c94f5374fce5edbc8e2a8697c15331677e6ebf0b:
storage:
'0': '682327124c5d2dc0cd2158ba65d37ac3d2140c91' # created account
'10': 43248 # gas used by CREATE
682327124c5d2dc0cd2158ba65d37ac3d2140c91:
balance: 0
code: '0x600a80600080396000f3'
nonce: 1
Expand All @@ -76,10 +90,13 @@ createInitCodeSizeLimit:
nonce: 1
b94f5374fce5edbc8e2a8697c15331677e6ebf0b:
storage:
'0': 'f1ecf98489fa9ed60a664fc4998db699cfa39d40'
'1': 1
'10': 43257
f1ecf98489fa9ed60a664fc4998db699cfa39d40:
'0': 1 # subcall successful
'1': 1 # test successful, no OOG
c94f5374fce5edbc8e2a8697c15331677e6ebf0b:
storage:
'0': '682327124c5d2dc0cd2158ba65d37ac3d2140c91' # created account
'10': 43257 # gas used by CREATE
682327124c5d2dc0cd2158ba65d37ac3d2140c91:
balance: 0
code: '0x600a80600080396000f3'
nonce: 1
Expand All @@ -88,17 +105,20 @@ createInitCodeSizeLimit:
- indexes:
data: ':label valid'
network:
- 'Merge+3860'
- 'Shanghai'
result:
a94f5374fce5edbc8e2a8697c15331677e6ebf0b:
nonce: 1
b94f5374fce5edbc8e2a8697c15331677e6ebf0b:
storage:
'0': 'f1ecf98489fa9ed60a664fc4998db699cfa39d40'
'1': 1
'0': 1 # subcall successful
'1': 1 # test successful, no OOG
c94f5374fce5edbc8e2a8697c15331677e6ebf0b:
storage:
'0': '682327124c5d2dc0cd2158ba65d37ac3d2140c91' # created account
# Difference with Merge is the charge for initcode 49152 // 32 * 2 = 3072 gas
'10': 46320
f1ecf98489fa9ed60a664fc4998db699cfa39d40:
'10': 46320 # gas used by CREATE
682327124c5d2dc0cd2158ba65d37ac3d2140c91:
balance: 0
code: '0x600a80600080396000f3'
nonce: 1
Expand All @@ -107,15 +127,16 @@ createInitCodeSizeLimit:
- indexes:
data: ':label invalid'
network:
- 'Merge+3860'
- 'Shanghai'
result:
a94f5374fce5edbc8e2a8697c15331677e6ebf0b:
nonce: 1
b94f5374fce5edbc8e2a8697c15331677e6ebf0b:
nonce: 0
storage:
'0': 0
'1': 1
'10': 41233
f1ecf98489fa9ed60a664fc4998db699cfa39d40:
'0': 0 # subcall aborted
'1': 1 # test successful, no OOG
c94f5374fce5edbc8e2a8697c15331677e6ebf0b:
storage: {}
682327124c5d2dc0cd2158ba65d37ac3d2140c91:
shouldnotexist: 1
Loading