Skip to content

Commit 486632c

Browse files
committed
various fixes for eip7002 & eip7251 tests
1 parent a88c1e6 commit 486632c

File tree

8 files changed

+37
-16
lines changed

8 files changed

+37
-16
lines changed

pkg/coordinator/tasks/check_consensus_block_proposals/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ The `check_consensus_block_proposals` task assesses consensus block proposals ag
7171
`{publicKey: "0x0000...", address: "0x00..."}`
7272

7373
- **`expectWithdrawals`**:\
74-
Specifies expected withdrawal operations, including public keys, destination addresses, and minimum withdrawal amounts.
75-
`{publicKey: "0x0000...", address: "0x00...", minAmount: 0}`
74+
Specifies expected withdrawal operations, including public keys, destination addresses, and minimum/maximum withdrawal amounts.
75+
`{publicKey: "0x0000...", address: "0x00...", minAmount: 0, maxAmount: 0}`
7676

7777
- **`expectDepositRequests`**:\
7878
Specifies expected deposit request operations, each object detailing the public key, withdrawal credentials, and deposit amount.

pkg/coordinator/tasks/check_consensus_block_proposals/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ type Config struct {
3636
PublicKey string `yaml:"publicKey" json:"publicKey"`
3737
Address string `yaml:"address" json:"address"`
3838
MinAmount *big.Int `yaml:"minAmount" json:"minAmount"`
39+
MaxAmount *big.Int `yaml:"maxAmount" json:"maxAmount"`
3940
} `yaml:"expectWithdrawals" json:"expectWithdrawals"`
4041
ExpectDepositRequests []struct {
4142
PublicKey string `yaml:"publicKey" json:"publicKey"`

pkg/coordinator/tasks/check_consensus_block_proposals/task.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,8 @@ func (t *Task) checkBlockWithdrawals(block *consensus.Block, blockData *spec.Ver
646646
t.logger.Warnf("check failed: withdrawal found, but execution address does not match (have: %v, want: %v)", withdrawal.Address.String(), expectedWithdrawal.Address)
647647
case 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:
650+
t.logger.Warnf("check failed: withdrawal found, but amount higher than maximum (have: %v, want <= %v)", withdrawalAmount, expectedWithdrawal.MaxAmount)
649651
default:
650652
found = true
651653
}

pkg/coordinator/tasks/run_task_options/task.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,19 @@ func (t *Task) Execute(ctx context.Context) error {
110110
}
111111
case t.config.ExpectFailure:
112112
if taskErr == nil {
113+
t.ctx.SetResult(types.TaskResultFailure)
113114
return fmt.Errorf("child task succeeded, but should have failed")
115+
} else {
116+
t.ctx.SetResult(types.TaskResultSuccess)
114117
}
115118
case t.config.IgnoreFailure:
116119
if taskErr != nil {
117120
t.logger.Warnf("child task failed: %w", taskErr)
118121
}
122+
t.ctx.SetResult(types.TaskResultSuccess)
119123
default:
120124
if taskErr != nil {
125+
t.ctx.SetResult(types.TaskResultFailure)
121126
return fmt.Errorf("child task failed: %w", taskErr)
122127
}
123128
}

pkg/coordinator/tasks/run_tasks_concurrent/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ type Config struct {
1313
// number of failed child tasks to make this task fail (0 = all tasks)
1414
FailTaskCount uint64 `yaml:"failTaskCount" json:"failTaskCount"`
1515

16+
// fail task if neither succeedTaskCount nor failTaskCount is reached, but all tasks completed
17+
FailOnUndecided bool `yaml:"failOnUndecided" json:"failOnUndecided"`
18+
1619
// create a new variable scope for the child tasks
1720
NewVariableScope bool `yaml:"newVariableScope" json:"newVariableScope"`
1821

pkg/coordinator/tasks/run_tasks_concurrent/task.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,12 @@ func (t *Task) Execute(ctx context.Context) error {
207207
if !taskComplete {
208208
taskComplete = true
209209

210-
t.ctx.SetResult(types.TaskResultSuccess)
210+
if t.config.FailOnUndecided {
211+
t.ctx.SetResult(types.TaskResultFailure)
212+
} else {
213+
t.ctx.SetResult(types.TaskResultSuccess)
214+
}
215+
211216
t.logger.Infof("all child tasks completed (%v success, %v failure)", successCount, failureCount)
212217
}
213218
}

playbooks/pectra-dev/eip7002-all.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
id: eip7002-all
33
name: "EIP7002 test (el triggerable exits)"
4-
timeout: 38h
4+
timeout: 72h
55
config:
66
walletPrivkey: ""
77
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"
@@ -85,7 +85,7 @@ tasks:
8585
tasks:
8686
- name: check_consensus_validator_status
8787
title: "Wait for validators to be active"
88-
timeout: 2h
88+
timeout: 24h
8989
config:
9090
validatorStatus:
9191
- active_ongoing
@@ -130,6 +130,7 @@ tasks:
130130
id: tests
131131
config:
132132
failTaskCount: 0
133+
failOnUndecided: true
133134
tasks:
134135

135136
# Test1: Submit a exit request from an address with 0x00 credentials, assert no exit
@@ -240,7 +241,7 @@ tasks:
240241
- active_exiting
241242
- exited_unslashed
242243
configVars:
243-
validatorPubKey: "tasks.all_pubkeys.outputs.pubkeys[1]"
244+
validatorPubKey: "tasks.validator_pubkeys.outputs.pubkeys[1]"
244245

245246
# Test3: Submit a exit request from an address with 0x02 credentials, assert exit
246247
# keys: 2
@@ -490,7 +491,6 @@ tasks:
490491
failOnReject: true
491492
configVars:
492493
sourceMnemonic: "validatorMnemonic"
493-
targetValidatorIndex: "validatorStartIndex + 4"
494494
targetPublicKey: "tasks.validator_pubkeys.outputs.pubkeys[4]"
495495
sourceStartIndex: "validatorStartIndex + 4"
496496
walletPrivkey: "walletPrivkey"
@@ -535,7 +535,7 @@ tasks:
535535
- name: check_consensus_validator_status
536536
title: "Wait for key 4 balance to increase > 33 ETH"
537537
id: key4_status
538-
timeout: 30m
538+
timeout: 4h
539539
config:
540540
validatorStatus:
541541
- active_ongoing
@@ -600,13 +600,13 @@ tasks:
600600

601601
# wait for withdrawal to be processed
602602
- name: check_consensus_block_proposals
603-
title: "Check for >= 1 ETH withdrawal for key 4"
603+
title: "Check for exact 1 ETH withdrawal for key 4"
604604
timeout: 2h
605605
config:
606606
minWithdrawalCount: 1
607607
configVars:
608-
expectWithdrawals: "| [{publicKey: .tasks.validator_pubkeys.outputs.pubkeys[4], address: .tasks.wallet_details.outputs.address, minAmount: 1000000000}]"
609-
608+
expectWithdrawals: "| [{publicKey: .tasks.validator_pubkeys.outputs.pubkeys[4], address: .tasks.wallet_details.outputs.address, minAmount: 1000000000, maxAmount: 1000000000}]"
609+
610610

611611
# Test6: Submit a partial 2 ETH withdrawal request from an address with 0x02 credentials and balance < 34 ETH, assert < 2 ETH withdrawal
612612
# keys: 5
@@ -698,7 +698,7 @@ tasks:
698698
- name: check_consensus_validator_status
699699
title: "Get validator info for key 5 (expect 0x02 credentials)"
700700
id: key5_status
701-
timeout: 30m
701+
timeout: 4h
702702
config:
703703
withdrawalCredsPrefix: "0x02"
704704
validatorStatus:
@@ -762,7 +762,7 @@ tasks:
762762
# check chain for 30 minutes, expect withdrawal with >= 0.5 ETH & < 1.5 ETH for key 5
763763
- name: check_consensus_block_proposals
764764
title: "Check withdrawal for key 5 (expect in range 0.5-1.5 ETH)"
765-
timeout: 30m
765+
timeout: 2h
766766
id: key5_withdrawal
767767
config:
768768
minWithdrawalCount: 1

playbooks/pectra-dev/eip7251-all.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ tasks:
230230
id: tests
231231
config:
232232
failTaskCount: 0
233+
failOnUndecided: true
233234
tasks:
234235

235236
# Test1: Change withdrawal credentials of a validator to 0x02 (via self-consolidation) and consolidate another validator with 0x01 credentials into it
@@ -1015,19 +1016,23 @@ tasks:
10151016

10161017
- name: check_consensus_validator_status
10171018
title: "Check if key 12 is slashed"
1019+
timeout: 30m
10181020
config:
10191021
validatorStatus:
10201022
- active_slashed
10211023
- exited_slashed
10221024
configVars:
10231025
validatorPubKey: "tasks.validator_pubkeys.outputs.pubkeys[12]"
10241026

1025-
# check if key 13 is still active
1027+
# check if key 13 is exited
10261028
- name: check_consensus_validator_status
1027-
title: "Check if key 13 is still active"
1029+
title: "Check if key 13 is exited"
1030+
timeout: 5m
10281031
config:
10291032
validatorStatus:
1030-
- active_ongoing
1033+
- exited_unslashed
1034+
- withdrawal_possible
1035+
- withdrawal_done
10311036
configVars:
10321037
validatorPubKey: "tasks.validator_pubkeys.outputs.pubkeys[13]"
10331038

0 commit comments

Comments
 (0)