Skip to content

Commit 00be1f5

Browse files
chore(devnet): may 2026 devnet reset (#2347)
* update * update * avoid peer script in new devnet with 460 nodes (#2349) * ci: add NODE_KEY handling and config.toml support * ci: restore NODE_KEY handling before XDC initialization * add parallelism to kubectl set image --------- Co-authored-by: anunay-xin <anunay@xinfin.org>
1 parent d36e9fa commit 00be1f5

6 files changed

Lines changed: 990 additions & 108 deletions

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -143,29 +143,28 @@ jobs:
143143
echo "Masternodes: $masternodes"
144144
echo "RPCs: $rpcs"
145145
146-
# Skip masternode1 through masternode25, update the rest.
147-
readarray -t mn_array <<< "$masternodes"
148-
total=${#mn_array[@]}
149-
echo "Total masternode deployments: $total, skipping masternode1..masternode25"
150-
151-
for name in "${mn_array[@]}"; do
152-
if [[ $name =~ ^masternode[0-9] ]]; then
153-
num=${name#masternode}
154-
num=${num%%-*}
155-
if [[ $num =~ ^[0-9]+$ ]] && (( num >= 1 && num <= 25 )); then
156-
echo "Skipping deployment: $name"
157-
continue
158-
fi
159-
fi
146+
export git_hash
147+
echo "Total masternode deployments: $(echo "$masternodes" | wc -l)"
160148
149+
echo "$masternodes" | xargs -r -P 32 -I {} bash -c '
150+
name="$1"
151+
# # Skip masternode1 through masternode25, update the rest.
152+
# if [[ $name =~ ^masternode[0-9] ]]; then
153+
# num=${name#masternode}
154+
# num=${num%%-*}
155+
# if [[ $num =~ ^[0-9]+$ ]] && (( num >= 1 && num <= 25 )); then
156+
# echo "Skipping deployment: $name"
157+
# exit 0
158+
# fi
159+
# fi
161160
echo "Updating deployment: $name"
162161
kubectl set image "deployment/$name" "$name=xinfinorg/devnet:dev-upgrade-${git_hash}" || true
163-
done
164-
162+
' _ {}
165163
166-
while read -r name; do
167-
kubectl set image deployment/$name $name=xinfinorg/devnet:dev-upgrade-${git_hash} || true
168-
done <<< "$rpcs"
164+
echo "$rpcs" | xargs -r -P 32 -I {} bash -c '
165+
name="$1"
166+
kubectl set image "deployment/$name" "$name=xinfinorg/devnet:dev-upgrade-${git_hash}" || true
167+
' _ {}
169168
170169
devnet_send_notification:
171170
runs-on: ubuntu-latest

cicd/devnet/start-local-devnet.sh

Lines changed: 0 additions & 73 deletions
This file was deleted.

cicd/devnet/start.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
#!/bin/bash
2+
3+
# Restore nodekey from secret before XDC init runs, so init does not generate a new one.
4+
if [ -n "$NODE_KEY" ] && [ ! -f /work/xdcchain/XDC/nodekey ]; then
5+
mkdir -p /work/xdcchain/XDC
6+
echo "$NODE_KEY" > /work/xdcchain/XDC/nodekey
7+
echo "Restored nodekey from NODE_KEY secret."
8+
fi
9+
210
if [ ! -d /work/xdcchain/XDC/chaindata ]
311
then
412
if test -z "$PRIVATE_KEY"
@@ -118,10 +126,16 @@ fi
118126
echo "Running a node with wallet: ${wallet} at IP: ${instance_ip}"
119127
echo "Starting nodes with $bootnodes ..."
120128

129+
config_arg=""
130+
if [ -f /work/config.toml ]; then
131+
echo "config.toml found, using static peers from --config /work/config.toml"
132+
config_arg="--config /work/config.toml"
133+
fi
134+
121135
# Note: --gcmode=archive means node will store all historical data. This will lead to high memory usage. But sync mode require archive to sync
122136
# https://github.com/XinFinOrg/XDPoSChain/issues/268
123137

124-
XDC --ethstats ${netstats} \
138+
XDC ${config_arg} --ethstats ${netstats} \
125139
--gcmode ${gc_mode} --syncmode ${sync_mode} \
126140
--nat extip:${instance_ip} \
127141
--bootnodes ${bootnodes} \

common/constants.devnet.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ var DevnetConstant = constant{
2727
TIPV2SwitchBlock: big.NewInt(2700),
2828
tipXDCXMinerDisable: big.NewInt(0),
2929
tipXDCXReceiverDisable: big.NewInt(0),
30-
eip1559Block: big.NewInt(250000),
31-
cancunBlock: big.NewInt(250000),
32-
pragueBlock: big.NewInt(5000000),
30+
eip1559Block: big.NewInt(25000),
31+
cancunBlock: big.NewInt(25000),
32+
pragueBlock: big.NewInt(50000),
3333
osakaBlock: big.NewInt(math.MaxInt64),
34-
dynamicGasLimitBlock: big.NewInt(5000000),
35-
tipUpgradeReward: big.NewInt(5000000),
36-
tipUpgradePenalty: big.NewInt(5000000),
34+
dynamicGasLimitBlock: big.NewInt(50000),
35+
tipUpgradeReward: big.NewInt(50000),
36+
tipUpgradePenalty: big.NewInt(50000),
3737
tipEpochHalving: big.NewInt(math.MaxInt64),
3838

3939
trc21IssuerSMC: HexToAddress("0x8c0faeb5C6bEd2129b8674F262Fd45c4e9468bee"),

core/genesis_alloc_devnet.go

Lines changed: 943 additions & 1 deletion
Large diffs are not rendered by default.

params/config.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const (
3939
var (
4040
MainnetGenesisHash = common.HexToHash("0x4a9d748bd78a8d0385b67788c2435dcdb914f98a96250b68863a1f8b7642d6b1") // XDC Mainnet genesis hash to enforce below configs on
4141
TestnetGenesisHash = common.HexToHash("0xbdea512b4f12ff1135ec92c00dc047ffb93890c2ea1aa0eefe9b013d80640075") // XDC Testnet genesis hash to enforce below configs on
42-
DevnetGenesisHash = common.HexToHash("0x7dad95b83c6c1d413de03bd5fcf2d446217db55b2b18e3eaacacbfa4e7629cc9") // XDC Devnet genesis hash to enforce below configs on
42+
DevnetGenesisHash = common.HexToHash("0xb8be003946a9c2688e9f1e255a5567c3d144293ccde2ffb38452a5840081b402") // XDC Devnet genesis hash to enforce below configs on
4343
)
4444

4545
var (
@@ -148,11 +148,11 @@ var (
148148
LimitPenaltyEpoch: 0,
149149
MinimumSigningTx: 0,
150150
},
151-
5000000: {
152-
SwitchRound: 5000000,
151+
50000: {
152+
SwitchRound: 50000,
153153
MaxMasternodes: 108,
154-
MaxProtectorNodes: 10,
155-
MaxObverserNodes: 1000,
154+
MaxProtectorNodes: 324,
155+
MaxObverserNodes: 2000,
156156
CertThreshold: 0.667,
157157
TimeoutSyncThreshold: 3,
158158
TimeoutPeriod: 10,
@@ -161,9 +161,9 @@ var (
161161
MasternodeReward: 63.42,
162162
ProtectorReward: 50.27,
163163
ObserverReward: 25.13,
164-
MinimumMinerBlockPerEpoch: 0,
165-
LimitPenaltyEpoch: 0,
166-
MinimumSigningTx: 0,
164+
MinimumMinerBlockPerEpoch: 5,
165+
LimitPenaltyEpoch: 5,
166+
MinimumSigningTx: 30,
167167
},
168168
}
169169

0 commit comments

Comments
 (0)