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 Aug 24, 2021
1 parent 6f41f7b commit 10932c7
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 0 deletions.
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# The test calls CREATE from an account with max allowed nonce.
CREATE_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, create(0, 0, 5))
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:
- '>=Frontier'
result:
a94f5374fce5edbc8e2a8697c15331677e6ebf0b:
nonce: 1
b94f5374fce5edbc8e2a8697c15331677e6ebf0b:
nonce: '0xffffffffffffffff'
storage:
'1': 1

0 comments on commit 10932c7

Please sign in to comment.