Skip to content

Commit

Permalink
Run Reth
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed Jul 12, 2024
1 parent 31fce61 commit d83f0b1
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 10 deletions.
24 changes: 23 additions & 1 deletion generate_test_vectors.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#!/bin/bash

docker run --name neth-vec-gen --rm \
# Clean up existing container if it exists
docker rm -f neth-vec-gen 2>/dev/null

# Start the container in the background
docker run --name neth-vec-gen --rm -d \
-v $PWD/networkdata:/networkdata \
-p 8545:8545 \
-p 8546:8546 \
nethermind/nethermind \
--config=none \
--Init.ChainSpecPath=/networkdata/chainspec.json \
Expand All @@ -14,3 +20,19 @@ docker run --name neth-vec-gen --rm \
--JsonRpc.EnginePort=8546 \
--JsonRpc.JwtSecretFile=/networkdata/jwtsecret \
--TraceStore.Enabled=true

# Capture the logs in the background
docker logs -f neth-vec-gen &

# Retry the curl command until it succeeds
until curl -X POST -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x0", false],"id":1}' \
http://localhost:8545; do
echo "Retrying..."
sleep 2
done


# Clean up container
docker rm -f neth-vec-gen 2>/dev/null

18 changes: 9 additions & 9 deletions networkdata/chainspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@
"eip4844MinBlobGasPrice": "0x3b9aca00",
"eip4844TargetBlobGasPerBlock": "0x20000",
"maxCodeSizeTransitionTimestamp": "0x0",
"eip4895TransitionTimestamp": "0x0",
"eip3855TransitionTimestamp": "0x0",
"eip3651TransitionTimestamp": "0x0",
"eip3860TransitionTimestamp": "0x0",
"eip4844TransitionTimestamp": "0x0",
"eip4788TransitionTimestamp": "0x0",
"eip1153TransitionTimestamp": "0x0",
"eip5656TransitionTimestamp": "0x0",
"eip6780TransitionTimestamp": "0x0"
"eip4895TransitionTimestamp": "0x65971a48",
"eip3855TransitionTimestamp": "0x65971a48",
"eip3651TransitionTimestamp": "0x65971a48",
"eip3860TransitionTimestamp": "0x65971a48",
"eip4844TransitionTimestamp": "0x65971a48",
"eip4788TransitionTimestamp": "0x65971a48",
"eip1153TransitionTimestamp": "0x65971a48",
"eip5656TransitionTimestamp": "0x65971a48",
"eip6780TransitionTimestamp": "0x65971a48"
},
"genesis": {
"seal": {
Expand Down
71 changes: 71 additions & 0 deletions networkdata/reth_genesis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"config": {
"chainId": 10209,
"consensus": "aura",
"homesteadBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"berlinBlock": 0,
"londonBlock": 0,
"burntContract": {
"0": "0x1559000000000000000000000000000000000000"
},
"terminalTotalDifficulty": 0,
"terminalTotalDifficultyPassed": true,
"shanghaiTime": 1704401480,
"cancunTime": 1704403000,
"minBlobGasPrice": 1000000000,
"maxBlobGasPerBlock": 262144,
"targetBlobGasPerBlock": 131072,
"blobGasPriceUpdateFraction": 1112826,
"aura": {
"stepDuration": 5,
"blockReward": 0,
"maximumUncleCountTransition": 0,
"maximumUncleCount": 0,
"validators": {
"multi": {
"0": {
"list": [
"0x14747a698Ec1227e6753026C08B29b4d5D3bC484"
]
}
}
},
"blockRewardContractAddress": "0x2000000000000000000000000000000000000001",
"blockRewardContractTransition": 0,
"randomnessContractAddress": {
"0": "0x3000000000000000000000000000000000000001"
},
"withdrawalContractAddress": "0xbabe2bed00000000000000000000000000000003",
"twoThirdsMajorityTransition": 0,
"posdaoTransition": 0,
"blockGasLimitContractTransitions": {
"0": "0x4000000000000000000000000000000000000001"
},
"registrar": "0x6000000000000000000000000000000000000000"
},
"eip1559collector": "0x1559000000000000000000000000000000000000"
},
"baseFeePerGas": "0x3b9aca00",
"difficulty": "0x01",
"gasLimit": "0x989680",
"seal": {
"authorityRound": {
"step": "0x0",
"signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
},
"alloc": {
"0xB03a86b3126157C039b55E21D378587CcFc04d45": {
"balance": "0xc9f2c9cd04674edea40000000"
},
"0xcC4e00A72d871D6c328BcFE9025AD93d0a26dF51": {
"balance": "0xc9f2c9cd04674edea40000000"
}
}
}
26 changes: 26 additions & 0 deletions run_reth.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# reth flags from https://github.com/kurtosis-tech/ethereum-package/blob/7f365da6607bd863b12170ed475b77f4fafcc146/src/el/reth/reth_launcher.star#L206
#
# reth genesis from https://github.com/ethpandaops/ethereum-genesis-generator/blob/a4b6733ea9d47b2b2ec497f5212f0265b83fb601/apps/el-gen/genesis_geth.py#L34

DATA_DIR=$TMPDIR/reth_test
# Ensure no data from previous tests
rm -rf $DATA_DIR

# $PWD/target/release/reth \
cargo run -- \
node \
--chain=$PWD/networkdata/reth_genesis.json \
--datadir=$DATA_DIR \
--http \
--http.port=8545 \
--http.addr=0.0.0.0 \
--http.corsdomain='*' \
--http.api=admin,net,eth,web3,debug,trace \
--authrpc.port=8546 \
--authrpc.jwtsecret=$PWD/networkdata/jwtsecret \
--authrpc.addr=0.0.0.0 \
--port=0 \
--disable-discovery

0 comments on commit d83f0b1

Please sign in to comment.