Skip to content

Commit

Permalink
resolve availability when datacolumns are downloaded and matched
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Sep 7, 2024
1 parent 2833ac0 commit bf08852
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,15 @@ export async function unavailableBeaconBlobsByRoot(
? {blocks: [unavailableBlockInput], pendingDataColumns: neededColumns}
: null
);

// don't forget to resolve availability as the block may be stuck in availability wait
if (availableBlockInput !== undefined && availableBlockInput.type === BlockInputType.availableData) {
const {blockData} = availableBlockInput;
if (blockData.fork !== ForkName.peerdas) {
throw Error(`unexpected blockData fork=${blockData.fork} returned by matchBlockWithDataColumns`);
}
resolveAvailability(blockData);
}
}
} else {
throw Error(`Invalid cachedData fork=${cachedData.fork} for unavailableBeaconBlobsByRoot`);
Expand Down

0 comments on commit bf08852

Please sign in to comment.