Skip to content

Commit

Permalink
EIP-2681: Limit account nonce to 2^64-1
Browse files Browse the repository at this point in the history
  • Loading branch information
gumb0 committed Nov 3, 2021
1 parent 80c7389 commit 682165e
Show file tree
Hide file tree
Showing 6 changed files with 2,058 additions and 0 deletions.
554 changes: 554 additions & 0 deletions BlockchainTests/GeneralStateTests/stCreate2/CREATE2_HighNonce.json

Large diffs are not rendered by default.

1,104 changes: 1,104 additions & 0 deletions BlockchainTests/GeneralStateTests/stCreateTest/CREATE_HighNonce.json

Large diffs are not rendered by default.

114 changes: 114 additions & 0 deletions GeneralStateTests/stCreate2/CREATE2_HighNonce.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"CREATE2_HighNonce" : {
"_info" : {
"comment" : "",
"filling-rpc-server" : "evm version 1.10.8-unstable-d0127f6f-20210819",
"filling-tool-version" : "retesteth-0.1.2-london-spdataobj+commit.9940c762.Linux.g++",
"lllcversion" : "Version: 0.5.14-develop.2021.4.29+commit.14c9d5de.Linux.clang",
"source" : "src/GeneralStateTestsFiller/stCreate2/CREATE2_HighNonceFiller.yml",
"sourceHash" : "bb8efecd6ef9386bb8368c70c4e55264c0117c0a76413f12fae94e90ad7f5f08"
},
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x020000",
"currentNumber" : "0x01",
"currentTimestamp" : "0x03e8",
"previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentGasLimit" : "0x05500000",
"currentBaseFee" : "0x0a"
},
"post" : {
"Berlin" : [
{
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"hash" : "0x437ed73104c2f6337a4cde09c15fae6cf1b4467889145953b089bb14eb4efb81",
"txbytes" : "0xf861800a84042c1d8094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80801ca0f141d67812db948c9a4ea43c27d695248205c121ae8d924d23517ab09e38f369a03fe3cfedb4c9a7e61340b6fec87917690e92082f752ad820ad5006c7d49185ed",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
],
"Constantinople" : [
{
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"hash" : "0x66f0823525a836bc837aa714e5be7809ea45ef3dc8ae3ea30bd952c64e999c37",
"txbytes" : "0xf861800a84042c1d8094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80801ca0f141d67812db948c9a4ea43c27d695248205c121ae8d924d23517ab09e38f369a03fe3cfedb4c9a7e61340b6fec87917690e92082f752ad820ad5006c7d49185ed",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
],
"ConstantinopleFix" : [
{
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"hash" : "0xc569f7785b48eb43f961cdc95d40eb4f8b7a04de1a68a954f6aa47e1ab17bae7",
"txbytes" : "0xf861800a84042c1d8094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80801ca0f141d67812db948c9a4ea43c27d695248205c121ae8d924d23517ab09e38f369a03fe3cfedb4c9a7e61340b6fec87917690e92082f752ad820ad5006c7d49185ed",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
],
"Istanbul" : [
{
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"hash" : "0x35802674df1229bf0461250a916b93ec70907dc9bf85b80fe028ddac286bf74b",
"txbytes" : "0xf861800a84042c1d8094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80801ca0f141d67812db948c9a4ea43c27d695248205c121ae8d924d23517ab09e38f369a03fe3cfedb4c9a7e61340b6fec87917690e92082f752ad820ad5006c7d49185ed",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
],
"London" : [
{
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"hash" : "0x49ef2f48f9412e6d33fbf208e0f1472f28fb4a79d6424d3056e8ae09099791e6",
"txbytes" : "0xf861800a84042c1d8094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80801ca0f141d67812db948c9a4ea43c27d695248205c121ae8d924d23517ab09e38f369a03fe3cfedb4c9a7e61340b6fec87917690e92082f752ad820ad5006c7d49185ed",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
]
},
"pre" : {
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x3b9aca00",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
},
"0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x00",
"code" : "0x7f60016000f30000000000000000000000000000000000000000000000000000006000526000600560006000f56000556001600155",
"nonce" : "0xffffffffffffffff",
"storage" : {
}
}
},
"transaction" : {
"data" : [
"0x"
],
"gasPrice" : "0x0a",
"gasLimit" : [
"0x042c1d80"
],
"nonce" : "0x00",
"secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"value" : [
"0x00"
]
}
}
}
174 changes: 174 additions & 0 deletions GeneralStateTests/stCreateTest/CREATE_HighNonce.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
{
"CREATE_HighNonce" : {
"_info" : {
"comment" : "",
"filling-rpc-server" : "evm version 1.10.9-unstable-36580c62-20210824",
"filling-tool-version" : "retesteth-0.1.2-london-spdataobj+commit.9940c762.Linux.g++",
"lllcversion" : "Version: 0.5.14-develop.2021.4.29+commit.14c9d5de.Linux.clang",
"source" : "src/GeneralStateTestsFiller/stCreateTest/CREATE_HighNonceFiller.yml",
"sourceHash" : "8d50f9d652a26b5f41a1d45e6a0b2e600d5c11986b43682261919c1e5419168e"
},
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x020000",
"currentNumber" : "0x01",
"currentTimestamp" : "0x03e8",
"previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentGasLimit" : "0x05500000",
"currentBaseFee" : "0x0a"
},
"post" : {
"Berlin" : [
{
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"hash" : "0xcff65a094b0dc02ba5900604cff898913af815a1a622f59673aa8b8842bf726f",
"txbytes" : "0xf861800a84042c1d8094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80801ca0f141d67812db948c9a4ea43c27d695248205c121ae8d924d23517ab09e38f369a03fe3cfedb4c9a7e61340b6fec87917690e92082f752ad820ad5006c7d49185ed",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
],
"Byzantium" : [
{
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"hash" : "0x4017a0497eb7cf1056f1d0bf8966f80236952fc3ac2ca5eff09ac7f19892e286",
"txbytes" : "0xf861800a84042c1d8094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80801ca0f141d67812db948c9a4ea43c27d695248205c121ae8d924d23517ab09e38f369a03fe3cfedb4c9a7e61340b6fec87917690e92082f752ad820ad5006c7d49185ed",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
],
"Constantinople" : [
{
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"hash" : "0x4d502efded1975fae5b36dbd9d05bd8d9b41679e1e0fb2b90080c1be7786e8d3",
"txbytes" : "0xf861800a84042c1d8094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80801ca0f141d67812db948c9a4ea43c27d695248205c121ae8d924d23517ab09e38f369a03fe3cfedb4c9a7e61340b6fec87917690e92082f752ad820ad5006c7d49185ed",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
],
"ConstantinopleFix" : [
{
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"hash" : "0x4017a0497eb7cf1056f1d0bf8966f80236952fc3ac2ca5eff09ac7f19892e286",
"txbytes" : "0xf861800a84042c1d8094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80801ca0f141d67812db948c9a4ea43c27d695248205c121ae8d924d23517ab09e38f369a03fe3cfedb4c9a7e61340b6fec87917690e92082f752ad820ad5006c7d49185ed",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
],
"EIP150" : [
{
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"hash" : "0x4017a0497eb7cf1056f1d0bf8966f80236952fc3ac2ca5eff09ac7f19892e286",
"txbytes" : "0xf861800a84042c1d8094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80801ca0f141d67812db948c9a4ea43c27d695248205c121ae8d924d23517ab09e38f369a03fe3cfedb4c9a7e61340b6fec87917690e92082f752ad820ad5006c7d49185ed",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
],
"EIP158" : [
{
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"hash" : "0x4017a0497eb7cf1056f1d0bf8966f80236952fc3ac2ca5eff09ac7f19892e286",
"txbytes" : "0xf861800a84042c1d8094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80801ca0f141d67812db948c9a4ea43c27d695248205c121ae8d924d23517ab09e38f369a03fe3cfedb4c9a7e61340b6fec87917690e92082f752ad820ad5006c7d49185ed",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
],
"Frontier" : [
{
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"hash" : "0x4017a0497eb7cf1056f1d0bf8966f80236952fc3ac2ca5eff09ac7f19892e286",
"txbytes" : "0xf861800a84042c1d8094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80801ca0f141d67812db948c9a4ea43c27d695248205c121ae8d924d23517ab09e38f369a03fe3cfedb4c9a7e61340b6fec87917690e92082f752ad820ad5006c7d49185ed",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
],
"Homestead" : [
{
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"hash" : "0x4017a0497eb7cf1056f1d0bf8966f80236952fc3ac2ca5eff09ac7f19892e286",
"txbytes" : "0xf861800a84042c1d8094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80801ca0f141d67812db948c9a4ea43c27d695248205c121ae8d924d23517ab09e38f369a03fe3cfedb4c9a7e61340b6fec87917690e92082f752ad820ad5006c7d49185ed",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
],
"Istanbul" : [
{
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"hash" : "0xb59e1940dc473d0b847268ee48c97198df43b082f5b8240735fb440cb8c4bd93",
"txbytes" : "0xf861800a84042c1d8094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80801ca0f141d67812db948c9a4ea43c27d695248205c121ae8d924d23517ab09e38f369a03fe3cfedb4c9a7e61340b6fec87917690e92082f752ad820ad5006c7d49185ed",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
],
"London" : [
{
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"hash" : "0x190a1fe96e63097d97f3fb3cabb991b711df6957aff6093c4642b0409a7b731e",
"txbytes" : "0xf861800a84042c1d8094b94f5374fce5edbc8e2a8697c15331677e6ebf0b80801ca0f141d67812db948c9a4ea43c27d695248205c121ae8d924d23517ab09e38f369a03fe3cfedb4c9a7e61340b6fec87917690e92082f752ad820ad5006c7d49185ed",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
]
},
"pre" : {
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x3b9aca00",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
},
"0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x00",
"code" : "0x7f60016000f3000000000000000000000000000000000000000000000000000000600052600560006000f06000556001600155",
"nonce" : "0xffffffffffffffff",
"storage" : {
}
}
},
"transaction" : {
"data" : [
"0x"
],
"gasPrice" : "0x0a",
"gasLimit" : [
"0x042c1d80"
],
"nonce" : "0x00",
"secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"value" : [
"0x00"
]
}
}
}
56 changes: 56 additions & 0 deletions src/GeneralStateTestsFiller/stCreate2/CREATE2_HighNonceFiller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# The test calls CREATE2 from an account with max allowed nonce.
CREATE2_HighNonce:
env:
currentCoinbase: 2adc25665018aa1fe0e6bc666dac8fc2697ff9ba
currentDifficulty: '0x020000'
currentGasLimit: '89128960'
currentBaseFee: '10'
currentNumber: '1'
currentTimestamp: '1000'
previousHash: 5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6

pre:
a94f5374fce5edbc8e2a8697c15331677e6ebf0b:
balance: 1000000000
code: ''
nonce: 0
storage: {}
b94f5374fce5edbc8e2a8697c15331677e6ebf0b:
balance: 0
code: |
:yul
{
// initcode: { return(0, 1) }
mstore(0, 0x60016000f3000000000000000000000000000000000000000000000000000000)
sstore(0, create2(0, 0, 5, 0))
sstore(1, 1)
}
nonce: '0xffffffffffffffff'
storage: {}

transaction:
data:
- ''
gasLimit:
- 70000000
gasPrice: 10
nonce: 0
secretKey: 45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8
to: 'b94f5374fce5edbc8e2a8697c15331677e6ebf0b'
value:
- 0

expect:
- indexes:
data: !!int -1
gas: !!int -1
value: !!int -1
network:
- '>=Constantinople'
result:
a94f5374fce5edbc8e2a8697c15331677e6ebf0b:
nonce: 1
b94f5374fce5edbc8e2a8697c15331677e6ebf0b:
nonce: '0xffffffffffffffff'
storage:
'1': 1
Loading

0 comments on commit 682165e

Please sign in to comment.