Skip to content

Commit e19757d

Browse files
committed
add fillup consolidation & withdrawal queue playbooks
1 parent 50925af commit e19757d

File tree

2 files changed

+191
-0
lines changed

2 files changed

+191
-0
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
2+
id: fillup-consolidation-queue
3+
name: "Fillup consolidation queue"
4+
timeout: 1h
5+
config:
6+
walletPrivkey: ""
7+
consolidationCount: 1000 # number of consolidations to send
8+
consolidationMaxIndex: 100 # number of wallets to send from
9+
consolidationTxFee: 10000000000000000 # 0.01 ETH
10+
walletSeed: ""
11+
tasks:
12+
- name: check_clients_are_healthy
13+
title: "Check if at least one client is ready"
14+
timeout: 5m
15+
config:
16+
minClientCount: 1
17+
18+
- name: run_shell
19+
id: prepare
20+
title: "Prepare workers"
21+
config:
22+
envVars:
23+
consolidationCount: "consolidationCount"
24+
consolidationMaxIndex: "consolidationMaxIndex"
25+
command: |
26+
consolidationCount=$(echo $consolidationCount | jq -r .)
27+
consolidationMaxIndex=$(echo $consolidationMaxIndex | jq -r .)
28+
29+
minconsolidationCount=$(expr $consolidationCount \/ $consolidationMaxIndex)
30+
plusOneconsolidationCount=$(expr $consolidationCount - $minconsolidationCount \* $consolidationMaxIndex)
31+
32+
workers="[]"
33+
34+
while read index; do
35+
consolidationCount=$minconsolidationCount
36+
if [ "$index" -lt "$plusOneconsolidationCount" ]; then
37+
consolidationCount=$(expr $consolidationCount + 1)
38+
fi
39+
40+
worker=$(echo "{\"index\": $index, \"consolidationCount\": $consolidationCount}" )
41+
workers=$(echo $workers | jq -c ". += [$worker]")
42+
done <<< $(seq 0 1 $(expr $consolidationMaxIndex - 1))
43+
44+
echo "::set-out-json workers $workers"
45+
46+
- name: run_task_matrix
47+
title: "Generate ${consolidationCount} consolidations for first ${consolidationMaxIndex} keys"
48+
configVars:
49+
matrixValues: "tasks.prepare.outputs.workers"
50+
config:
51+
runConcurrent: true
52+
matrixVar: "worker"
53+
task:
54+
name: run_tasks
55+
title: "Generate ${{worker.consolidationCount}} consolidations for key ${{worker.index}}"
56+
config:
57+
tasks:
58+
- name: check_consensus_validator_status
59+
title: "Get validator pubkey for key ${{worker.index}}"
60+
id: "get_validator"
61+
timeout: 1m
62+
configVars:
63+
validatorIndex: "worker.index"
64+
65+
- name: generate_child_wallet
66+
id: consolidationor_wallet
67+
title: "Generate wallet for lifecycle test"
68+
configVars:
69+
walletSeed: "| \"fillup-consolidation-queue-\" + .walletSeed + (.worker.index | tostring)"
70+
prefundMinBalance: "| (.worker.consolidationCount + 1) * 1000000000000000000"
71+
privateKey: "walletPrivkey"
72+
73+
- name: sleep
74+
title: "Sleep 10s to ensure propagation of last block with wallet fundings to all clients"
75+
config:
76+
duration: 10s
77+
78+
- name: run_task_options
79+
title: "Generate ${{worker.consolidationCount}} top up consolidations with 1 ETH each"
80+
config:
81+
task:
82+
name: generate_consolidations
83+
title: "Generate consolidations for key ${{worker.index}} (${{tasks.get_validator.outputs.pubkey}})"
84+
config:
85+
limitPerSlot: 20
86+
limitPending: 40
87+
sourceStartValidatorIndex: 0
88+
targetValidatorIndex: 0
89+
awaitReceipt: true
90+
failOnReject: true
91+
configVars:
92+
limitTotal: "worker.consolidationCount"
93+
walletPrivkey: "tasks.consolidationor_wallet.outputs.childWallet.privkey"
94+
txAmount: "consolidationTxFee"
95+
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
2+
id: fillup-withdrawal-queue
3+
name: "Fillup withdrawal queue"
4+
timeout: 1h
5+
config:
6+
walletPrivkey: ""
7+
withdrawalCount: 1000 # number of withdrawals to send
8+
withdrawalMaxIndex: 100 # number of wallets to send from
9+
withdrawalTxFee: 10000000000000000 # 0.01 ETH
10+
walletSeed: ""
11+
tasks:
12+
- name: check_clients_are_healthy
13+
title: "Check if at least one client is ready"
14+
timeout: 5m
15+
config:
16+
minClientCount: 1
17+
18+
- name: run_shell
19+
id: prepare
20+
title: "Prepare workers"
21+
config:
22+
envVars:
23+
withdrawalCount: "withdrawalCount"
24+
withdrawalMaxIndex: "withdrawalMaxIndex"
25+
command: |
26+
withdrawalCount=$(echo $withdrawalCount | jq -r .)
27+
withdrawalMaxIndex=$(echo $withdrawalMaxIndex | jq -r .)
28+
29+
minwithdrawalCount=$(expr $withdrawalCount \/ $withdrawalMaxIndex)
30+
plusOnewithdrawalCount=$(expr $withdrawalCount - $minwithdrawalCount \* $withdrawalMaxIndex)
31+
32+
workers="[]"
33+
34+
while read index; do
35+
withdrawalCount=$minwithdrawalCount
36+
if [ "$index" -lt "$plusOnewithdrawalCount" ]; then
37+
withdrawalCount=$(expr $withdrawalCount + 1)
38+
fi
39+
40+
worker=$(echo "{\"index\": $index, \"withdrawalCount\": $withdrawalCount}" )
41+
workers=$(echo $workers | jq -c ". += [$worker]")
42+
done <<< $(seq 0 1 $(expr $withdrawalMaxIndex - 1))
43+
44+
echo "::set-out-json workers $workers"
45+
46+
- name: run_task_matrix
47+
title: "Generate ${withdrawalCount} withdrawals for first ${withdrawalMaxIndex} keys"
48+
configVars:
49+
matrixValues: "tasks.prepare.outputs.workers"
50+
config:
51+
runConcurrent: true
52+
matrixVar: "worker"
53+
task:
54+
name: run_tasks
55+
title: "Generate ${{worker.withdrawalCount}} withdrawals for key ${{worker.index}}"
56+
config:
57+
tasks:
58+
- name: check_consensus_validator_status
59+
title: "Get validator pubkey for key ${{worker.index}}"
60+
id: "get_validator"
61+
timeout: 1m
62+
configVars:
63+
validatorIndex: "worker.index"
64+
65+
- name: generate_child_wallet
66+
id: withdrawal_wallet
67+
title: "Generate wallet for lifecycle test"
68+
configVars:
69+
walletSeed: "| \"fillup-withdrawal-queue-\" + .walletSeed + (.worker.index | tostring)"
70+
prefundMinBalance: "| (.worker.withdrawalCount + 1) * 1000000000000000000"
71+
privateKey: "walletPrivkey"
72+
73+
- name: sleep
74+
title: "Sleep 10s to ensure propagation of last block with wallet fundings to all clients"
75+
config:
76+
duration: 10s
77+
78+
- name: run_task_options
79+
title: "Generate ${{worker.withdrawalCount}} top up withdrawals with 1 ETH each"
80+
config:
81+
task:
82+
name: generate_withdrawal_requests
83+
title: "Generate withdrawals for key ${{worker.index}} (${{tasks.get_validator.outputs.pubkey}})"
84+
config:
85+
limitPerSlot: 20
86+
limitPending: 40
87+
withdrawAmount: 1 # 1 ETH
88+
sourceStartValidatorIndex: 0
89+
targetValidatorIndex: 0
90+
awaitReceipt: true
91+
failOnReject: true
92+
configVars:
93+
limitTotal: "worker.withdrawalCount"
94+
walletPrivkey: "tasks.withdrawal_wallet.outputs.childWallet.privkey"
95+
txAmount: "withdrawalTxFee"
96+

0 commit comments

Comments
 (0)