Skip to content
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
198 changes: 198 additions & 0 deletions BlockchainTests/InvalidBlocks/bcEIP1559/badBlocks.json

Large diffs are not rendered by default.

228 changes: 228 additions & 0 deletions BlockchainTests/InvalidBlocks/bcEIP1559/gasLimit20m.json

Large diffs are not rendered by default.

228 changes: 228 additions & 0 deletions BlockchainTests/InvalidBlocks/bcEIP1559/gasLimit40m.json

Large diffs are not rendered by default.

443 changes: 443 additions & 0 deletions BlockchainTests/ValidBlocks/bcEIP1559/baseFee.json

Large diffs are not rendered by default.

707 changes: 707 additions & 0 deletions BlockchainTests/ValidBlocks/bcEIP1559/burnVerify.json

Large diffs are not rendered by default.

330 changes: 330 additions & 0 deletions BlockchainTests/ValidBlocks/bcEIP1559/checkGasLimit.json

Large diffs are not rendered by default.

326 changes: 326 additions & 0 deletions BlockchainTests/ValidBlocks/bcEIP1559/feeCap.json

Large diffs are not rendered by default.

592 changes: 592 additions & 0 deletions BlockchainTests/ValidBlocks/bcEIP1559/highDemand.json

Large diffs are not rendered by default.

2,396 changes: 2,396 additions & 0 deletions BlockchainTests/ValidBlocks/bcEIP1559/lowDemand.json

Large diffs are not rendered by default.

1,507 changes: 1,507 additions & 0 deletions BlockchainTests/ValidBlocks/bcEIP1559/medDemand.json

Large diffs are not rendered by default.

1,293 changes: 1,293 additions & 0 deletions BlockchainTests/ValidBlocks/bcEIP1559/tips.json

Large diffs are not rendered by default.

300 changes: 300 additions & 0 deletions BlockchainTests/ValidBlocks/bcEIP1559/transType.json

Large diffs are not rendered by default.

135 changes: 135 additions & 0 deletions src/BlockchainTestsFiller/InvalidBlocks/bcEIP1559/badBlocksFiller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Check for block headers that don't obey EIP 1559
#
# 1. Incorrect baseFee after a block
# 2. gasTarget decreased by more than 1/1024
# 3. gasTarget increased by more than 1/1024


badBlocks:
genesisBlockHeader:
bloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
coinbase: '0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba'
difficulty: '131072'
extraData: '0x42'
gasUsed: '0'
mixHash: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
nonce: '0x0102030405060708'
number: '0'
parentHash: '0x0000000000000000000000000000000000000000000000000000000000000000'
receiptTrie: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
stateRoot: '0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a'
timestamp: '0x03b6'
transactionsTrie: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
uncleHash: '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347'
gasLimit: 1073741824 # 1024^3
baseFee: 1000
sealEngine: NoProof


pre:
0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b:
balance: 0x10000000000
code: ''
nonce: 1
storage: {}

0xd02d72E067e77158444ef2020Ff2d325f929B363:
balance: 0x1000000000000
nonce: 1
code: ''
storage: {}


# Spend all the gas you can
# (that is the result of a call with an illegal opcode)
0x1111111111111111111111111111111111111111:
balance: 0x10000000000
nonce: 1
code: :raw 0xfe
storage: {}




blocks:

# The baseFee is calculated, in a fixed manner, by the blockchain.
# If you specify the wrong one it won't work
#
# From the EIP:
#
# if parent_gas_used == parent_gas_target:
# expected_base_fee_per_gas = parent_base_fee_per_gas
# elif parent_gas_used > parent_gas_target:
# gas_used_delta = parent_gas_used - parent_gas_target
# base_fee_per_gas_delta = max(parent_base_fee_per_gas * gas_used_delta // parent_gas_target // BASE_FEE_MAX_CHANGE_DENOMINATOR, 1)
# expected_base_fee_per_gas = parent_base_fee_per_gas + base_fee_per_gas_delta
# else:
# gas_used_delta = parent_gas_target - parent_gas_used
# base_fee_per_gas_delta = parent_base_fee_per_gas * gas_used_delta // parent_gas_target // BASE_FEE_MAX_CHANGE_DENOMINATOR
# expected_base_fee_per_gas = max(parent_base_fee_per_gas - base_fee_per_gas_delta, 0)
# assert expected_base_fee_per_gas == block.base_fee_per_gas, 'invalid block: base fee not correct'

- blockHeader:
baseFee: 0x36c
expectException:
'>=London': 1559BlockImportImpossible_BaseFeeWrong
transactions: []
- blockHeader:
baseFee: 0x36a
expectException:
'>=London': 1559BlockImportImpossible_BaseFeeWrong
transactions: []
- blockHeader:
baseFee: 0x36b
transactions: []


# gasTarget can be decreased, but by no more than 1/1024 per block.
# gasLimit is twice gasTarget, so it is the same fraction.
#
# From the EIP:
#
# assert block.gas_target >= parent_gas_target - parent_gas_target // 1024, 'invalid block: gas target decreased too much'

- blockHeader:
gasLimit: 1072693247
expectException:
'>=London': 1559BlockImportImpossible_TargetGasLow
transactions: []
- blockHeader:
gasLimit: 1072693248 # 1024*1024*1023 (1023/1024 of the previous gasLimit)
transactions: []


# gasTarget can be increased, but by no more than 1/1024 per block.
# gasLimit is twice gasTarget, so it is the same fraction.
#
# From the EIP:
#
# assert block.gas_target <= parent_gas_target + parent_gas_target // 1024, 'invalid block: gas target increased too much'

- blockHeader:
gasLimit: 1073740802
expectException:
'>=London': 1559BlockImportImpossible_TargetGasHigh
transactions: []
- blockHeader:
# 1024*1023*1025 (1025/1024 of the previous limit) plus one. The one is accepted
# because of the effects of integer division
gasLimit: 1073740801
transactions: []






expect:
- network:
- ">=London"
# No real result, this test is based on exceptions
# No transactions, so no need to check the nonces either
result: {}


Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Check the how far gasLimit can stretch from block to block
#
# Test cases taken from:
# https://github.com/ethereum/go-ethereum/blob/c9116a7c19301d6906c1aff87085c2fa345a84bf/consensus/misc/eip1559_test.go#L62


gasLimit20m:
genesisBlockHeader:
bloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
coinbase: '0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba'
difficulty: '131072'
extraData: '0x42'
gasUsed: '0'
mixHash: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
nonce: '0x0102030405060708'
number: '0'
parentHash: '0x0000000000000000000000000000000000000000000000000000000000000000'
receiptTrie: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
stateRoot: '0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a'
timestamp: '0x03b6'
transactionsTrie: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
uncleHash: '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347'
gasLimit: 20000000
baseFee: 1000
sealEngine: NoProof


pre:
0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b:
balance: 0x10000000000
code: ''
nonce: 1
storage: {}

0xd02d72E067e77158444ef2020Ff2d325f929B363:
balance: 0x1000000000000
nonce: 1
code: ''
storage: {}


blocks:

# It's OK for the block to have the same gasLimit as the previous one
- blockHeader:
gasLimit: 20000000
transactions: []

# The gasLimit can go down, but only to 1023/1024 of the current limit
- blockHeader:
gasLimit: 19980469
expectException:
'>=London': 1559BlockImportImpossible_TargetGasLow
transactions: []
- blockHeader:
gasLimit: 19980470
transactions: []


# Go back to the 20m limit
- blockHeader:
gasLimit: 19990000
transactions: []
- blockHeader:
gasLimit: 20000000
transactions: []


# The gasLimit can go up, but only to 1025/1024 of the current limit
- blockHeader:
gasLimit: 20019532
expectException:
'>=London': 1559BlockImportImpossible_TargetGasHigh
transactions: []
- blockHeader:
gasLimit: 20019531
transactions: []


expect:
- network:
- ">=London"
# No real result, this test is based on exceptions
# (where they occur and where they don't)
result: {}


Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Check the how far gasLimit can stretch from block to block
#
# Test cases taken from:
# https://github.com/ethereum/go-ethereum/blob/c9116a7c19301d6906c1aff87085c2fa345a84bf/consensus/misc/eip1559_test.go#L62


gasLimit40m:
genesisBlockHeader:
bloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
coinbase: '0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba'
difficulty: '131072'
extraData: '0x42'
gasUsed: '0'
mixHash: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
nonce: '0x0102030405060708'
number: '0'
parentHash: '0x0000000000000000000000000000000000000000000000000000000000000000'
receiptTrie: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
stateRoot: '0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a'
timestamp: '0x03b6'
transactionsTrie: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
uncleHash: '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347'
gasLimit: 40000000
baseFee: 1000
sealEngine: NoProof


pre:
0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b:
balance: 0x10000000000
code: ''
nonce: 1
storage: {}

0xd02d72E067e77158444ef2020Ff2d325f929B363:
balance: 0x1000000000000
nonce: 1
code: ''
storage: {}


blocks:

# It's OK for the block to have the same gasLimit as the previous one
- blockHeader:
gasLimit: 40000000
transactions: []

# The gasLimit can go down, but only to 1023/1024 of the current limit
- blockHeader:
gasLimit: 39960937
expectException:
'>=London': 1559BlockImportImpossible_TargetGasLow
transactions: []
- blockHeader:
gasLimit: 39960938
transactions: []


# Go back to the 40m limit
- blockHeader:
gasLimit: 39980000
transactions: []
- blockHeader:
gasLimit: 40000000
transactions: []


# The gasLimit can go up, but only to 1025/1024 of the current limit
- blockHeader:
gasLimit: 40039064
expectException:
'>=London': 1559BlockImportImpossible_TargetGasHigh
transactions: []
- blockHeader:
gasLimit: 40039063
transactions: []


expect:
- network:
- ">=London"
# No real result, this test is based on exceptions
# (where they occur and where they don't)
result: {}


Loading