Skip to content

Commit

Permalink
chore: v1.9.2 release (#5767)
Browse files Browse the repository at this point in the history
  • Loading branch information
philknows authored Jul 18, 2023
2 parents 6845eec + 828bbaa commit 72beda1
Show file tree
Hide file tree
Showing 24 changed files with 198 additions and 106 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"npmClient": "yarn",
"useWorkspaces": true,
"useNx": true,
"version": "1.9.1",
"version": "1.9.2",
"stream": "true",
"command": {
"version": {
Expand Down
10 changes: 5 additions & 5 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"bugs": {
"url": "https://github.com/ChainSafe/lodestar/issues"
},
"version": "1.9.1",
"version": "1.9.2",
"type": "module",
"exports": {
".": {
Expand Down Expand Up @@ -71,10 +71,10 @@
"dependencies": {
"@chainsafe/persistent-merkle-tree": "^0.5.0",
"@chainsafe/ssz": "^0.10.2",
"@lodestar/config": "^1.9.1",
"@lodestar/params": "^1.9.1",
"@lodestar/types": "^1.9.1",
"@lodestar/utils": "^1.9.1",
"@lodestar/config": "^1.9.2",
"@lodestar/params": "^1.9.2",
"@lodestar/types": "^1.9.2",
"@lodestar/utils": "^1.9.2",
"cross-fetch": "^3.1.4",
"eventsource": "^2.0.2",
"qs": "^6.11.1"
Expand Down
26 changes: 13 additions & 13 deletions packages/beacon-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"bugs": {
"url": "https://github.com/ChainSafe/lodestar/issues"
},
"version": "1.9.1",
"version": "1.9.2",
"type": "module",
"exports": {
".": {
Expand Down Expand Up @@ -118,18 +118,18 @@
"@libp2p/peer-id-factory": "^2.0.1",
"@libp2p/prometheus-metrics": "^1.1.3",
"@libp2p/tcp": "6.1.0",
"@lodestar/api": "^1.9.1",
"@lodestar/config": "^1.9.1",
"@lodestar/db": "^1.9.1",
"@lodestar/fork-choice": "^1.9.1",
"@lodestar/light-client": "^1.9.1",
"@lodestar/logger": "^1.9.1",
"@lodestar/params": "^1.9.1",
"@lodestar/reqresp": "^1.9.1",
"@lodestar/state-transition": "^1.9.1",
"@lodestar/types": "^1.9.1",
"@lodestar/utils": "^1.9.1",
"@lodestar/validator": "^1.9.1",
"@lodestar/api": "^1.9.2",
"@lodestar/config": "^1.9.2",
"@lodestar/db": "^1.9.2",
"@lodestar/fork-choice": "^1.9.2",
"@lodestar/light-client": "^1.9.2",
"@lodestar/logger": "^1.9.2",
"@lodestar/params": "^1.9.2",
"@lodestar/reqresp": "^1.9.2",
"@lodestar/state-transition": "^1.9.2",
"@lodestar/types": "^1.9.2",
"@lodestar/utils": "^1.9.2",
"@lodestar/validator": "^1.9.2",
"@multiformats/multiaddr": "^11.0.0",
"@types/datastore-level": "^3.0.0",
"buffer-xor": "^2.0.2",
Expand Down
6 changes: 4 additions & 2 deletions packages/beacon-node/src/sync/unknownBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,23 @@ export class UnknownBlockSync {
if (!this.opts?.disableUnknownBlockSync) {
// cannot chain to the above if or the log will be incorrect
if (!this.subscribedToNetworkEvents) {
this.logger.debug("UnknownBlockSync enabled.");
this.logger.verbose("UnknownBlockSync enabled.");
this.network.events.on(NetworkEvent.unknownBlock, this.onUnknownBlock);
this.network.events.on(NetworkEvent.unknownBlockParent, this.onUnknownParent);
this.network.events.on(NetworkEvent.peerConnected, this.triggerUnknownBlockSearch);
this.subscribedToNetworkEvents = true;
}
} else {
this.logger.debug("UnknownBlockSync disabled.");
this.logger.verbose("UnknownBlockSync disabled by disableUnknownBlockSync option.");
}
}

unsubscribeFromNetwork(): void {
this.logger.verbose("UnknownBlockSync disabled.");
this.network.events.off(NetworkEvent.unknownBlock, this.onUnknownBlock);
this.network.events.off(NetworkEvent.unknownBlockParent, this.onUnknownParent);
this.network.events.off(NetworkEvent.peerConnected, this.triggerUnknownBlockSearch);
this.subscribedToNetworkEvents = false;
}

close(): void {
Expand Down
67 changes: 63 additions & 4 deletions packages/beacon-node/test/unit/sync/unknownBlock.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import EventEmitter from "node:events";
import {expect} from "chai";
import sinon from "sinon";
import sinon, {SinonStubbedInstance} from "sinon";
import {toHexString} from "@chainsafe/ssz";
import {config as minimalConfig} from "@lodestar/config/default";
import {createChainForkConfig} from "@lodestar/config";
import {IForkChoice, ProtoBlock} from "@lodestar/fork-choice";
import {ssz} from "@lodestar/types";
import {notNullish, sleep} from "@lodestar/utils";
import {toHexString} from "@chainsafe/ssz";
import {IBeaconChain} from "../../../src/chain/index.js";
import {BeaconChain, IBeaconChain} from "../../../src/chain/index.js";
import {INetwork, NetworkEvent, NetworkEventBus, PeerAction} from "../../../src/network/index.js";
import {UnknownBlockSync} from "../../../src/sync/unknownBlock.js";
import {testLogger} from "../../utils/logger.js";
Expand All @@ -17,7 +18,7 @@ import {SeenBlockProposers} from "../../../src/chain/seenCache/seenBlockProposer
import {BlockError, BlockErrorCode} from "../../../src/chain/errors/blockError.js";
import {defaultSyncOptions} from "../../../src/sync/options.js";

describe("sync / UnknownBlockSync", () => {
describe("sync by UnknownBlockSync", () => {
const logger = testLogger();
const sandbox = sinon.createSandbox();
const slotSec = 0.3;
Expand Down Expand Up @@ -226,3 +227,61 @@ describe("sync / UnknownBlockSync", () => {
});
}
});

describe("UnknownBlockSync", function () {
const sandbox = sinon.createSandbox();
let network: INetwork;
let chain: SinonStubbedInstance<BeaconChain> & IBeaconChain;
const logger = testLogger();
let service: UnknownBlockSync;

beforeEach(() => {
network = {
events: new NetworkEventBus(),
} as Partial<INetwork> as INetwork;
chain = sandbox.createStubInstance(BeaconChain);
});

afterEach(() => {
sandbox.restore();
});

const testCases: {actions: boolean[]; expected: boolean}[] = [
// true = subscribe, false = unsubscribe
// expected = isSubscribed
{actions: [false, true], expected: true},
{actions: [false, true, true], expected: true},
{actions: [true, false, true], expected: true},
{actions: [true, true, true], expected: true},
{actions: [true, false, false, true], expected: true},
{actions: [true, false], expected: false},
{actions: [true, false, false], expected: false},
];

describe("subscribe and unsubscribe multiple times", () => {
for (const {actions, expected} of testCases) {
const testName = actions.map((action) => (action ? "subscribe" : "unsubscribe")).join(" - ");
it(testName, () => {
const events = network.events as EventEmitter;
service = new UnknownBlockSync(minimalConfig, network, chain, logger, null, defaultSyncOptions);
for (const action of actions) {
if (action) {
service.subscribeToNetwork();
} else {
service.unsubscribeFromNetwork();
}
}

if (expected) {
expect(events.listenerCount(NetworkEvent.unknownBlock)).to.be.equal(1);
expect(events.listenerCount(NetworkEvent.unknownBlockParent)).to.be.equal(1);
expect(service.isSubscribedToNetwork()).to.be.true;
} else {
expect(events.listenerCount(NetworkEvent.unknownBlock)).to.be.equal(0);
expect(events.listenerCount(NetworkEvent.unknownBlockParent)).to.be.equal(0);
expect(service.isSubscribedToNetwork()).to.be.false;
}
});
}
});
});
24 changes: 12 additions & 12 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@chainsafe/lodestar",
"version": "1.9.1",
"version": "1.9.2",
"description": "Command line interface for lodestar",
"author": "ChainSafe Systems",
"license": "LGPL-3.0",
Expand Down Expand Up @@ -60,17 +60,17 @@
"@chainsafe/discv5": "^3.0.0",
"@chainsafe/ssz": "^0.10.2",
"@libp2p/peer-id-factory": "^2.0.3",
"@lodestar/api": "^1.9.1",
"@lodestar/beacon-node": "^1.9.1",
"@lodestar/config": "^1.9.1",
"@lodestar/db": "^1.9.1",
"@lodestar/light-client": "^1.9.1",
"@lodestar/logger": "^1.9.1",
"@lodestar/params": "^1.9.1",
"@lodestar/state-transition": "^1.9.1",
"@lodestar/types": "^1.9.1",
"@lodestar/utils": "^1.9.1",
"@lodestar/validator": "^1.9.1",
"@lodestar/api": "^1.9.2",
"@lodestar/beacon-node": "^1.9.2",
"@lodestar/config": "^1.9.2",
"@lodestar/db": "^1.9.2",
"@lodestar/light-client": "^1.9.2",
"@lodestar/logger": "^1.9.2",
"@lodestar/params": "^1.9.2",
"@lodestar/state-transition": "^1.9.2",
"@lodestar/types": "^1.9.2",
"@lodestar/utils": "^1.9.2",
"@lodestar/validator": "^1.9.2",
"@multiformats/multiaddr": "^11.0.0",
"@types/lockfile": "^1.0.2",
"bip39": "^3.1.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/cmds/validator/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ function parseBuilderSelection(builderSelection?: string): BuilderSelection | un
break;
case "builderalways":
break;
case "builderonly":
break;
default:
throw Error("Invalid input for builder selection, check help.");
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/cmds/validator/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export const validatorOptions: CliCommandOptions<IValidatorCliArgs> = {

"builder.selection": {
type: "string",
description: "Default builder block selection strategy: maxprofit or builderalways",
description: "Default builder block selection strategy: maxprofit, builderalways, or builderonly",
defaultDescription: `${defaultOptions.builderSelection}`,
group: "builder",
},
Expand Down
6 changes: 3 additions & 3 deletions packages/config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lodestar/config",
"version": "1.9.1",
"version": "1.9.2",
"description": "Chain configuration required for lodestar",
"author": "ChainSafe Systems",
"license": "Apache-2.0",
Expand Down Expand Up @@ -65,7 +65,7 @@
],
"dependencies": {
"@chainsafe/ssz": "^0.10.2",
"@lodestar/params": "^1.9.1",
"@lodestar/types": "^1.9.1"
"@lodestar/params": "^1.9.2",
"@lodestar/types": "^1.9.2"
}
}
8 changes: 4 additions & 4 deletions packages/db/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lodestar/db",
"version": "1.9.1",
"version": "1.9.2",
"description": "DB modules of Lodestar",
"author": "ChainSafe Systems",
"homepage": "https://github.com/ChainSafe/lodestar#readme",
Expand Down Expand Up @@ -38,13 +38,13 @@
},
"dependencies": {
"@chainsafe/ssz": "^0.10.2",
"@lodestar/config": "^1.9.1",
"@lodestar/utils": "^1.9.1",
"@lodestar/config": "^1.9.2",
"@lodestar/utils": "^1.9.2",
"@types/levelup": "^4.3.3",
"it-all": "^3.0.1",
"level": "^8.0.0"
},
"devDependencies": {
"@lodestar/logger": "^1.9.1"
"@lodestar/logger": "^1.9.2"
}
}
10 changes: 5 additions & 5 deletions packages/flare/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lodestar/flare",
"version": "1.9.1",
"version": "1.9.2",
"description": "Beacon chain debugging tool",
"author": "ChainSafe Systems",
"license": "Apache-2.0",
Expand Down Expand Up @@ -58,10 +58,10 @@
"blockchain"
],
"dependencies": {
"@lodestar/api": "^1.9.1",
"@lodestar/config": "^1.9.1",
"@lodestar/state-transition": "^1.9.1",
"@lodestar/types": "^1.9.1",
"@lodestar/api": "^1.9.2",
"@lodestar/config": "^1.9.2",
"@lodestar/state-transition": "^1.9.2",
"@lodestar/types": "^1.9.2",
"source-map-support": "^0.5.21",
"yargs": "^17.7.1"
},
Expand Down
12 changes: 6 additions & 6 deletions packages/fork-choice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"bugs": {
"url": "https://github.com/ChainSafe/lodestar/issues"
},
"version": "1.9.1",
"version": "1.9.2",
"type": "module",
"exports": "./lib/index.js",
"types": "./lib/index.d.ts",
Expand Down Expand Up @@ -39,11 +39,11 @@
},
"dependencies": {
"@chainsafe/ssz": "^0.10.2",
"@lodestar/config": "^1.9.1",
"@lodestar/params": "^1.9.1",
"@lodestar/state-transition": "^1.9.1",
"@lodestar/types": "^1.9.1",
"@lodestar/utils": "^1.9.1"
"@lodestar/config": "^1.9.2",
"@lodestar/params": "^1.9.2",
"@lodestar/state-transition": "^1.9.2",
"@lodestar/types": "^1.9.2",
"@lodestar/utils": "^1.9.2"
},
"keywords": [
"ethereum",
Expand Down
14 changes: 7 additions & 7 deletions packages/light-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"bugs": {
"url": "https://github.com/ChainSafe/lodestar/issues"
},
"version": "1.9.1",
"version": "1.9.2",
"type": "module",
"exports": {
".": {
Expand Down Expand Up @@ -67,12 +67,12 @@
"@chainsafe/bls": "7.1.1",
"@chainsafe/persistent-merkle-tree": "^0.5.0",
"@chainsafe/ssz": "^0.10.2",
"@lodestar/api": "^1.9.1",
"@lodestar/config": "^1.9.1",
"@lodestar/params": "^1.9.1",
"@lodestar/state-transition": "^1.9.1",
"@lodestar/types": "^1.9.1",
"@lodestar/utils": "^1.9.1",
"@lodestar/api": "^1.9.2",
"@lodestar/config": "^1.9.2",
"@lodestar/params": "^1.9.2",
"@lodestar/state-transition": "^1.9.2",
"@lodestar/types": "^1.9.2",
"@lodestar/utils": "^1.9.2",
"cross-fetch": "^3.1.4",
"mitt": "^3.0.0",
"strict-event-emitter-types": "^2.0.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"bugs": {
"url": "https://github.com/ChainSafe/lodestar/issues"
},
"version": "1.9.1",
"version": "1.9.2",
"type": "module",
"exports": {
".": {
Expand Down Expand Up @@ -61,7 +61,7 @@
},
"types": "lib/index.d.ts",
"dependencies": {
"@lodestar/utils": "^1.9.1",
"@lodestar/utils": "^1.9.2",
"winston": "^3.8.2",
"winston-daily-rotate-file": "^4.7.1",
"winston-transport": "^4.5.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/params/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lodestar/params",
"version": "1.9.1",
"version": "1.9.2",
"description": "Chain parameters required for lodestar",
"author": "ChainSafe Systems",
"license": "Apache-2.0",
Expand Down
Loading

0 comments on commit 72beda1

Please sign in to comment.