Skip to content

Commit

Permalink
reduce diff
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Feb 2, 2023
1 parent 280dd7a commit eeae7a4
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 11 deletions.
3 changes: 1 addition & 2 deletions packages/cli/src/cmds/beacon/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {createKeypairFromPeerId, SignableENR} from "@chainsafe/discv5";
import {ErrorAborted} from "@lodestar/utils";
import {LevelDbController} from "@lodestar/db";
import {BeaconNode, BeaconDb, createNodeJsLibp2p} from "@lodestar/beacon-node";
import {chainConfigToJson, createIBeaconConfig} from "@lodestar/config";
import {createIBeaconConfig} from "@lodestar/config";
import {ACTIVE_PRESET, PresetName} from "@lodestar/params";
import {ProcessShutdownCallback} from "@lodestar/validator";

Expand Down Expand Up @@ -55,7 +55,6 @@ export async function beaconHandler(args: IBeaconArgs & IGlobalArgs): Promise<vo
};

if (ACTIVE_PRESET === PresetName.minimal) logger.info("ACTIVE_PRESET == minimal preset");
logger.debug(`chain config: ${JSON.stringify(chainConfigToJson(config))}`);

// additional metrics registries
const metricsRegistries: Registry[] = [];
Expand Down
2 changes: 0 additions & 2 deletions packages/cli/src/cmds/validator/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
BuilderSelection,
} from "@lodestar/validator";
import {getMetrics, MetricsRegister} from "@lodestar/validator";
import {chainConfigToJson} from "@lodestar/config";
import {RegistryMetricCreator, collectNodeJSMetrics, HttpMetricsServer} from "@lodestar/beacon-node";
import {getBeaconConfigFromArgs} from "../../config/index.js";
import {IGlobalArgs} from "../../options/index.js";
Expand Down Expand Up @@ -53,7 +52,6 @@ export async function validatorHandler(args: IValidatorCliArgs & IGlobalArgs): P
const {version, commit} = getVersionData();
logger.info("Lodestar", {network, version, commit});
logger.info("Connecting to LevelDB database", {path: validatorPaths.validatorsDbDir});
logger.debug(`chain config: ${JSON.stringify(chainConfigToJson(config))}`);

const dbPath = validatorPaths.validatorsDbDir;
mkdir(dbPath);
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/test/utils/simulation/EpochClock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ export class EpochClock {
return Math.floor(Date.now() / MS_IN_SEC - this.genesisTime);
}

msToGenesis(): number {
return this.genesisTime * 1000 - Date.now();
}

get currentSlot(): number {
return this.getSlotFor();
}
Expand Down Expand Up @@ -71,6 +67,10 @@ export class EpochClock {
return this.genesisTime + slotGenesisTimeOffset;
}

msToGenesis(): number {
return this.genesisTime * 1000 - Date.now();
}

isFirstSlotOfEpoch(slot: number): boolean {
return slot % this.slotsPerEpoch === 0;
}
Expand Down
1 change: 1 addition & 0 deletions packages/cli/test/utils/simulation/SimulationTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export class SimulationTracker {
this.initEventStreamForNode(node);
}
this.reporter.bootstrap();

// Start clock loop on current slot or genesis
this.clockLoop(Math.max(this.clock.currentSlot, 0)).catch((e) => {
console.error("error on clockLoop", e);
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/utils/simulation/utils/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export async function waitForSlot(

for (const node of nodes) {
const head = await node.cl.api.beacon.getBlockHeader("head");
const headSlot = head.data.header.message.slot;
const headSlot = head.response.data.header.message.slot;
if (headSlot > slot) {
throw Error(`waitForSlot error, node ${node.id} head.slot ${headSlot} > target slot ${slot}`);
}
Expand Down
2 changes: 0 additions & 2 deletions packages/state-transition/src/stateTransition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ export type StateTransitionOpts = BlockExternalData &
verifyStateRoot?: boolean;
verifyProposer?: boolean;
verifySignatures?: boolean;
// TODO EIP-4844: Merge this options with ProcessBlockOpts
disabledWithdrawals?: boolean;
};

/**
Expand Down

0 comments on commit eeae7a4

Please sign in to comment.