Skip to content

Commit

Permalink
Eip1559 block production pattern (#32)
Browse files Browse the repository at this point in the history
* changes to old chainspec and how node is stopped

* adding eip1559 test vectors in the form of blocks

* changing chainid to 10209 for reth

* ci fix
  • Loading branch information
debjit-bw authored Nov 24, 2024
1 parent 7a1d49e commit 9baa4b6
Show file tree
Hide file tree
Showing 12 changed files with 273 additions and 19 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 @@ -46,5 +46,10 @@ jobs:
# Test vectors against Reth
- name: Apply vectors to Reth
run: bash ./scripts/apply_test_vectors_reth.sh
# EIP1559 test vectors against Nethermind
- name: Generate EIP1559 vectors through Nethermind
run: bash ./scripts/generate_eip1559_vectors.sh
- name: Apply EIP1559 vectors to Reth
run: bash ./scripts/apply_test_vectors_reth.sh eip1559_blocks 1


5 changes: 3 additions & 2 deletions scripts/apply_test_vectors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ set -e
# Script's directory
DIR="$(dirname "$0")"

OUT_DIR=$DIR/blocks
BLOCKS_FOLDER=${1:-blocks}
OUT_DIR=$DIR/$BLOCKS_FOLDER

N=5
N=${2:-5}

# Retry the curl command until it succeeds
until curl -X POST -H "Content-Type: application/json" \
Expand Down
7 changes: 6 additions & 1 deletion scripts/apply_test_vectors_reth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ DIR="$(dirname "$0")"
$DIR/run_reth.sh &
BG_PID=$!

BLOCKS_FOLDER=${1:-blocks}
N=${2:-5}

# Set the trap to call cleanup if an error occurs
cleanup() {
echo "Stopping node process (PID: $BG_PID)..."
kill $BG_PID 2>/dev/null || true

pkill -f "reth node" || true
}
trap cleanup EXIT

$DIR/apply_test_vectors.sh
$DIR/apply_test_vectors.sh $BLOCKS_FOLDER $N


6 changes: 3 additions & 3 deletions scripts/blocks/block_1.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"baseFeePerGas": "0x342770c0",
"blockHash": "0xc0f683b61355455d49af3dbb11fe1f65e9ae8670890d6fb1aadcbf5f8acc960b",
"blockHash": "0x9636978fddf349fc5e92e85b2080d99b5c3e44c745359a77e603e7f1a76f440c",
"blockNumber": "0x1",
"extraData": "0x4e65746865726d696e64",
"feeRecipient": "0x0000000000000000000000000000000000000000",
"gasLimit": "0x989680",
"gasUsed": "0x0",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"parentHash": "0xa7931c99fd2b7b5e323a2fda8a2dd607cea04f03835c3f29bfe7c057c8b5672e",
"parentHash": "0x574c165efc3205be13affbd3bc165df6a6a023e21d142dd4f4c682d2aa3a054e",
"prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot": "0xa59f6ea19d9ee6d7e79bcb286e6d8838b47b48351b37960e24c0a72d41fa1629",
"stateRoot": "0xe65e8c7050e23e1f25c7f56416f899b1ce15ec130ee0460b12529b92b4a8ba81",
"timestamp": "0x6553f101",
"transactions": []
}
6 changes: 3 additions & 3 deletions scripts/blocks/block_2.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"baseFeePerGas": "0x2da282a8",
"blockHash": "0xc314b27368528ec560d035ef9f5dc46e2aea6d21b618eeb37e91723fefdfb2d9",
"blockHash": "0xb413c62db3a7b82636aa984736933c1956d930d085d04a1b184298c76e56c786",
"blockNumber": "0x2",
"extraData": "0x4e65746865726d696e64",
"feeRecipient": "0x0000000000000000000000000000000000000000",
"gasLimit": "0x989680",
"gasUsed": "0x0",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"parentHash": "0xc0f683b61355455d49af3dbb11fe1f65e9ae8670890d6fb1aadcbf5f8acc960b",
"parentHash": "0x9636978fddf349fc5e92e85b2080d99b5c3e44c745359a77e603e7f1a76f440c",
"prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot": "0xa59f6ea19d9ee6d7e79bcb286e6d8838b47b48351b37960e24c0a72d41fa1629",
"stateRoot": "0xe65e8c7050e23e1f25c7f56416f899b1ce15ec130ee0460b12529b92b4a8ba81",
"timestamp": "0x6553f102",
"transactions": []
}
6 changes: 3 additions & 3 deletions scripts/blocks/block_3.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"baseFeePerGas": "0x27ee3253",
"blockHash": "0xd51a4d79676ddad8e938c38ec1344a77feefa369475acb358563f37a74a4d9d6",
"blockHash": "0xe49ebede05072552a7b99bb2e75db0e69d88640ec1dbdcf08cb3f579fd9a504d",
"blockNumber": "0x3",
"extraData": "0x4e65746865726d696e64",
"feeRecipient": "0x0000000000000000000000000000000000000000",
"gasLimit": "0x989680",
"gasUsed": "0x0",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"parentHash": "0xc314b27368528ec560d035ef9f5dc46e2aea6d21b618eeb37e91723fefdfb2d9",
"parentHash": "0xb413c62db3a7b82636aa984736933c1956d930d085d04a1b184298c76e56c786",
"prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot": "0xa59f6ea19d9ee6d7e79bcb286e6d8838b47b48351b37960e24c0a72d41fa1629",
"stateRoot": "0xe65e8c7050e23e1f25c7f56416f899b1ce15ec130ee0460b12529b92b4a8ba81",
"timestamp": "0x6553f103",
"transactions": []
}
6 changes: 3 additions & 3 deletions scripts/blocks/block_4.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"baseFeePerGas": "0x22f06c09",
"blockHash": "0x011405450b1431877c952c73d0ea0c964c67d006b3134aea5be7a59823e40e39",
"blockHash": "0xfc5dc793bc70c93c53fe3c37578b197b07a0173a76d5ac553f590b8da404fa81",
"blockNumber": "0x4",
"extraData": "0x4e65746865726d696e64",
"feeRecipient": "0x0000000000000000000000000000000000000000",
"gasLimit": "0x989680",
"gasUsed": "0x0",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"parentHash": "0xd51a4d79676ddad8e938c38ec1344a77feefa369475acb358563f37a74a4d9d6",
"parentHash": "0xe49ebede05072552a7b99bb2e75db0e69d88640ec1dbdcf08cb3f579fd9a504d",
"prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot": "0xa59f6ea19d9ee6d7e79bcb286e6d8838b47b48351b37960e24c0a72d41fa1629",
"stateRoot": "0xe65e8c7050e23e1f25c7f56416f899b1ce15ec130ee0460b12529b92b4a8ba81",
"timestamp": "0x6553f104",
"transactions": []
}
6 changes: 3 additions & 3 deletions scripts/blocks/block_5.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"baseFeePerGas": "0x1e925e88",
"blockHash": "0x9a86f6d4d524388c300b8a09a145d0406fcf13d343ef8574c46fc0ffad9a45a0",
"blockHash": "0x656513d04face451d8c08cdfcc98f2270193f13a665b1c216c5a9c21fbcdf373",
"blockNumber": "0x5",
"extraData": "0x4e65746865726d696e64",
"feeRecipient": "0x0000000000000000000000000000000000000000",
"gasLimit": "0x989680",
"gasUsed": "0x0",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"parentHash": "0x011405450b1431877c952c73d0ea0c964c67d006b3134aea5be7a59823e40e39",
"parentHash": "0xfc5dc793bc70c93c53fe3c37578b197b07a0173a76d5ac553f590b8da404fa81",
"prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot": "0xa59f6ea19d9ee6d7e79bcb286e6d8838b47b48351b37960e24c0a72d41fa1629",
"stateRoot": "0xe65e8c7050e23e1f25c7f56416f899b1ce15ec130ee0460b12529b92b4a8ba81",
"timestamp": "0x6553f105",
"transactions": []
}
7 changes: 6 additions & 1 deletion scripts/chiado_genesis_alloc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"config": {
"chainId": 10200,
"chainId": 10209,
"consensus": "aura",
"homesteadBlock": 0,
"eip150Block": 0,
Expand Down Expand Up @@ -415,6 +415,11 @@
"nonce": "0",
"balance": "0",
"code": ""
},
"0x38e3E7Aca6762E296F659Fcb4E460a3A621dcD3D": {
"nonce": "0",
"balance": "1000000000000000000000000000000",
"code": ""
}
}
}
19 changes: 19 additions & 0 deletions scripts/eip1559_blocks/block_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"baseFeePerGas": "0x342770c0",
"blockHash": "0x6395103a8c0d218db01d86ec39ddbb2bb1fa3322212edc86161ced239d7b22d0",
"blockNumber": "0x1",
"extraData": "0x4e65746865726d696e64",
"feeRecipient": "0x0000000000000000000000000000000000000000",
"gasLimit": "0x989680",
"gasUsed": "0xa410",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"parentHash": "0x574c165efc3205be13affbd3bc165df6a6a023e21d142dd4f4c682d2aa3a054e",
"prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000",
"receiptsRoot": "0x75308898d571eafb5cd8cde8278bf5b3d13c5f6ec074926de3bb895b519264e1",
"stateRoot": "0x92b45458b060012dafdc7fd6527fcadba305ae167d730396e4fcd2e49c22ed44",
"timestamp": "0x6553f101",
"transactions": [
"0x02f8718227e180849502f900849502f90083030d4094b42a8c62f3278afc9343a8fccd5232cbe8aa5117844190ab0080c001a030d96a5f8ecd0913c26353b43ffb99bbde21ff56e01221b5f967c1c046b29932a05c7f6b32eac2748a2d2b6d34b0b93f17566cf879bdb7935a859ecf7892af0272",
"0x02f8718227e101849502f900849502f90083030d4094c390cc49a32736a58733cf46be42f734dd4f53cb844190ab0080c080a0f5eb15e18cc9da329f006e79ae53ef13ec0879857a90e0825343dca03448cbe2a05e3f7c89869b3a865c4f7760b4e5b5fd52669ecb9aec2a064f4ea0cbb68e1b2e"
]
}
Loading

0 comments on commit 9baa4b6

Please sign in to comment.