Skip to content

Commit

Permalink
refactor: clean up CachedData types
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkeil committed Nov 26, 2024
1 parent 72fd2fb commit e9e03ae
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/beacon-node/src/chain/blocks/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ export interface BlockInputBlobs extends ForkBlobsInfo {
blobsSource: BlobsSource;
}
export type BlobsCacheMap = Map<number, BlobData>;
interface CachedBlobs extends Availability<BlockInputBlobs> {
interface CachedBlobs extends CachedDataItem, ForkBlobsInfo, Availability<BlockInputBlobs> {
blobsCache: BlobsCacheMap;
}
type CachedBlobsItem = CachedDataItem & ForkBlobsInfo & CachedBlobs;

/**
*
Expand All @@ -90,18 +89,17 @@ export interface BlockInputDataColumns extends ForkDataColumnsInfo {
dataColumnsBytes: (Uint8Array | null)[];
dataColumnsSource: DataColumnsSource;
}
interface CachedDataColumns extends Availability<BlockInputDataColumns> {
interface CachedDataColumns extends CachedDataItem, ForkDataColumnsInfo, Availability<BlockInputDataColumns> {
dataColumnsCache: DataColumnsCacheMap;
}
type CachedDataColumnsItem = CachedDataItem & ForkDataColumnsInfo & CachedDataColumns;

/**
*
* Cross-Fork Data Types
*
*/
export type BlockInputAvailableData = BlockInputBlobs | BlockInputDataColumns;
export type BlockInputCachedData = CachedBlobsItem | CachedDataColumnsItem;
export type BlockInputCachedData = CachedBlobs | CachedDataColumns;

export type BlockInput = {block: SignedBeaconBlock; source: BlockSource; blockBytes: Uint8Array | null} & (
| {type: BlockInputType.preData | BlockInputType.outOfRangeData}
Expand Down

0 comments on commit e9e03ae

Please sign in to comment.