Skip to content

Commit

Permalink
Update outdated dependencies (#5345)
Browse files Browse the repository at this point in the history
* Update outdated dependencies

* Fix the js-yaml schema issue

* Fix some types issue in the tests

* Fix unit tests

* Fix logger format errors
  • Loading branch information
nazarhussain authored Apr 6, 2023
1 parent 7979491 commit 83b29d7
Show file tree
Hide file tree
Showing 35 changed files with 967 additions and 681 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"devDependencies": {
"@chainsafe/eslint-plugin-node": "^11.2.3",
"@dapplion/benchmark": "^0.2.2",
"@dapplion/benchmark": "^0.2.4",
"@types/chai": "^4.3.4",
"@types/chai-as-promised": "^7.1.5",
"@types/mocha": "^10.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
},
"dependencies": {
"@chainsafe/persistent-merkle-tree": "^0.5.0",
"@chainsafe/ssz": "^0.10.1",
"@chainsafe/ssz": "^0.10.2",
"@lodestar/config": "^1.6.0",
"@lodestar/params": "^1.6.0",
"@lodestar/types": "^1.6.0",
Expand All @@ -81,7 +81,7 @@
"devDependencies": {
"@types/eventsource": "^1.1.11",
"@types/qs": "^6.9.7",
"ajv": "^8.11.0",
"ajv": "^8.12.0",
"fastify": "3.29.4"
},
"peerDependencies": {
Expand Down
47 changes: 23 additions & 24 deletions packages/beacon-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,23 @@
"@chainsafe/bls": "7.1.1",
"@chainsafe/discv5": "^3.0.0",
"@chainsafe/libp2p-gossipsub": "^6.2.0",
"@chainsafe/libp2p-noise": "^11.0.0",
"@chainsafe/libp2p-noise": "^11.0.4",
"@chainsafe/persistent-merkle-tree": "^0.5.0",
"@chainsafe/snappy-stream": "^5.1.2",
"@chainsafe/ssz": "^0.10.1",
"@chainsafe/ssz": "^0.10.2",
"@chainsafe/threads": "^1.10.0",
"@ethersproject/abi": "^5.0.0",
"@libp2p/bootstrap": "^6.0.0",
"@ethersproject/abi": "^5.7.0",
"@libp2p/bootstrap": "^6.0.3",
"@libp2p/interface-connection": "^3.0.2",
"@libp2p/interface-connection-manager": "^1.3.0",
"@libp2p/interface-peer-id": "^2.0.1",
"@libp2p/interface-pubsub": "^3.0.0",
"@libp2p/interface-registrar": "^2.0.8",
"@libp2p/mdns": "^6.0.0",
"@libp2p/mplex": "^7.1.0",
"@libp2p/mplex": "^7.1.3",
"@libp2p/peer-id-factory": "^2.0.1",
"@libp2p/prometheus-metrics": "^1.1.2",
"@libp2p/tcp": "^6.1.0",
"@libp2p/prometheus-metrics": "^1.1.3",
"@libp2p/tcp": "6.1.0",
"@lodestar/api": "^1.6.0",
"@lodestar/config": "^1.6.0",
"@lodestar/db": "^1.6.0",
Expand All @@ -135,44 +135,43 @@
"cross-fetch": "^3.1.4",
"datastore-core": "^8.0.1",
"datastore-level": "^9.0.1",
"deepmerge": "^3.2.0",
"deepmerge": "^4.3.1",
"fastify": "3.29.4",
"fastify-bearer-auth": "6.1.0",
"fastify-cors": "^6.0.1",
"@fastify/bearer-auth": "^7.0.0",
"@fastify/cors": "^7.0.0",
"gc-stats": "^1.4.0",
"interface-datastore": "^7.0.0",
"it-all": "^2.0.0",
"it-all": "^3.0.1",
"it-pipe": "^2.0.5",
"jwt-simple": "0.5.6",
"libp2p": "0.42.2",
"prom-client": "^14.2.0",
"prometheus-gc-stats": "^0.6.3",
"prometheus-gc-stats": "^0.6.4",
"qs": "^6.11.1",
"snappyjs": "^0.7.0",
"stream-to-it": "^0.2.0",
"stream-to-it": "^0.2.4",
"strict-event-emitter-types": "^2.0.0",
"systeminformation": "^5.17.9",
"uint8arraylist": "^2.3.2",
"uint8arrays": "^4.0.2",
"systeminformation": "^5.17.12",
"uint8arraylist": "^2.4.3",
"uint8arrays": "^4.0.3",
"varint": "^6.0.0",
"xxhash-wasm": "1.0.1"
"xxhash-wasm": "1.0.2"
},
"peerDependencies": {
"c-kzg": "^1.0.7"
},
"devDependencies": {
"@types/bl": "^5.0.1",
"@types/eventsource": "^1.1.11",
"@types/leveldown": "^4.0.2",
"@types/prometheus-gc-stats": "^0.6.1",
"@types/leveldown": "^4.0.3",
"@types/prometheus-gc-stats": "^0.6.2",
"@types/qs": "^6.9.7",
"@types/supertest": "^2.0.12",
"@types/tmp": "^0.2.0",
"@types/varint": "^6.0.0",
"@types/tmp": "^0.2.3",
"@types/varint": "^6.0.1",
"eventsource": "^2.0.2",
"leveldown": "^6.1.1",
"rewiremock": "^3.14.3",
"rimraf": "^3.0.2",
"rewiremock": "^3.14.5",
"rimraf": "^4.4.1",
"tmp": "^0.2.1"
},
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions packages/beacon-node/src/api/rest/base.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import qs from "qs";
import fastify, {FastifyError, FastifyInstance} from "fastify";
import fastifyCors from "fastify-cors";
import bearerAuthPlugin from "fastify-bearer-auth";
import fastifyCors from "@fastify/cors";
import bearerAuthPlugin from "@fastify/bearer-auth";
import {RouteConfig} from "@lodestar/api/beacon/server";
import {ErrorAborted, Logger} from "@lodestar/utils";
import {isLocalhostIP} from "../../util/ip.js";
Expand Down
40 changes: 19 additions & 21 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
"@chainsafe/bls-keystore": "^2.0.0",
"@chainsafe/blst": "^0.2.8",
"@chainsafe/discv5": "^3.0.0",
"@chainsafe/ssz": "^0.10.1",
"@libp2p/peer-id-factory": "^2.0.1",
"@chainsafe/ssz": "^0.10.2",
"@libp2p/peer-id-factory": "^2.0.3",
"@lodestar/api": "^1.6.0",
"@lodestar/beacon-node": "^1.6.0",
"@lodestar/config": "^1.6.0",
Expand All @@ -72,34 +72,32 @@
"@lodestar/utils": "^1.6.0",
"@lodestar/validator": "^1.6.0",
"@multiformats/multiaddr": "^11.0.0",
"@types/lockfile": "^1.0.1",
"bip39": "^3.0.2",
"deepmerge": "^4.2.2",
"@types/lockfile": "^1.0.2",
"bip39": "^3.1.0",
"deepmerge": "^4.3.1",
"ethers": "^5.0.2",
"expand-tilde": "^2.0.2",
"find-up": "^5.0.0",
"got": "^12.1.0",
"inquirer": "^8.1.3",
"js-yaml": "^3.14.0",
"find-up": "^6.3.0",
"got": "12.4.1",
"inquirer": "^9.1.5",
"js-yaml": "^4.1.0",
"lockfile": "^1.0.4",
"lodash": "^4.17.15",
"lodash": "^4.17.21",
"prom-client": "^14.2.0",
"rimraf": "^3.0.0",
"source-map-support": "^0.5.19",
"rimraf": "^4.4.1",
"source-map-support": "^0.5.21",
"uint8arrays": "^4.0.3",
"uuidv4": "^6.1.1",
"winston": "^3.3.3",
"winston-daily-rotate-file": "^4.5.5",
"winston-transport": "^4.3.0",
"uuidv4": "^6.2.13",
"winston": "^3.8.2",
"winston-daily-rotate-file": "^4.7.1",
"winston-transport": "^4.5.0",
"yargs": "^16.1.0"
},
"devDependencies": {
"@types/expand-tilde": "^2.0.0",
"@types/got": "^9.6.11",
"@types/inquirer": "^8.2.3",
"@types/js-yaml": "^3.12.5",
"@types/lodash": "^4.14.157",
"@types/rimraf": "^3.0.2",
"@types/got": "^9.6.12",
"@types/inquirer": "^9.0.3",
"@types/lodash": "^4.14.192",
"@types/yargs": "^15.0.9"
}
}
11 changes: 5 additions & 6 deletions packages/cli/src/cmds/dev/handler.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import fs from "node:fs";
import {promisify} from "node:util";
import rimraf from "rimraf";
import {rimraf} from "rimraf";
import {toHex, fromHex} from "@lodestar/utils";
import {nodeUtils} from "@lodestar/beacon-node";
import {GlobalArgs} from "../../options/index.js";
Expand Down Expand Up @@ -38,17 +37,17 @@ export async function devHandler(args: IDevArgs & GlobalArgs): Promise<void> {
// Remove slashing protection db. Otherwise the validators won't be able to propose nor attest
// until the clock reach a higher slot than the previous run of the dev command
if (args.genesisTime === undefined) {
await promisify(rimraf)(beaconDbDir);
await promisify(rimraf)(validatorsDbDir);
await rimraf(beaconDbDir);
await rimraf(validatorsDbDir);
}

mkdir(beaconDbDir);
mkdir(validatorsDbDir);

if (args.reset) {
onGracefulShutdown(async () => {
await promisify(rimraf)(beaconDbDir);
await promisify(rimraf)(validatorsDbDir);
await rimraf(beaconDbDir);
await rimraf(validatorsDbDir);
});
}

Expand Down
5 changes: 2 additions & 3 deletions packages/cli/src/util/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import stream from "node:stream";
import {promisify} from "node:util";
import got from "got";
import yaml from "js-yaml";
const {load, dump, FAILSAFE_SCHEMA, Schema, Type} = yaml;
const {load, dump, FAILSAFE_SCHEMA, Type} = yaml;

import {mkdir} from "./fs.js";

export const yamlSchema = new Schema({
include: [FAILSAFE_SCHEMA],
export const yamlSchema = FAILSAFE_SCHEMA.extend({
implicit: [
new Type("tag:yaml.org,2002:str", {
kind: "scalar",
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/util/version.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from "node:fs";
import path from "node:path";
import {fileURLToPath} from "node:url";
import findUp from "find-up";
import {findUpSync} from "find-up";
import {readAndGetGitData} from "./gitData/index.js";

// Global variable __dirname no longer available in ES6 modules.
Expand Down Expand Up @@ -58,7 +58,7 @@ export function getVersionData(): {

/** Read version information from lerna.json */
function readVersionFromLernaJson(): string | undefined {
const filePath = findUp.sync("lerna.json", {cwd: __dirname});
const filePath = findUpSync("lerna.json", {cwd: __dirname});
if (!filePath) return undefined;

const lernaJson = JSON.parse(fs.readFileSync(filePath, "utf8")) as VersionJson;
Expand All @@ -67,7 +67,7 @@ function readVersionFromLernaJson(): string | undefined {

/** Read version information from package.json */
function readCliPackageJson(): string | undefined {
const filePath = findUp.sync("package.json", {cwd: __dirname});
const filePath = findUpSync("package.json", {cwd: __dirname});
if (!filePath) return undefined;

const packageJson = JSON.parse(fs.readFileSync(filePath, "utf8")) as VersionJson;
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/test/unit/util/gitData.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from "node:fs";
import path from "node:path";
import {fileURLToPath} from "node:url";
import {expect} from "chai";
import findUp from "find-up";
import {findUpSync} from "find-up";
import {gitDataPath, readGitDataFile} from "../../../src/util/gitData/gitDataPath.js";
import {getGitData} from "../../../src/util/index.js";

Expand All @@ -24,7 +24,7 @@ describe("util / gitData", function () {
});

it("gitData path must be included in the package.json", () => {
const pkgJsonPath = findUp.sync("package.json", {cwd: __dirname});
const pkgJsonPath = findUpSync("package.json", {cwd: __dirname});
if (!pkgJsonPath) {
throw Error("No package.json found");
}
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/test/unit/util/loggerTransport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("winston logger format and options", () => {
context: {meta: "data"},
output: {
human: "[] \u001b[33mwarn\u001b[39m: foo bar meta=data",
json: `{"message":"foo bar","context":{"meta":"data"},"level":"warn","module":""}`,
json: `{"context":{"meta":"data"},"level":"warn","message":"foo bar","module":""}`,
},
},

Expand All @@ -32,7 +32,7 @@ describe("winston logger format and options", () => {
context: {data: BigInt(1)},
output: {
human: "[] \u001b[33mwarn\u001b[39m: big int data=1",
json: `{"message":"big int","context":{"data":"1"},"level":"warn","module":""}`,
json: `{"context":{"data":"1"},"level":"warn","message":"big int","module":""}`,
},
},

Expand All @@ -46,7 +46,7 @@ describe("winston logger format and options", () => {
error: error,
output: {
human: `[] \u001b[33mwarn\u001b[39m: foo bar code=SAMPLE_ERROR, data=foo=bar\n${error.stack}`,
json: `{"message":"foo bar","error":{"code":"SAMPLE_ERROR","data":{"foo":"bar"},"stack":"$STACK"},"level":"warn","module":""}`,
json: `{"error":{"code":"SAMPLE_ERROR","data":{"foo":"bar"},"stack":"$STACK"},"level":"warn","message":"foo bar","module":""}`,
},
};
},
Expand All @@ -65,7 +65,7 @@ describe("winston logger format and options", () => {

logger.warn(message, context, error);

expect(stdoutHook.chunks.join("").trim()).to.equal(output[format]);
expect(stdoutHook.chunks.join("").trim()).to.deep.equal(output[format]);

stdoutHook.restore();
});
Expand Down
2 changes: 1 addition & 1 deletion packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"blockchain"
],
"dependencies": {
"@chainsafe/ssz": "^0.10.1",
"@chainsafe/ssz": "^0.10.2",
"@lodestar/params": "^1.6.0",
"@lodestar/types": "^1.6.0"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
"check-readme": "typescript-docs-verifier"
},
"dependencies": {
"@chainsafe/ssz": "^0.10.1",
"@chainsafe/ssz": "^0.10.2",
"@lodestar/config": "^1.6.0",
"@lodestar/utils": "^1.6.0",
"@types/levelup": "^4.3.3",
"it-all": "^2.0.0",
"it-all": "^3.0.1",
"level": "^8.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/flare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@lodestar/config": "^1.6.0",
"@lodestar/state-transition": "^1.6.0",
"@lodestar/types": "^1.6.0",
"source-map-support": "^0.5.19",
"source-map-support": "^0.5.21",
"yargs": "^16.1.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/fork-choice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"check-readme": "typescript-docs-verifier"
},
"dependencies": {
"@chainsafe/ssz": "^0.10.1",
"@chainsafe/ssz": "^0.10.2",
"@lodestar/config": "^1.6.0",
"@lodestar/params": "^1.6.0",
"@lodestar/state-transition": "^1.6.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/light-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"dependencies": {
"@chainsafe/bls": "7.1.1",
"@chainsafe/persistent-merkle-tree": "^0.5.0",
"@chainsafe/ssz": "^0.10.1",
"@chainsafe/ssz": "^0.10.2",
"@lodestar/api": "^1.6.0",
"@lodestar/config": "^1.6.0",
"@lodestar/params": "^1.6.0",
Expand All @@ -80,7 +80,7 @@
"@chainsafe/as-sha256": "^0.3.1",
"@types/qs": "^6.9.7",
"qs": "^6.11.1",
"uint8arrays": "^4.0.2"
"uint8arrays": "^4.0.3"
},
"keywords": [
"ethereum",
Expand Down
2 changes: 1 addition & 1 deletion packages/light-client/test/utils/server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import qs from "qs";
import fastify, {FastifyInstance} from "fastify";
import fastifyCors from "fastify-cors";
import fastifyCors from "@fastify/cors";
import {Api, ServerApi} from "@lodestar/api";
import {registerRoutes} from "@lodestar/api/beacon/server";
import {ChainForkConfig} from "@lodestar/config";
Expand Down
4 changes: 2 additions & 2 deletions packages/params/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
"blockchain"
],
"devDependencies": {
"@types/js-yaml": "^4.0.3",
"axios": "^0.21.0",
"@types/js-yaml": "^4.0.5",
"axios": "^1.3.4",
"js-yaml": "^4.1.0"
}
}
Loading

0 comments on commit 83b29d7

Please sign in to comment.