Skip to content

Commit

Permalink
feat: add EIP4895 vectors and update block processing scripts (#34)
Browse files Browse the repository at this point in the history
* feat: add EIP4895 vectors and update block processing scripts

* fix: update script to apply EIP4895 vectors instead of EIP1559 blocks
  • Loading branch information
debjit-bw authored Dec 4, 2024
1 parent 8b387bd commit 84b7c5a
Show file tree
Hide file tree
Showing 7 changed files with 349 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/post-merge-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,10 @@ jobs:
run: bash ./scripts/generate_eip1559_vectors.sh
- name: Apply EIP1559 vectors to Reth
run: bash ./scripts/apply_test_vectors_reth.sh eip1559_blocks 1
# EIP4895 test vectors against Nethermind
- name: Generate EIP4895 vectors through Nethermind
run: bash ./scripts/generate_eip4895_vectors.sh
- name: Apply EIP4895 vectors to Reth
run: bash ./scripts/apply_test_vectors_reth.sh eip4895_blocks 2


4 changes: 2 additions & 2 deletions scripts/apply_test_vectors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ function apply_block_file() {
-H "Authorization: Bearer $JWT_TOKEN" \
--data "{
\"jsonrpc\":\"2.0\",
\"method\":\"engine_newPayloadV1\",
\"method\":\"engine_newPayloadV2\",
\"params\":[
$BLOCK
],
\"id\":1
}" \
http://localhost:8546 \
)
echo engine_newPayloadV1 with new block RESPONSE $RESPONSE
echo engine_newPayloadV2 with new block RESPONSE $RESPONSE

BLOCK_HASH=$(echo $BLOCK | jq --raw-output '.blockHash')

Expand Down
10 changes: 6 additions & 4 deletions scripts/chiado_genesis_alloc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
},
"terminalTotalDifficulty": 0,
"terminalTotalDifficultyPassed": true,
"shanghaiTime": 9999999999,
"cancunTime": 9999999999,
"shanghaiTime": 1704401480,
"cancunTime": 9704401480,
"minBlobGasPrice": 1000000000,
"maxBlobGasPerBlock": 262144,
"targetBlobGasPerBlock": 131072,
Expand Down Expand Up @@ -53,15 +53,17 @@
"randomnessContractAddress": {
"0": "0x3000000000000000000000000000000000000001"
},
"withdrawalContractAddress": "0xbabe2bed00000000000000000000000000000003",
"withdrawalContractAddress": "0x566b8783a28a46dc8d88ebf712303938985e121e",
"twoThirdsMajorityTransition": 0,
"posdaoTransition": 0,
"blockGasLimitContractTransitions": {
"0": "0x4000000000000000000000000000000000000001"
},
"registrar": "0x6000000000000000000000000000000000000000"
},
"eip1559collector": "0x1559000000000000000000000000000000000000"
"eip1559collector": "0x1559000000000000000000000000000000000000",
"depositContractAddress":
"0x566b8783a28a46dc8d88ebf712303938985e121e"
},
"baseFeePerGas": "0x3b9aca00",
"difficulty": "0x01",
Expand Down
19 changes: 19 additions & 0 deletions scripts/eip4895_blocks/block_1.json

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions scripts/eip4895_blocks/block_2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"baseFeePerGas": "0x31a2a1de",
"blockHash": "0x283bffaaddd1d449572838ae60e8fcea891fee29c8f5e76b5efd5c99fb4107da",
"blockNumber": "0x2",
"extraData": "0x4e65746865726d696e64",
"feeRecipient": "0x0000000000000000000000000000000000000000",
"gasLimit": "0x989680",
"gasUsed": "0x0",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"parentHash": "0xe4dc10cdb7b654e3dc9217484a5348d0f951b7cf240ee635a69b8c34596accea",
"prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot": "0x03f2eb7ed1fd38d6e907d6671988c098a5a0d1d289cf2499633d0a402314b274",
"timestamp": "0x65971a61",
"transactions": [],
"withdrawals": [
{
"index": "0xf0",
"validatorIndex": "0xf0",
"address": "0x38e3e7aca6762e296f659fcb4e460a3a621dcd3d",
"amount": "0x10000000000"
}
]
}
287 changes: 287 additions & 0 deletions scripts/generate_eip4895_vectors.sh

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions scripts/networkdata/chainspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"randomnessContractAddress": {
"0": "0x3000000000000000000000000000000000000001"
},
"withdrawalContractAddress": "0xbabe2bed00000000000000000000000000000003",
"withdrawalContractAddress": "0x566b8783a28a46dc8d88ebf712303938985e121e",
"twoThirdsMajorityTransition": 0,
"posdaoTransition": 0,
"blockGasLimitContractTransitions": {
Expand Down Expand Up @@ -71,11 +71,11 @@
"eip3855TransitionTimestamp": "0x65971a48",
"eip3651TransitionTimestamp": "0x65971a48",
"eip3860TransitionTimestamp": "0x65971a48",
"eip4844TransitionTimestamp": "0x65971a48",
"eip4788TransitionTimestamp": "0x65971a48",
"eip1153TransitionTimestamp": "0x65971a48",
"eip5656TransitionTimestamp": "0x65971a48",
"eip6780TransitionTimestamp": "0x65971a48"
"eip4844TransitionTimestamp": "0x965971a48",
"eip4788TransitionTimestamp": "0x965971a48",
"eip1153TransitionTimestamp": "0x965971a48",
"eip5656TransitionTimestamp": "0x965971a48",
"eip6780TransitionTimestamp": "0x965971a48"
},
"genesis": {
"baseFeePerGas": "0x3b9aca00",
Expand Down

0 comments on commit 84b7c5a

Please sign in to comment.