Skip to content

Commit cec1132

Browse files
committed
fix eip7251 test collection & make check_consensus_block_proposals checking the current block too
1 parent f0413d8 commit cec1132

2 files changed

Lines changed: 61 additions & 32 deletions

File tree

pkg/coordinator/tasks/check_consensus_block_proposals/task.go

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -87,30 +87,45 @@ func (t *Task) Execute(ctx context.Context) error {
8787
totalMatches := 0
8888
matchingBlocks := []*consensus.Block{}
8989

90-
for {
91-
select {
92-
case block := <-blockSubscription.Channel():
93-
matches := t.checkBlock(ctx, block)
94-
if matches {
95-
matchingBlocks = append(matchingBlocks, block)
96-
t.logger.Infof("matching block %v [0x%x]", block.Slot, block.Root)
90+
checkBlockMatch := func(block *consensus.Block) bool {
91+
matches := t.checkBlock(ctx, block)
92+
if matches {
93+
matchingBlocks = append(matchingBlocks, block)
94+
t.logger.Infof("matching block %v [0x%x]", block.Slot, block.Root)
9795

98-
totalMatches++
99-
}
96+
totalMatches++
97+
}
10098

101-
if t.config.BlockCount > 0 {
102-
if totalMatches >= t.config.BlockCount {
103-
t.setMatchingBlocksOutput(matchingBlocks)
104-
t.ctx.SetResult(types.TaskResultSuccess)
99+
if t.config.BlockCount > 0 {
100+
if totalMatches >= t.config.BlockCount {
101+
t.setMatchingBlocksOutput(matchingBlocks)
102+
t.ctx.SetResult(types.TaskResultSuccess)
105103

106-
return nil
107-
}
104+
return true
105+
}
106+
} else {
107+
if matches {
108+
t.ctx.SetResult(types.TaskResultSuccess)
108109
} else {
109-
if matches {
110-
t.ctx.SetResult(types.TaskResultSuccess)
111-
} else {
112-
t.ctx.SetResult(types.TaskResultNone)
113-
}
110+
t.ctx.SetResult(types.TaskResultNone)
111+
}
112+
}
113+
114+
return false
115+
}
116+
117+
// check current block
118+
if blocks := consensusPool.GetBlockCache().GetCachedBlocks(); len(blocks) > 0 {
119+
if checkBlockMatch(blocks[0]) {
120+
return nil
121+
}
122+
}
123+
124+
for {
125+
select {
126+
case block := <-blockSubscription.Channel():
127+
if checkBlockMatch(block) {
128+
return nil
114129
}
115130
case <-ctx.Done():
116131
return ctx.Err()

playbooks/pectra-dev/kurtosis/eip7251-all.yaml renamed to playbooks/pectra-dev/eip7251-all.yaml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ tasks:
6767
config:
6868
stopChildOnResult: false
6969
tasks:
70-
# generate 22 deposits with 0x01 withdrawal credentials
70+
# generate 22 deposits with 0x00 withdrawal credentials
7171
- name: generate_deposits
7272
id: deposits
73-
title: "Generate 22 deposits with 32 ETH each and 0x01 withdrawal credentials"
73+
title: "Generate 22 deposits with 32 ETH each and 0x00 withdrawal credentials"
7474
config:
7575
limitTotal: 22
7676
depositAmount: 32
@@ -144,15 +144,29 @@ tasks:
144144
config:
145145
onBackgroundComplete: failOrIgnore
146146
backgroundTask:
147-
name: generate_bls_changes
148-
title: "Send BLS changes for genesis validators"
147+
name: run_tasks
148+
title: "Generate BLS changes for genesis validators"
149149
config:
150-
limitTotal: 21 # 1 will be skipped as we already have a BLS change for key 9
151-
indexCount: 22
152-
configVars:
153-
mnemonic: "validatorMnemonic"
154-
startIndex: "validatorStartIndex"
155-
targetAddress: "tasks.main_wallet.outputs.childWallet.address"
150+
stopChildOnResult: false
151+
tasks:
152+
- name: generate_bls_changes
153+
title: "Send BLS changes for genesis validators"
154+
config:
155+
limitTotal: 9 # key 0-8
156+
indexCount: 9
157+
configVars:
158+
mnemonic: "validatorMnemonic"
159+
startIndex: "validatorStartIndex"
160+
targetAddress: "tasks.main_wallet.outputs.childWallet.address"
161+
- name: generate_bls_changes
162+
title: "Send BLS changes for genesis validators"
163+
config:
164+
limitTotal: 12 # key 10-21
165+
indexCount: 12
166+
configVars:
167+
mnemonic: "validatorMnemonic"
168+
startIndex: "validatorStartIndex + 10"
169+
targetAddress: "tasks.main_wallet.outputs.childWallet.address"
156170
foregroundTask:
157171
name: run_task_matrix
158172
title: "Wait for inclusion of all BLS changes"
@@ -349,7 +363,7 @@ tasks:
349363
- name: sleep
350364
title: "Wait 30 minutes"
351365
config:
352-
duration: 1h
366+
duration: 30m
353367

354368
- name: check_consensus_validator_status
355369
title: "Check if key 2 is still active"
@@ -1015,7 +1029,7 @@ tasks:
10151029
validatorStatus:
10161030
- active_ongoing
10171031
configVars:
1018-
validatorPubKey: "tasks.validator_pubkeys.outputs.pubkeys[12]"
1032+
validatorPubKey: "tasks.validator_pubkeys.outputs.pubkeys[13]"
10191033

10201034
# Test8: Change withdrawal credentials of 2 validators to 0x02, then consolidate a 3rd validator with 0x01 credentials into the 2nd, afterwards consolidate the 2nd validator into the 1st. Assert the full balance arriving at the 1st validator
10211035
# keys: 14, 15, 16

0 commit comments

Comments
 (0)