Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions packages/beacon-node/src/api/impl/beacon/blocks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export function getBeaconBlockApi({
dataColumnSidecars = [];
}

if (dataColumnSidecars.length > 0 && isBlockInputColumns(blockForImport)) {
if (isBlockInputColumns(blockForImport)) {
for (const dataColumnSidecar of dataColumnSidecars) {
blockForImport.addColumn({
blockRootHex: blockRoot,
Expand All @@ -132,10 +132,14 @@ export function getBeaconBlockApi({
seenTimestampSec,
});
}
}
if (blobSidecars.length > 0 && isBlockInputBlobs(blockForImport)) {
} else if (isBlockInputBlobs(blockForImport)) {
for (const blobSidecar of blobSidecars) {
blockForImport.addBlob({blockRootHex: blockRoot, blobSidecar, source: BlockInputSource.api, seenTimestampSec});
blockForImport.addBlob({
blockRootHex: blockRoot,
blobSidecar,
source: BlockInputSource.api,
seenTimestampSec,
});
}
}

Expand Down
4 changes: 1 addition & 3 deletions packages/beacon-node/src/chain/blocks/importBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,7 @@ export async function importBlock(
for (const {source} of blockInput.getSampledColumnsWithSource()) {
this.metrics?.importBlock.columnsBySource.inc({source});
}
}

if (isBlockInputBlobs(blockInput)) {
} else if (isBlockInputBlobs(blockInput)) {
for (const {source} of blockInput.getAllBlobsWithSource()) {
this.metrics?.importBlock.blobsBySource.inc({blobsSource: source});
}
Expand Down
2 changes: 0 additions & 2 deletions packages/beacon-node/src/network/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
Upgrader,
} from "@libp2p/interface";
import type {AddressManager, ConnectionManager, Registrar, TransportManager} from "@libp2p/interface-internal";
import {LoggerNode} from "@lodestar/logger/node";
import {
AttesterSlashing,
LightClientFinalityUpdate,
Expand Down Expand Up @@ -59,7 +58,6 @@ export interface INetwork extends INetworkCorePublic {
readonly peerId: PeerId;
readonly custodyConfig: CustodyConfig;
readonly closed: boolean;
readonly logger: LoggerNode;
events: INetworkEventBus;

getConnectedPeers(): PeerIdStr[];
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/src/network/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ export type NetworkInitModules = {
export class Network implements INetwork {
readonly peerId: PeerId;
readonly custodyConfig: CustodyConfig;
readonly logger: LoggerNode;
// TODO: Make private
readonly events: INetworkEventBus;

private readonly logger: LoggerNode;
private readonly config: BeaconConfig;
private readonly clock: IClock;
private readonly chain: IBeaconChain;
Expand Down
5 changes: 2 additions & 3 deletions packages/beacon-node/src/sync/unknownBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
PendingBlockInput,
PendingBlockInputStatus,
PendingBlockType,
PendingRootHex,
getBlockInputSyncCacheItemRootHex,
getBlockInputSyncCacheItemSlot,
isPendingBlockInput,
Expand Down Expand Up @@ -178,7 +177,7 @@ export class BlockInputSync {
};

private addByRootHex = (rootHex: RootHex, peerIdStr?: PeerIdStr): void => {
let pendingBlock = this.pendingBlocks.get(rootHex) as PendingRootHex;
let pendingBlock = this.pendingBlocks.get(rootHex);
if (!pendingBlock) {
pendingBlock = {
status: PendingBlockInputStatus.pending,
Expand Down Expand Up @@ -207,7 +206,7 @@ export class BlockInputSync {
};

private addByBlockInput = (blockInput: IBlockInput, peerIdStr?: string): void => {
let pendingBlock = this.pendingBlocks.get(blockInput.blockRootHex) as PendingBlockInput;
let pendingBlock = this.pendingBlocks.get(blockInput.blockRootHex);
// if entry is missing or was added via rootHex and now we have more complete information overwrite
// the existing information with the more complete cache entry
if (!pendingBlock || !isPendingBlockInput(pendingBlock)) {
Expand Down
1 change: 0 additions & 1 deletion packages/beacon-node/src/sync/utils/pendingBlocksTree.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {RootHex} from "@lodestar/types";
import {MapDef} from "@lodestar/utils";
// import {DownloadedBlock, PendingBlock, PendingBlockStatus, UnknownBlock} from "../interface.js";
import {
BlockInputSyncCacheItem,
PendingBlockInput,
Expand Down
Loading