Skip to content

Commit fbe080f

Browse files
committed
temp test playbook for lighthouse bug
1 parent b8aa651 commit fbe080f

1 file changed

Lines changed: 204 additions & 0 deletions

File tree

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
2+
id: eip7002-all
3+
name: "EIP7002 test (el triggerable exits)"
4+
timeout: 38h
5+
config:
6+
walletPrivkey: ""
7+
validatorMnemonic: "giant issue aisle success illegal bike spike question tent bar rely arctic volcano long crawl hungry vocal artwork sniff fantasy very lucky have athlete"
8+
validatorStartIndex: 0
9+
depositContract: "0x4242424242424242424242424242424242424242"
10+
tasks:
11+
- name: check_clients_are_healthy
12+
title: "Check if at least one client is ready"
13+
timeout: 5m
14+
config:
15+
minClientCount: 1
16+
17+
# wait for electra activation
18+
- name: get_consensus_specs
19+
id: get_specs
20+
title: "Get consensus chain specs"
21+
- name: check_consensus_slot_range
22+
title: "Wait for electra activation"
23+
timeout: 1h
24+
configVars:
25+
minEpochNumber: "tasks.get_specs.outputs.specs.ELECTRA_FORK_EPOCH"
26+
27+
# get wallet details
28+
- name: get_wallet_details
29+
id: wallet_details
30+
configVars:
31+
privateKey: "walletPrivkey"
32+
33+
# get pubkeys for the test validators
34+
- name: get_pubkeys_from_mnemonic
35+
id: validator_pubkeys
36+
title: "Get test validator pubkeys"
37+
config:
38+
count: 10
39+
configVars:
40+
startIndex: "validatorStartIndex"
41+
mnemonic: "validatorMnemonic"
42+
43+
# wait for exitability
44+
- name: run_tasks
45+
title: "Wait for validators to be exitable (${{ tasks.get_specs.outputs.specs.SHARD_COMMITTEE_PERIOD }} epochs)"
46+
config:
47+
stopChildOnResult: true
48+
tasks:
49+
- name: check_consensus_validator_status
50+
title: "Get validator info for last key"
51+
id: last_validator_info
52+
timeout: 1m
53+
config:
54+
validatorStatus:
55+
- active_ongoing
56+
configVars:
57+
validatorPubKey: "tasks.validator_pubkeys.outputs.pubkeys[-1]"
58+
- name: check_consensus_slot_range
59+
title: "Wait for validators to be exitable (epoch >= ${{ |(.tasks.last_validator_info.outputs.validator.validator.activation_epoch | tonumber) + (.tasks.get_specs.outputs.specs.SHARD_COMMITTEE_PERIOD | tonumber) }})"
60+
timeout: 28h # 256 epochs = ~27.3h
61+
configVars:
62+
minEpochNumber: "|(.tasks.last_validator_info.outputs.validator.validator.activation_epoch | tonumber) + (.tasks.get_specs.outputs.specs.SHARD_COMMITTEE_PERIOD | tonumber)"
63+
64+
65+
## all preparations are done, now we can start the actual tests
66+
- name: run_tasks_concurrent
67+
title: "Run eip 7002 tests"
68+
id: tests
69+
config:
70+
failTaskCount: 0
71+
tasks:
72+
73+
74+
# Test3: Submit a exit request from an address with 0x02 credentials, assert exit
75+
# keys: 2
76+
- name: run_tasks
77+
title: "Test3: Submit a exit request from an address with 0x02 credentials, assert exit"
78+
config:
79+
tasks:
80+
# generate BLS change & wait for inclusion
81+
- name: run_task_background
82+
title: "Generate BLS change for key 2 & track inclusion"
83+
timeout: 10m
84+
config:
85+
onBackgroundComplete: failOrIgnore
86+
backgroundTask:
87+
name: generate_bls_changes
88+
title: "Send BLS change for key 2 (0x02 credentials)"
89+
config:
90+
limitTotal: 1
91+
indexCount: 1
92+
configVars:
93+
mnemonic: "validatorMnemonic"
94+
targetAddress: "tasks.wallet_details.outputs.address"
95+
startIndex: "validatorStartIndex + 2"
96+
foregroundTask:
97+
name: check_consensus_block_proposals
98+
title: "Wait for inclusion of BLS change for key 2"
99+
config:
100+
minBlsChangeCount: 1
101+
configVars:
102+
expectBlsChanges: "| [{publicKey: .tasks.validator_pubkeys.outputs.pubkeys[2], address: .tasks.wallet_details.outputs.address}]"
103+
104+
- name: sleep
105+
title: "Wait"
106+
config:
107+
duration: 1m
108+
109+
# generate deposit for key 2 (add 1 ETH) & wait for inclusion
110+
- name: run_task_background
111+
title: "Generate deposit with 0x02 credential change for key 2 & track inclusion"
112+
timeout: 10m
113+
config:
114+
onBackgroundComplete: failOrIgnore
115+
backgroundTask:
116+
name: generate_deposits
117+
title: "Generate deposit with 0x02 credential change for key 2"
118+
config:
119+
limitTotal: 1
120+
indexCount: 1
121+
depositAmount: 1
122+
topUpDeposit: false
123+
awaitReceipt: true
124+
failOnReject: true
125+
configVars:
126+
mnemonic: "validatorMnemonic"
127+
startIndex: "validatorStartIndex + 2"
128+
walletPrivkey: "walletPrivkey"
129+
depositContract: "depositContract"
130+
withdrawalCredentials: "| \"0x020000000000000000000000\" + (.tasks.wallet_details.outputs.address | capture(\"(0x)?(?<addr>.+)\").addr)"
131+
foregroundTask:
132+
name: check_consensus_block_proposals
133+
title: "Wait for inclusion of top-up deposit for key 2"
134+
config:
135+
minDepositRequestCount: 1
136+
configVars:
137+
expectDepositRequests: "| [{publicKey: .tasks.validator_pubkeys.outputs.pubkeys[2], amount: 1000000000}]"
138+
139+
# check if key 2 has 0x02 credentials
140+
- name: check_consensus_validator_status
141+
title: "Get validator info for key 2 (expect 0x02 credentials)"
142+
id: key2_status
143+
timeout: 30m
144+
config:
145+
withdrawalCredsPrefix: "0x02"
146+
validatorStatus:
147+
- active_ongoing
148+
configVars:
149+
validatorPubKey: "tasks.validator_pubkeys.outputs.pubkeys[2]"
150+
- name: run_shell
151+
title: "Check if key 2 has 0x02 credentials"
152+
config:
153+
envVars:
154+
validator: "tasks.key2_status.outputs.validator"
155+
command: |
156+
withdrawal_creds=$(echo "$validator" | jq -r '.validator.withdrawal_credentials')
157+
echo "Withdrawal credentials: $withdrawal_creds"
158+
159+
if [[ ! "$withdrawal_creds" == "0x02"* ]]; then
160+
echo "Invalid withdrawal credentials! expected: 0x02*, got: $withdrawal_creds"
161+
exit 1
162+
fi
163+
164+
- name: sleep
165+
title: "Wait"
166+
config:
167+
duration: 1m
168+
169+
# generate withdrawal & wait for inclusion
170+
- name: run_task_background
171+
title: "Generate EL triggered exit for key 2 & track inclusion"
172+
timeout: 10m
173+
config:
174+
onBackgroundComplete: failOrIgnore
175+
backgroundTask:
176+
name: generate_withdrawal_requests
177+
title: "Send EL triggered exit transaction for key 2"
178+
config:
179+
limitTotal: 1
180+
withdrawAmount: 0 # 0 ETH - exit
181+
awaitReceipt: true
182+
failOnReject: true
183+
configVars:
184+
sourcePubkey: "tasks.validator_pubkeys.outputs.pubkeys[2]"
185+
walletPrivkey: "walletPrivkey"
186+
foregroundTask:
187+
name: check_consensus_block_proposals
188+
title: "Wait for inclusion of EL triggered exit request for key 2"
189+
config:
190+
minWithdrawalRequestCount: 1
191+
configVars:
192+
expectWithdrawalRequests: "| [{validatorPubkey: .tasks.validator_pubkeys.outputs.pubkeys[2], sourceAddress: .tasks.wallet_details.outputs.address, amount: 0}]"
193+
194+
# wait for exit to be processed
195+
- name: check_consensus_validator_status
196+
title: "Wait for key 2 to exit"
197+
timeout: 1h
198+
config:
199+
validatorStatus:
200+
- active_exiting
201+
- exited_unslashed
202+
configVars:
203+
validatorPubKey: "tasks.validator_pubkeys.outputs.pubkeys[2]"
204+

0 commit comments

Comments
 (0)