Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save garyschulte/58ef600b6889287e153a96c41879814d to your computer and use it in GitHub Desktop.
Save garyschulte/58ef600b6889287e153a96c41879814d to your computer and use it in GitHub Desktop.
badTimestampFiller
# This test looks for a few possible problem states with timestamps:
#
# 1. A block with the same timestamp as the parent is invalid
# 2. A block with a timestamp prior to its parent is invalid
# 3. A block with a timestamp one microsecond after its parent is valid
#
# All three conditions come from inequality (49) of the yellow paper
# (https://ethereum.github.io/yellowpaper/paper.pdf, p. 7)
#
# Note that as this test includes blocks that create exceptions, it cannot be
# --filltests on besu currently.
badTimestamp:
genesisBlockHeader:
timestamp: 0 # The beginning of the epoch
bloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
coinbase: '0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba'
difficulty: '131072'
extraData: '0x42'
gasUsed: '0'
mixHash: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
nonce: '0x0102030405060708'
number: '0'
parentHash: '0x0000000000000000000000000000000000000000000000000000000000000000'
receiptTrie: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
stateRoot: '0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a'
transactionsTrie: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
uncleHash: '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347'
gasLimit: 1073741824
baseFeePerGas: 1000
sealEngine: NoProof
pre:
0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b:
balance: 0x10000000000
code: ''
nonce: 1
storage: {}
0xd02d72E067e77158444ef2020Ff2d325f929B363:
balance: 0x1000000000000
nonce: 1
code: ''
storage: {}
blocks:
# block from 1998
- blockHeader:
timestamp: 1000
blocknumber: 1
transactions: []
# block from 2055
- blockHeader:
timestamp: 2015
blocknumber: 2
transactions: []
expect:
- network:
- ">=London"
# No real result, this test is based on exceptions
# No transactions, so no need to check the nonces either
result: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment