Skip to content

Commit ff59d47

Browse files
committed
fix: Fetch parent block even when past reexecution deadline
Attempts fetching the parent block when computing an attestation even if past the reexecution deadline. This may fix flakes in tests where reexecution is not needed, in particular inactivity slash.
1 parent 510c394 commit ff59d47

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

yarn-project/validator-client/src/block_proposal_handler.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,21 +135,18 @@ export class BlockProposalHandler {
135135
const currentTime = this.dateProvider.now();
136136
const timeoutDurationMs = deadline.getTime() - currentTime;
137137
const parentBlock =
138-
timeoutDurationMs <= 0
138+
(await this.blockSource.getBlock(blockNumber - 1)) ??
139+
(timeoutDurationMs <= 0
139140
? undefined
140141
: await retryUntil(
141142
async () => {
142-
const block = await this.blockSource.getBlock(blockNumber - 1);
143-
if (block) {
144-
return block;
145-
}
146143
await this.blockSource.syncImmediate();
147144
return await this.blockSource.getBlock(blockNumber - 1);
148145
},
149146
'Force Archiver Sync',
150147
timeoutDurationMs / 1000,
151148
0.5,
152-
);
149+
));
153150

154151
if (parentBlock === undefined) {
155152
this.log.warn(`Parent block for ${blockNumber} not found, skipping processing`, proposalInfo);

0 commit comments

Comments
 (0)