Skip to content

Commit 8616fa2

Browse files
committed
Merge remote-tracking branch 'eth/master'
2 parents 0338ec4 + 4ad82c5 commit 8616fa2

File tree

25 files changed

+954
-4268
lines changed

25 files changed

+954
-4268
lines changed

clients/erigon/erigon.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fi
128128

129129
# Configure RPC.
130130
FLAGS="$FLAGS --http --http.addr=0.0.0.0 --http.api=admin,debug,eth,net,txpool,web3"
131-
FLAGS="$FLAGS --ws"
131+
FLAGS="$FLAGS --ws --ws.port=8546"
132132

133133
# Increase blob slots for tests
134134
FLAGS="$FLAGS --txpool.blobslots=1000"

clients/erigon/mapper.jq

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def to_bool:
5454
"grayGlacierBlock": env.HIVE_FORK_GRAY_GLACIER|to_int,
5555
"mergeNetsplitBlock": env.HIVE_MERGE_BLOCK_ID|to_int,
5656
"terminalTotalDifficulty": env.HIVE_TERMINAL_TOTAL_DIFFICULTY|to_int,
57-
"terminalTotalDifficultyPassed": true,
57+
"terminalTotalDifficultyPassed": (if env.HIVE_TERMINAL_TOTAL_DIFFICULTY_PASSED == null then 1 else env.HIVE_TERMINAL_TOTAL_DIFFICULTY_PASSED|to_bool end),
5858
"shanghaiTime": env.HIVE_SHANGHAI_TIMESTAMP|to_int,
5959
"cancunTime": env.HIVE_CANCUN_TIMESTAMP|to_int,
6060
}|remove_empty

clients/ethereumjs/.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ethereumjs-monorepo/packages/ethereum-tests
2+
ethereumjs-monorepo/packages/*/node_modules
3+
ethereumjs-monorepo/packages/vm/benchmarks
4+
ethereumjs-monorepo/node_modules
5+
!ethereumjs-monorepo/node_modules/@ethereumjs

clients/ethereumjs/Dockerfile.local

+56-4
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,75 @@ FROM node:18-alpine
66
RUN apk update && apk add --no-cache bash git jq curl python3 gcc make g++ \
77
&& rm -rf /var/cache/apk/*
88

9+
RUN npm i -g ts-node
10+
911
# Default local client path: clients/ethereumjs/<ethereumjs-monorepo>
1012
ARG local_path=ethereumjs-monorepo
11-
COPY $local_path ethereumjs-monorepo
13+
14+
COPY ${local_path}/config ethereumjs-monorepo/config
15+
COPY ${local_path}/package-lock.json ethereumjs-monorepo/package-lock.json
16+
COPY ${local_path}/package.json ethereumjs-monorepo/package.json
17+
COPY ${local_path}/scripts ethereumjs-monorepo/scripts
18+
19+
COPY ${local_path}/packages/block/package.json ethereumjs-monorepo/packages/block/package.json
20+
COPY ${local_path}/packages/blockchain/package.json ethereumjs-monorepo/packages/blockchain/package.json
21+
COPY ${local_path}/packages/client/package.json ethereumjs-monorepo/packages/client/package.json
22+
COPY ${local_path}/packages/common/package.json ethereumjs-monorepo/packages/common/package.json
23+
COPY ${local_path}/packages/devp2p/package.json ethereumjs-monorepo/packages/devp2p/package.json
24+
COPY ${local_path}/packages/ethash/package.json ethereumjs-monorepo/packages/ethash/package.json
25+
COPY ${local_path}/packages/evm/package.json ethereumjs-monorepo/packages/evm/package.json
26+
COPY ${local_path}/packages/genesis/package.json ethereumjs-monorepo/packages/genesis/package.json
27+
COPY ${local_path}/packages/rlp/package.json ethereumjs-monorepo/packages/rlp/package.json
28+
COPY ${local_path}/packages/statemanager/package.json ethereumjs-monorepo/packages/statemanager/package.json
29+
COPY ${local_path}/packages/trie/package.json ethereumjs-monorepo/packages/trie/package.json
30+
COPY ${local_path}/packages/tx/package.json ethereumjs-monorepo/packages/tx/package.json
31+
COPY ${local_path}/packages/util/package.json ethereumjs-monorepo/packages/util/package.json
32+
COPY ${local_path}/packages/verkle/package.json ethereumjs-monorepo/packages/verkle/package.json
33+
COPY ${local_path}/packages/vm/package.json ethereumjs-monorepo/packages/vm/package.json
34+
COPY ${local_path}/packages/wallet/package.json ethereumjs-monorepo/packages/wallet/package.json
35+
36+
# for npm run prepare
37+
RUN cd ethereumjs-monorepo && git init
38+
39+
RUN cd ethereumjs-monorepo && cp package.json package.json.bak && npm pkg set scripts.postinstall="echo no-postinstall"
1240
RUN cd ethereumjs-monorepo && npm i
41+
RUN cd ethereumjs-monorepo && cp package.json.bak package.json && rm package.json.bak
42+
43+
COPY ${local_path}/node_modules/@ethereumjs ethereumjs-monorepo/node_modules/@ethereumjs
44+
45+
COPY ${local_path}/packages/rlp ethereumjs-monorepo/packages/rlp
46+
COPY ${local_path}/packages/util ethereumjs-monorepo/packages/util
47+
COPY ${local_path}/packages/verkle ethereumjs-monorepo/packages/verkle
48+
COPY ${local_path}/packages/wallet ethereumjs-monorepo/packages/wallet
49+
COPY ${local_path}/packages/common ethereumjs-monorepo/packages/common
50+
COPY ${local_path}/packages/devp2p ethereumjs-monorepo/packages/devp2p
51+
COPY ${local_path}/packages/genesis ethereumjs-monorepo/packages/genesis
52+
COPY ${local_path}/packages/trie ethereumjs-monorepo/packages/trie
53+
COPY ${local_path}/packages/statemanager ethereumjs-monorepo/packages/statemanager
54+
COPY ${local_path}/packages/tx ethereumjs-monorepo/packages/tx
55+
COPY ${local_path}/packages/evm ethereumjs-monorepo/packages/evm
56+
COPY ${local_path}/packages/block ethereumjs-monorepo/packages/block
57+
COPY ${local_path}/packages/ethash ethereumjs-monorepo/packages/ethash
58+
COPY ${local_path}/packages/blockchain ethereumjs-monorepo/packages/blockchain
59+
COPY ${local_path}/packages/vm ethereumjs-monorepo/packages/vm
60+
61+
RUN cd ethereumjs-monorepo/packages/client && cp package.json package.json.bak && npm pkg set scripts.build="echo no-build"
62+
RUN cd ethereumjs-monorepo && npm run build --workspaces
63+
64+
COPY ${local_path}/packages/client ethereumjs-monorepo/packages/client
1365

1466
# Create version.txt
1567
RUN cd ethereumjs-monorepo/packages/client && npm ethereumjs --version > /version.txt
1668

1769
# Add genesis mapper script, startup script, and enode URL retriever script
1870
ADD genesis.json /genesis.json
1971
ADD mapper.jq /mapper.jq
20-
ADD ethereumjs.sh /ethereumjs.sh
72+
ADD ethereumjs-local.sh /ethereumjs-local.sh
2173
ADD enode.sh /hive-bin/enode.sh
2274
ADD jwtsecret /jwtsecret
2375

2476
# Set execute permissions for scripts
25-
RUN chmod +x /ethereumjs.sh /hive-bin/enode.sh
77+
RUN chmod +x /ethereumjs-local.sh /hive-bin/enode.sh
2678

2779
# Expose networking ports
2880
EXPOSE 8545 8546 8551 8547 30303 30303/udp
@@ -32,4 +84,4 @@ EXPOSE 8545 8546 8551 8547 30303 30303/udp
3284
# since memory may spike during certain network conditions.
3385
ENV NODE_OPTIONS=--max_old_space_size=6144
3486

35-
ENTRYPOINT ["/ethereumjs.sh"]
87+
ENTRYPOINT ["/ethereumjs-local.sh"]
+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#!/bin/bash
2+
3+
# Startup script to initialize and boot a ethereum-js instance.
4+
#
5+
# This script assumes the following files:
6+
# - `genesis.json` file is located in the filesystem root (mandatory)
7+
# - `chain.rlp` file is located in the filesystem root (optional)
8+
# - `blocks` folder is located in the filesystem root (optional)
9+
# - `keys` folder is located in the filesystem root (optional)
10+
#
11+
# This script assumes the following environment variables:
12+
#
13+
# - HIVE_BOOTNODE enode URL of the remote bootstrap node
14+
# - HIVE_NETWORK_ID network ID number to use for the eth protocol
15+
# - HIVE_NODETYPE sync and pruning selector (archive, full, light)
16+
#
17+
# Forks:
18+
#
19+
# - HIVE_FORK_HOMESTEAD block number of the homestead hard-fork transition
20+
# - HIVE_FORK_DAO_BLOCK block number of the DAO hard-fork transition
21+
# - HIVE_FORK_DAO_VOTE whether the node support (or opposes) the DAO fork
22+
# - HIVE_FORK_TANGERINE block number of Tangerine Whistle transition
23+
# - HIVE_FORK_SPURIOUS block number of Spurious Dragon transition
24+
# - HIVE_FORK_BYZANTIUM block number for Byzantium transition
25+
# - HIVE_FORK_CONSTANTINOPLE block number for Constantinople transition
26+
# - HIVE_FORK_PETERSBURG block number for ConstantinopleFix/PetersBurg transition
27+
# - HIVE_FORK_ISTANBUL block number for Istanbul transition
28+
# - HIVE_FORK_MUIRGLACIER block number for Muir Glacier transition
29+
# - HIVE_FORK_BERLIN block number for Berlin transition
30+
# - HIVE_FORK_LONDON block number for London
31+
#
32+
# Clique PoA:
33+
#
34+
# - HIVE_CLIQUE_PERIOD enables clique support. value is block time in seconds.
35+
# - HIVE_CLIQUE_PRIVATEKEY private key for clique mining
36+
#
37+
# Other:
38+
#
39+
# - HIVE_MINER enable mining. value is coinbase address.
40+
# - HIVE_MINER_EXTRA extra-data field to set for newly minted blocks
41+
# - HIVE_LOGLEVEL client loglevel (0-5)
42+
# - HIVE_GRAPHQL_ENABLED enables graphql on port 8545
43+
# - HIVE_LES_SERVER set to '1' to enable LES server
44+
45+
46+
# Immediately abort the script on any error encountered
47+
set -e
48+
49+
cd /ethereumjs-monorepo/packages/client/
50+
51+
ethereumjs="ts-node /ethereumjs-monorepo/packages/client/bin/cli.ts"
52+
FLAGS="--gethGenesis /genesis.json --rpc --rpcEngine --saveReceipts --rpcAddr 0.0.0.0 --rpcEngineAddr 0.0.0.0 --rpcEnginePort 8551 --ws false --logLevel debug --rpcDebug all --rpcDebugVerbose all --isSingleNode"
53+
54+
# Configure the chain.
55+
mv /genesis.json /genesis-input.json
56+
jq -f /mapper.jq /genesis-input.json > /genesis.json
57+
58+
# Dump genesis.
59+
if [ "$HIVE_LOGLEVEL" -lt 4 ]; then
60+
echo "Supplied genesis state (trimmed, use --sim.loglevel 4 or 5 for full output):"
61+
jq 'del(.alloc[] | select(.balance == "0x123450000000000000000"))' /genesis.json
62+
else
63+
echo "Supplied genesis state:"
64+
cat /genesis.json
65+
fi
66+
67+
# Import clique signing key.
68+
if [ "$HIVE_CLIQUE_PRIVATEKEY" != "" ]; then
69+
# Create password file.
70+
echo "Importing clique key..."
71+
echo -n "$HIVE_CLIQUE_PRIVATEKEY" > /private_key.txt
72+
# Ensure password file is used when running ethereumjs in mining mode.
73+
if [ "$HIVE_MINER" != "" ]; then
74+
FLAGS="$FLAGS --mine --unlock /private_key.txt --minerCoinbase $HIVE_MINER"
75+
fi
76+
fi
77+
78+
if [ "$HIVE_TERMINAL_TOTAL_DIFFICULTY" != "" ]; then
79+
FLAGS="$FLAGS --jwt-secret /jwtsecret"
80+
fi
81+
82+
# Load the test chain if present
83+
echo "Loading initial blockchain..."
84+
if [ -f /chain.rlp ]; then
85+
FLAGS="$FLAGS --loadBlocksFromRlp=/chain.rlp"
86+
else
87+
echo "Warning: chain.rlp not found."
88+
fi
89+
90+
if [ "$HIVE_BOOTNODE" != "" ]; then
91+
FLAGS="$FLAGS --bootnodes=$HIVE_BOOTNODE"
92+
fi
93+
echo "Running ethereumjs with flags $FLAGS"
94+
$ethereumjs $FLAGS

clients/lodestar-vc/lodestar_vc.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ do
2222
done
2323

2424
metrics_option=$([[ "$HIVE_ETH2_METRICS_PORT" == "" ]] && echo "" || echo "--metrics --metrics.address=$CONTAINER_IP --metrics.port=$HIVE_ETH2_METRICS_PORT")
25+
builder_option=$([[ "$HIVE_ETH2_BUILDER_ENDPOINT" == "" ]] && echo "--builder.selection executiononly" || echo "--builder")
26+
echo BUILDER=$builder_option
2527

2628
LOG=info
2729
case "$HIVE_LOGLEVEL" in
@@ -41,6 +43,7 @@ node /usr/app/node_modules/.bin/lodestar \
4143
--paramsFile=/hive/input/config.yaml \
4244
--keystoresDir="/data/validators" \
4345
--secretsDir="/data/secrets" \
44-
$metrics_option \
46+
--useProduceBlockV3 \
47+
$metrics_option $builder_option \
4548
--beaconNodes="http://$HIVE_ETH2_BN_API_IP:$HIVE_ETH2_BN_API_PORT"
4649

clients/teku-bn/Dockerfile

-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,4 @@ RUN chmod +x /opt/teku/bin//teku_bn.sh
1010

1111
RUN ./bin/teku --version > /version.txt > /version.txt
1212

13-
ADD trusted_setup.txt /trusted_setup.txt
14-
1513
ENTRYPOINT ["/opt/teku/bin/teku_bn.sh"]

clients/teku-bn/teku_bn.sh

+9-9
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ if [[ "$HIVE_ETH2_SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY" != "" ]]; then
2323
echo "SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY: $HIVE_ETH2_SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY" >> /data/testnet_setup/config.yaml
2424
fi
2525

26-
trusted_setup_path="/trusted_setup.txt"
27-
28-
echo "Xtrusted-setup: $trusted_setup_path" >> /data/testnet_setup/config.yaml
29-
3026
echo config.yaml:
3127
cat /data/testnet_setup/config.yaml
3228

@@ -51,6 +47,7 @@ enr_option=$([[ "$HIVE_ETH2_BOOTNODE_ENRS" == "" ]] && echo "" || echo --p2p-dis
5147
static_option=$([[ "$HIVE_ETH2_STATIC_PEERS" == "" ]] && echo "" || echo --p2p-static-peers="$HIVE_ETH2_STATIC_PEERS")
5248
opt_sync_option=$([[ "$HIVE_ETH2_SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY" == "" ]] && echo "" || echo "--Xnetwork-safe-slots-to-import-optimistically=$HIVE_ETH2_SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY")
5349
builder_option=$([[ "$HIVE_ETH2_BUILDER_ENDPOINT" == "" ]] && echo "" || echo "--validators-builder-registration-default-enabled=true --validators-proposer-blinded-blocks-enabled=true --builder-endpoint=$HIVE_ETH2_BUILDER_ENDPOINT")
50+
peer_score_option=$([[ "$HIVE_ETH2_DISABLE_PEER_SCORING" == "" ]] && echo "" || echo "--Xp2p-gossip-scoring-enabled=false --Xpeer-rate-limit=100000 --Xpeer-request-limit=1000")
5451

5552
if [ "$HIVE_ETH2_MERGE_ENABLED" != "" ]; then
5653
echo -n "0x7365637265747365637265747365637265747365637265747365637265747365" > /jwtsecret
@@ -62,18 +59,21 @@ echo Starting Teku Beacon Node
6259
/opt/teku/bin/teku \
6360
--network=/data/testnet_setup/config.yaml \
6461
--data-path=/data/teku \
62+
--data-storage-mode=ARCHIVE \
6563
--initial-state=/data/testnet_setup/genesis.ssz \
6664
--eth1-deposit-contract-address="${HIVE_ETH2_CONFIG_DEPOSIT_CONTRACT_ADDRESS:-0x1111111111111111111111111111111111111111}" \
6765
--log-destination console \
6866
--logging="$LOG" \
69-
$metrics_option $eth1_option $merge_option $enr_option $static_option $opt_sync_option $builder_option \
67+
$metrics_option $eth1_option $merge_option $enr_option $static_option $opt_sync_option $builder_option $peer_score_option \
7068
--validators-proposer-default-fee-recipient="0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" \
7169
--p2p-port="${HIVE_ETH2_P2P_TCP_PORT:-9000}" \
7270
--p2p-udp-port="${HIVE_ETH2_P2P_UDP_PORT:-9000}" \
7371
--p2p-advertised-ip="${CONTAINER_IP}" \
7472
--p2p-peer-lower-bound="${HIVE_ETH2_P2P_TARGET_PEERS:-10}" \
75-
--rest-api-enabled=true --rest-api-interface=0.0.0.0 --rest-api-port="${HIVE_ETH2_BN_API_PORT:-4000}" --rest-api-host-allowlist="*" \
76-
--data-storage-mode=ARCHIVE \
77-
--Xstartup-target-peer-count=0 \
7873
--p2p-subscribe-all-subnets-enabled \
79-
--Xtrusted-setup="$trusted_setup_path"
74+
--rest-api-enabled=true \
75+
--rest-api-interface=0.0.0.0 \
76+
--rest-api-port="${HIVE_ETH2_BN_API_PORT:-4000}" \
77+
--rest-api-host-allowlist="*" \
78+
--ignore-weak-subjectivity-period-enabled=true \
79+
--Xstartup-target-peer-count=0

0 commit comments

Comments
 (0)