Skip to content

Commit 08e3ca2

Browse files
committed
fix nil pointer panic in check_consensus_block_proposals task
1 parent 486632c commit 08e3ca2

File tree

3 files changed

+49
-22
lines changed

3 files changed

+49
-22
lines changed

pkg/coordinator/tasks/check_consensus_block_proposals/task.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,9 +644,9 @@ func (t *Task) checkBlockWithdrawals(block *consensus.Block, blockData *spec.Ver
644644
switch {
645645
case expectedWithdrawal.Address != "" && !strings.EqualFold(expectedWithdrawal.Address, withdrawal.Address.String()):
646646
t.logger.Warnf("check failed: withdrawal found, but execution address does not match (have: %v, want: %v)", withdrawal.Address.String(), expectedWithdrawal.Address)
647-
case expectedWithdrawal.MinAmount.Cmp(big.NewInt(0)) > 0 && expectedWithdrawal.MinAmount.Cmp(withdrawalAmount) > 0:
647+
case expectedWithdrawal.MinAmount != nil && expectedWithdrawal.MinAmount.Cmp(big.NewInt(0)) > 0 && expectedWithdrawal.MinAmount.Cmp(withdrawalAmount) > 0:
648648
t.logger.Warnf("check failed: withdrawal found, but amount lower than minimum (have: %v, want >= %v)", withdrawalAmount, expectedWithdrawal.MinAmount)
649-
case expectedWithdrawal.MaxAmount.Cmp(big.NewInt(0)) > 0 && expectedWithdrawal.MaxAmount.Cmp(withdrawalAmount) < 0:
649+
case expectedWithdrawal.MaxAmount != nil && expectedWithdrawal.MaxAmount.Cmp(big.NewInt(0)) > 0 && expectedWithdrawal.MaxAmount.Cmp(withdrawalAmount) < 0:
650650
t.logger.Warnf("check failed: withdrawal found, but amount higher than maximum (have: %v, want <= %v)", withdrawalAmount, expectedWithdrawal.MaxAmount)
651651
default:
652652
found = true

playbooks/pectra-dev/eip7251-all.yaml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,6 @@ tasks:
2626
minEpochNumber: "tasks.get_specs.outputs.specs.ELECTRA_FORK_EPOCH"
2727

2828
# prepare wallets
29-
- name: get_random_mnemonic
30-
id: test_mnemonic
31-
title: "Generate random mnemonic"
32-
if: "useExistingValidators == false"
33-
34-
- name: run_shell
35-
title: "Use generated random mnemonic for tests"
36-
if: "useExistingValidators == false"
37-
config:
38-
envVars:
39-
MNEMONIC: "tasks.test_mnemonic.outputs.mnemonic"
40-
command: |
41-
# override the validatorMnemonic variable with the generated random mnemonic
42-
echo "::set-var validatorMnemonic ${MNEMONIC}"
43-
echo "::set-json validatorStartIndex 0"
44-
4529
- name: generate_child_wallet
4630
id: main_wallet
4731
title: "Generate main wallet for tests"
@@ -67,6 +51,20 @@ tasks:
6751
config:
6852
stopChildOnResult: false
6953
tasks:
54+
# generate random mnemonic
55+
- name: get_random_mnemonic
56+
id: test_mnemonic
57+
title: "Generate random mnemonic"
58+
- name: run_shell
59+
title: "Use generated random mnemonic for tests"
60+
config:
61+
envVars:
62+
MNEMONIC: "tasks.test_mnemonic.outputs.mnemonic"
63+
command: |
64+
# override the validatorMnemonic variable with the generated random mnemonic
65+
echo "::set-json validatorMnemonic ${MNEMONIC}"
66+
echo "::set-json validatorStartIndex 0"
67+
7068
# generate 22 deposits with 0x00 withdrawal credentials
7169
- name: generate_deposits
7270
id: deposits
@@ -503,6 +501,7 @@ tasks:
503501
config:
504502
validatorStatus:
505503
- active_ongoing
504+
minValidatorBalance: 2047100000000 # expect >2047.1 ETH
506505
maxValidatorBalance: 2048100000000 # expect <2048.1 ETH
507506
configVars:
508507
validatorPubKey: "tasks.validator_pubkeys.outputs.pubkeys[4]"
@@ -1196,7 +1195,7 @@ tasks:
11961195
title: "Check if key 14 has received the full balance"
11971196
timeout: 8h
11981197
config:
1199-
minValidatorBalance: 95900000000 # expect >95.9 ETH
1198+
minValidatorBalance: 95700000000 # expect >95.7 ETH
12001199
validatorStatus:
12011200
- active_ongoing
12021201
configVars:

playbooks/pectra-dev/validator-lifecycle-test-v3.yaml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ tasks:
115115
depositContract: "depositContract"
116116
withdrawalCredentials: "| \"0x010000000000000000000000\" + (.tasks.depositor_wallet.outputs.childWallet.address | capture(\"(0x)?(?<addr>.+)\").addr)"
117117

118-
# 1 deposit, 24 ETH, 0x01 withdrawal creds (index 7)
118+
# 1 deposit, 24 ETH, 0x02 withdrawal creds (index 7)
119119
- name: generate_deposits
120-
title: "Generate 1 deposit with 24 ETH and 0x01 withdrawal creds (index 7)"
120+
title: "Generate 1 deposit with 24 ETH and 0x02 withdrawal creds (index 7)"
121121
id: deposit_3
122122
config:
123123
limitTotal: 1
@@ -129,7 +129,7 @@ tasks:
129129
walletPrivkey: "tasks.depositor_wallet.outputs.childWallet.privkey"
130130
mnemonic: "tasks.test_mnemonic.outputs.mnemonic"
131131
depositContract: "depositContract"
132-
withdrawalCredentials: "| \"0x010000000000000000000000\" + (.tasks.depositor_wallet.outputs.childWallet.address | capture(\"(0x)?(?<addr>.+)\").addr)"
132+
withdrawalCredentials: "| \"0x020000000000000000000000\" + (.tasks.depositor_wallet.outputs.childWallet.address | capture(\"(0x)?(?<addr>.+)\").addr)"
133133

134134
# 2 deposits, 64 ETH each, 0x02 withdrawal creds (index 8-9)
135135
- name: generate_deposits
@@ -587,6 +587,34 @@ tasks:
587587
config:
588588
tasks:
589589

590+
# generate self consolidation for key 5 & wait for inclusion
591+
- name: run_task_background
592+
title: "Generate self consolidation for key 5"
593+
timeout: 10m
594+
config:
595+
onBackgroundComplete: failOrIgnore
596+
backgroundTask:
597+
name: generate_consolidations
598+
title: "Generate 1 self consolidation (key 5)"
599+
config:
600+
limitTotal: 1
601+
sourceStartIndex: 5
602+
sourceIndexCount: 1
603+
awaitReceipt: true
604+
failOnReject: true
605+
configVars:
606+
sourceMnemonic: "tasks.test_mnemonic.outputs.mnemonic"
607+
targetPublicKey: "tasks.all_pubkeys.outputs.pubkeys[5]"
608+
walletPrivkey: "tasks.depositor_wallet.outputs.childWallet.privkey"
609+
610+
foregroundTask:
611+
name: check_consensus_block_proposals
612+
title: "Wait for inclusion of self consolidation request for key 5"
613+
config:
614+
minConsolidationRequestCount: 1
615+
configVars:
616+
expectConsolidationRequests: "| [{sourceAddress: .tasks.depositor_wallet.outputs.childWallet.address, sourcePubkey: .tasks.all_pubkeys.outputs.pubkeys[5]}]"
617+
590618
- name: run_task_background
591619
title: "Generate consolidations & track inclusion"
592620
config:

0 commit comments

Comments
 (0)