From 104c1851ce7890a605de2b9123835074d7c14ff3 Mon Sep 17 00:00:00 2001 From: Gabriel Fukushima Date: Tue, 24 Jan 2023 02:08:50 +1100 Subject: [PATCH] clients/besu: add Shanghai fork and fix issue with duplicated node keys (#674) * Add bootnode check to avoid duplicated enode address * Add shanghaiTime to mapper.jq Co-authored-by: gfukushima --- clients/besu/besu.sh | 17 +++++++++-------- clients/besu/mapper.jq | 1 + 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/clients/besu/besu.sh b/clients/besu/besu.sh index 6f5cbe043f..5a6b81f28a 100644 --- a/clients/besu/besu.sh +++ b/clients/besu/besu.sh @@ -99,14 +99,15 @@ if [ -d /blocks ]; then IMPORTFLAGS="$IMPORTFLAGS $blocks" fi - -# Configure mining. -if [ "$HIVE_MINER" != "" ]; then - FLAGS="$FLAGS --miner-enabled --miner-coinbase=$HIVE_MINER" - # For clique mining, besu uses the node key as the block signing key. - if [ "$HIVE_CLIQUE_PRIVATEKEY" != "" ]; then - echo "Importing clique signing key as node key..." - echo "$HIVE_CLIQUE_PRIVATEKEY" > /opt/besu/key +if [ "$HIVE_BOOTNODE" != "" ]; then + # Configure mining. + if [ "$HIVE_MINER" != "" ]; then + FLAGS="$FLAGS --miner-enabled --miner-coinbase=$HIVE_MINER" + # For clique mining, besu uses the node key as the block signing key. + if [ "$HIVE_CLIQUE_PRIVATEKEY" != "" ]; then + echo "Importing clique signing key as node key..." + echo "$HIVE_CLIQUE_PRIVATEKEY" > /opt/besu/key + fi fi fi if [ "$HIVE_MINER_EXTRA" != "" ]; then diff --git a/clients/besu/mapper.jq b/clients/besu/mapper.jq index 67a35c7b6c..b356ee63e7 100644 --- a/clients/besu/mapper.jq +++ b/clients/besu/mapper.jq @@ -44,6 +44,7 @@ def to_int: "berlinBlock": env.HIVE_FORK_BERLIN|to_int, "londonBlock": env.HIVE_FORK_LONDON|to_int, "parisBlock": env.HIVE_MERGE_BLOCK_ID|to_int, + "shanghaiTime": env.HIVE_SHANGHAI_TIMESTAMP|to_int, "terminalTotalDifficulty": env.HIVE_TERMINAL_TOTAL_DIFFICULTY|to_int, }|remove_empty }