mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 13:21:37 +00:00
fix(constants): update Devnet chain ID and block parameters for devnet-108 setup (#2205)
* fix(constants): update Devnet chain ID and block parameters for devnet-108 setup * refactor(ci): update masternode deployment logic to skip specifically masternode-1 to masternode-25 * ci: update Slack webhook variable names for pull request notifications * ci: correct format for masternodeN * ci: enhance start script to handle bootnodes and miner gas limit configuration in new devnet * ci: update start script to set default netstats configuration and change network ID for devnet
This commit is contained in:
parent
001bd7ef3b
commit
9579593438
6 changed files with 60 additions and 27 deletions
25
.github/workflows/ci.yml
vendored
25
.github/workflows/ci.yml
vendored
|
|
@ -138,20 +138,29 @@ jobs:
|
|||
echo "${{ secrets.KUBE_CONFIG }}" | base64 --decode > $HOME/.kube/config
|
||||
chmod 600 $HOME/.kube/config
|
||||
git_hash=$(git rev-parse --short "$GITHUB_SHA")
|
||||
masternodes=$(kubectl get deployment -o json| jq -r '.items[] | select(.metadata.name | test("devnet")) | "\(.metadata.name)"')
|
||||
masternodes=$(kubectl get deployment -o json | jq -r '.items[] | select(.metadata.name | test("^masternode[0-9]")) | .metadata.name' | sort)
|
||||
rpcs=$(kubectl get deployment -o json| jq -r '.items[] | select(.metadata.name | test("rpc")) | "\(.metadata.name)"')
|
||||
echo "Masternodes: $masternodes"
|
||||
echo "RPCs: $rpcs"
|
||||
|
||||
skip_names=("devnet1" "devnet2" "devnet3" "devnet4" "devnet9" "devnet10" "devnet11" "devnet12" "devnetrpc" "devnetrpc2")
|
||||
while read -r name; do
|
||||
if [[ " ${skip_names[@]} " =~ " ${name} " ]]; then
|
||||
echo "Skipping deployment: $name"
|
||||
continue
|
||||
# Skip masternode1 through masternode25, update the rest.
|
||||
readarray -t mn_array <<< "$masternodes"
|
||||
total=${#mn_array[@]}
|
||||
echo "Total masternode deployments: $total, skipping masternode1..masternode25"
|
||||
|
||||
for name in "${mn_array[@]}"; do
|
||||
if [[ $name =~ ^masternode[0-9] ]]; then
|
||||
num=${name#masternode}
|
||||
num=${num%%-*}
|
||||
if [[ $num =~ ^[0-9]+$ ]] && (( num >= 1 && num <= 25 )); then
|
||||
echo "Skipping deployment: $name"
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Updating deployment: $name"
|
||||
kubectl set image deployment/$name $name=xinfinorg/devnet:dev-upgrade-${git_hash} || true
|
||||
done <<< "$masternodes"
|
||||
kubectl set image "deployment/$name" "$name=xinfinorg/devnet:dev-upgrade-${git_hash}" || true
|
||||
done
|
||||
|
||||
|
||||
while read -r name; do
|
||||
|
|
|
|||
18
.github/workflows/pr-notify-slack.yml
vendored
18
.github/workflows/pr-notify-slack.yml
vendored
|
|
@ -14,14 +14,14 @@ jobs:
|
|||
steps:
|
||||
- name: Test Slack webhook
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
SLACK_PULL_REQUEST_WEBHOOK_URL: ${{ secrets.SLACK_PULL_REQUEST_WEBHOOK_URL }}
|
||||
run: |
|
||||
if [ -z "$SLACK_WEBHOOK_URL" ]; then
|
||||
echo "SLACK_WEBHOOK_URL secret is not set. Add it in repo Settings → Secrets → Actions."
|
||||
if [ -z "$SLACK_PULL_REQUEST_WEBHOOK_URL" ]; then
|
||||
echo "SLACK_PULL_REQUEST_WEBHOOK_URL secret is not set. Add it in repo Settings → Secrets → Actions."
|
||||
exit 1
|
||||
fi
|
||||
BODY=$(jq -n --arg text "Test: PR notify Slack webhook is working (from ${{ github.repository }})" '{text: $text}')
|
||||
curl -sS -X POST -H 'Content-Type: application/json' --data "$BODY" "$SLACK_WEBHOOK_URL"
|
||||
curl -sS -X POST -H 'Content-Type: application/json' --data "$BODY" "$SLACK_PULL_REQUEST_WEBHOOK_URL"
|
||||
echo ""
|
||||
echo "If you see this and no curl error, check your Slack channel for the test message."
|
||||
|
||||
|
|
@ -44,10 +44,10 @@ jobs:
|
|||
steps:
|
||||
- name: Send Slack notification
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
SLACK_PULL_REQUEST_WEBHOOK_URL: ${{ secrets.SLACK_PULL_REQUEST_WEBHOOK_URL }}
|
||||
run: |
|
||||
if [ -z "$SLACK_WEBHOOK_URL" ]; then
|
||||
echo "SLACK_WEBHOOK_URL secret is not set; skipping notification."
|
||||
if [ -z "$SLACK_PULL_REQUEST_WEBHOOK_URL" ]; then
|
||||
echo "SLACK_PULL_REQUEST_WEBHOOK_URL secret is not set; skipping notification."
|
||||
exit 0
|
||||
fi
|
||||
PR_URL="${{ github.event.pull_request.html_url }}"
|
||||
|
|
@ -59,5 +59,5 @@ jobs:
|
|||
--arg title "$PR_TITLE" \
|
||||
--arg author "$PR_AUTHOR" \
|
||||
'{text: ("PR ready for review: <" + $url + "|" + $title + "> by " + $author)}')
|
||||
curl -sS -X POST -H 'Content-Type: application/json' --data "$BODY" "$SLACK_WEBHOOK_URL"
|
||||
if: env.SLACK_WEBHOOK_URL != ''
|
||||
curl -sS -X POST -H 'Content-Type: application/json' --data "$BODY" "$SLACK_PULL_REQUEST_WEBHOOK_URL"
|
||||
if: env.SLACK_PULL_REQUEST_WEBHOOK_URL != ''
|
||||
|
|
|
|||
|
|
@ -104,8 +104,16 @@ else
|
|||
miner_gaslimit=$MINER_GASLIMIT
|
||||
fi
|
||||
|
||||
netstats="${NODE_NAME}-${wallet}-${instance_ip}:xinfin_xdpos_hybrid_network_stats@devnetstats.hashlabs.apothem.network:1999"
|
||||
|
||||
netstats_default="${NODE_NAME}-${wallet}-${instance_ip}:xinfin_xdpos_hybrid_network_stats@devnetstats.hashlabs.apothem.network:1999"
|
||||
if test -z "$NETSTATS_CONFIG"
|
||||
then
|
||||
echo "NETSTATS_CONFIG not set, default to hashlabs devnet stats"
|
||||
netstats=$netstats_default
|
||||
else
|
||||
echo "NETSTATS_CONFIG found, set to $NETSTATS_CONFIG"
|
||||
netstats="${NODE_NAME}-${wallet}-${instance_ip}:$NETSTATS_CONFIG"
|
||||
fi
|
||||
|
||||
echo "Running a node with wallet: ${wallet} at IP: ${instance_ip}"
|
||||
echo "Starting nodes with $bootnodes ..."
|
||||
|
|
@ -117,7 +125,7 @@ XDC --ethstats ${netstats} \
|
|||
--gcmode ${gc_mode} --syncmode ${sync_mode} \
|
||||
--nat extip:${instance_ip} \
|
||||
--bootnodes ${bootnodes} \
|
||||
--datadir /work/xdcchain --networkid 551 \
|
||||
--datadir /work/xdcchain --networkid 5551 \
|
||||
--port $port --http --http-corsdomain "*" --http-addr 0.0.0.0 \
|
||||
--http-port $rpc_port \
|
||||
--http-api db,eth,net,txpool,web3,XDPoS \
|
||||
|
|
|
|||
|
|
@ -24,6 +24,13 @@ do
|
|||
bootnodes="${bootnodes},$line"
|
||||
fi
|
||||
done < "$input"
|
||||
#check last line since it's not included in "read" command https://stackoverflow.com/questions/12916352/shell-script-read-missing-last-line
|
||||
if [ -z "${bootnodes}" ]
|
||||
then
|
||||
bootnodes=$line
|
||||
else
|
||||
bootnodes="${bootnodes},$line"
|
||||
fi
|
||||
|
||||
log_level=3
|
||||
if test -z "$LOG_LEVEL"
|
||||
|
|
@ -88,6 +95,15 @@ else
|
|||
gc_mode=$GC_MODE
|
||||
fi
|
||||
|
||||
miner_gaslimit=50000000
|
||||
if test -z "$MINER_GASLIMIT"
|
||||
then
|
||||
echo "MINER_GASLIMIT not set, default to $miner_gaslimit"
|
||||
else
|
||||
echo "MINER_GASLIMIT found, set to $MINER_GASLIMIT"
|
||||
miner_gaslimit=$MINER_GASLIMIT
|
||||
fi
|
||||
|
||||
ethstats_address=localhost:2000
|
||||
if test -z "$STATS_ADDRESS"
|
||||
then
|
||||
|
|
@ -108,7 +124,7 @@ fi
|
|||
|
||||
netstats="${NODE_NAME}-${wallet}:$ethstats_secret@$ethstats_address"
|
||||
|
||||
echo "Running a node with wallet: ${wallet}"
|
||||
echo "Running a node with wallet: ${wallet} at IP: ${instance_ip}"
|
||||
echo "Starting nodes with $bootnodes ..."
|
||||
|
||||
# Note: --gcmode=archive means node will store all historical data. This will lead to high memory usage. But sync mode require archive to sync
|
||||
|
|
@ -124,7 +140,7 @@ XDC \
|
|||
--http-port $rpc_port \
|
||||
--http-api db,eth,net,txpool,web3,XDPoS \
|
||||
--http-vhosts "*" --unlock "${wallet}" --password /work/.pwd --mine \
|
||||
--miner-gasprice "1" --miner-gaslimit "50000000" --verbosity ${log_level} \
|
||||
--miner-gasprice "1" --miner-gaslimit "${miner_gaslimit}" --verbosity ${log_level} \
|
||||
--debugdatadir /work/xdcchain \
|
||||
--store-reward \
|
||||
--ws --ws-addr=0.0.0.0 --ws-port $ws_port \
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import (
|
|||
)
|
||||
|
||||
var DevnetConstant = constant{
|
||||
chainID: 551,
|
||||
chainID: 5551,
|
||||
denylistHFNumber: 0,
|
||||
maxMasternodesV2: 108,
|
||||
|
||||
|
|
@ -29,11 +29,11 @@ var DevnetConstant = constant{
|
|||
tipXDCXReceiverDisable: big.NewInt(0),
|
||||
eip1559Block: big.NewInt(32400),
|
||||
cancunBlock: big.NewInt(43200),
|
||||
pragueBlock: big.NewInt(45000),
|
||||
pragueBlock: big.NewInt(math.MaxInt64),
|
||||
osakaBlock: big.NewInt(math.MaxInt64),
|
||||
dynamicGasLimitBlock: big.NewInt(45000),
|
||||
tipUpgradeReward: big.NewInt(45000),
|
||||
tipUpgradePenalty: big.NewInt(45000),
|
||||
dynamicGasLimitBlock: big.NewInt(math.MaxInt64),
|
||||
tipUpgradeReward: big.NewInt(math.MaxInt64),
|
||||
tipUpgradePenalty: big.NewInt(math.MaxInt64),
|
||||
tipEpochHalving: big.NewInt(math.MaxInt64),
|
||||
|
||||
trc21IssuerSMC: HexToAddress("0x8c0faeb5C6bEd2129b8674F262Fd45c4e9468bee"),
|
||||
|
|
|
|||
|
|
@ -293,7 +293,7 @@ var (
|
|||
|
||||
// DevnetChainConfig contains the chain parameters to run a node on the devnet.
|
||||
DevnetChainConfig = &ChainConfig{
|
||||
ChainID: big.NewInt(551),
|
||||
ChainID: big.NewInt(5551),
|
||||
HomesteadBlock: big.NewInt(0),
|
||||
EIP150Block: big.NewInt(0),
|
||||
EIP155Block: big.NewInt(0),
|
||||
|
|
|
|||
Loading…
Reference in a new issue