Skip to content

Conversation

@wemeetagain
Copy link
Member

@wemeetagain wemeetagain commented Feb 9, 2026

  • update all dependencies (breaking change)
  • update build/lint/test tooling
  • most of the changes are lint rule updates
  • the rest of the changes are dependency updates eg multiaddr changes

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR performs a breaking dependency/tooling refresh across the monorepo, including updating TypeScript module resolution to nodenext, migrating tests from Mocha/Chai to Vitest, switching linting/formatting to Biome, and adapting ENR/discv5 code to newer @multiformats/multiaddr APIs.

Changes:

  • Tooling migration: ESLint/Prettier/Mocha configs removed; Biome + Vitest added/used.
  • TypeScript config updates: module/moduleResolution moved to nodenext, and legacy typeRoots overrides removed.
  • Runtime/API updates: multiaddr-related logic updated for @multiformats/multiaddr@13 (components/registry usage) across @chainsafe/enr and @chainsafe/discv5.

Reviewed changes

Copilot reviewed 73 out of 77 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
types/bcrypto/index.d.ts Removes custom bcrypto typings.
tsconfig.json Switches TS module settings to nodenext and removes custom typeRoots.
packages/enr/tsconfig.json Aligns ENR package TS settings with nodenext.
packages/enr/test/unit/enr.test.ts Migrates ENR unit tests from Mocha/Chai to Vitest and updates multiaddr API usage.
packages/enr/src/util.ts Type-only import cleanup and formatting changes.
packages/enr/src/peerId.ts Adjusts imports/types; parameter renamed to _type.
packages/enr/src/index.ts Reorders exports.
packages/enr/src/enr.ts Updates RLP import usage + refactors multiaddr parsing/creation for new API.
packages/enr/src/defaultCrypto.ts Type-only import cleanup and formatting changes.
packages/enr/src/crypto.ts Type-only import cleanup and formatting changes.
packages/enr/package.json Updates dependencies and switches unit test runner to Vitest; adds src to published files.
packages/enr/bench/index.bench.ts Migrates benchmarks to @chainsafe/benchmark and libp2p keygen changes.
packages/enr/.mocharc.yaml Removes Mocha configuration.
packages/enr/.bench.yaml Removes benchmark config file.
packages/discv5/tsconfig.json Aligns discv5 package TS settings with nodenext and removes custom typeRoots.
packages/discv5/test/unit/util/timeoutMap.test.ts Migrates to Vitest.
packages/discv5/test/unit/util/ip.test.ts Migrates to Vitest and updates multiaddr API usage.
packages/discv5/test/unit/transport/udp.test.ts Migrates to Vitest and updates packet header field ordering.
packages/discv5/test/unit/session/service.test.ts Migrates to Vitest and updates formatting/type-only imports.
packages/discv5/test/unit/session/crypto.test.ts Migrates to Vitest; updates noble hash import paths.
packages/discv5/test/unit/service/service.test.ts Migrates to Vitest; updates libp2p key handling + multiaddr API usage.
packages/discv5/test/unit/service/addrVotes.test.ts Migrates to Vitest and type-only imports.
packages/discv5/test/unit/rateLimit/rateLimiterGRCA.test.ts Migrates to Vitest and formatting changes.
packages/discv5/test/unit/message/codec.test.ts Migrates to Vitest and formatting changes.
packages/discv5/test/unit/kademlia/util.test.ts Migrates to Vitest; updates noble hash import paths.
packages/discv5/test/unit/kademlia/kademlia.test.ts Migrates to Vitest; updates imports/types.
packages/discv5/test/e2e/mainnetBootnodes.test.ts Migrates to Vitest; updates bootnode list/comments and skips logic.
packages/discv5/test/e2e/connect.test.ts Migrates to Vitest and adjusts typing/catch blocks.
packages/discv5/src/util/timeoutMap.ts Minor visibility change and formatting.
packages/discv5/src/util/ip.ts Refactors multiaddr parsing and adds multiaddrToObject helper for UDP bind/send.
packages/discv5/src/util/index.ts Reorders util exports.
packages/discv5/src/util/crypto.ts Updates noble/secp256k1 + hash wiring for newer APIs.
packages/discv5/src/transport/udp.ts Uses multiaddrToObject instead of toOptions(); updates imports and formatting.
packages/discv5/src/transport/types.ts Type-only import cleanup and formatting.
packages/discv5/src/session/types.ts Gives explicit numeric enum values; formatting/type-only imports.
packages/discv5/src/session/session.ts Refactors imports/formatting; minor logic cleanups.
packages/discv5/src/session/service.ts Refactors imports and formatting; introduces multiaddrToObject usage.
packages/discv5/src/session/nodeInfo.ts Uses multiaddrToObject and component parsing for peer id extraction.
packages/discv5/src/session/index.ts Reorders exports.
packages/discv5/src/session/crypto.ts Type-only import cleanup and formatting.
packages/discv5/src/service/types.ts Type-only import cleanup; formatting and explicit enum values.
packages/discv5/src/service/service.ts Broad refactor/formatting; updates metrics collectors and various callsites for new APIs.
packages/discv5/src/service/index.ts Reorders exports.
packages/discv5/src/service/addrVotes.ts Type-only import cleanup and formatting.
packages/discv5/src/rateLimit/rateLimiterGRCA.ts Adds Biome suppression for parameter reassignment.
packages/discv5/src/rateLimit/index.ts Type-only imports and formatting.
packages/discv5/src/packet/types.ts Type-only imports and explicit numeric enum values.
packages/discv5/src/packet/index.ts Reorders exports.
packages/discv5/src/packet/encode.ts Refactors imports/types and reorders object fields.
packages/discv5/src/packet/create.ts Updates noble utils import paths; formatting changes.
packages/discv5/src/metrics.ts Formatting and reorder of returned metrics fields.
packages/discv5/src/message/util.ts Type-only import cleanup.
packages/discv5/src/message/types.ts Adds Biome naming-convention suppression; type-only imports.
packages/discv5/src/message/index.ts Reorders exports.
packages/discv5/src/message/encode.ts Switches to Rlp alias; import cleanups/formatting.
packages/discv5/src/message/decode.ts Switches to Rlp alias; import cleanups/formatting.
packages/discv5/src/message/create.ts Replaces toBytes usage with explicit utf8 conversion for strings; formatting.
packages/discv5/src/libp2p/discv5.ts Refactors imports/types; minor loop + sleep cleanup.
packages/discv5/src/keypair/types.ts Refactors constructor assignments; formatting.
packages/discv5/src/keypair/secp256k1.ts Updates imports and adds Biome suppressions for legacy patterns.
packages/discv5/src/keypair/index.ts Reorders exports/imports and type-only cleanup.
packages/discv5/src/kademlia/util.ts Formatting and small control-flow refactor.
packages/discv5/src/kademlia/types.ts Type-only import cleanup; explicit numeric enum values.
packages/discv5/src/kademlia/lookup.ts Refactors control-flow and imports/formatting.
packages/discv5/src/kademlia/kademlia.ts Refactors imports and some loops/flattening; formatting.
packages/discv5/src/kademlia/index.ts Reorders exports.
packages/discv5/src/kademlia/bucket.ts Refactors imports and control-flow; replaces delete with = undefined in a few places.
packages/discv5/src/config/index.ts Type-only imports; reorders default config fields.
packages/discv5/package.json Updates dependencies and switches tests to Vitest; adds src to published files.
packages/discv5/.mocharc.yaml Removes Mocha configuration.
package.json Replaces workspace lint with Biome; updates devDependencies to Biome/Vitest/TS 5.9.
biome.jsonc Adds Biome configuration extending ChainSafe presets and scoping to packages src/test TS.
.prettierrc.cjs Removes Prettier configuration.
.mocharc.yaml Removes root Mocha configuration.
.gitignore Adds benchmark output directory ignore.
.eslintrc.cjs Removes ESLint configuration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

wemeetagain and others added 2 commits February 9, 2026 16:59
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Feb 9, 2026

@wemeetagain I've opened a new pull request, #325, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Feb 9, 2026

@wemeetagain I've opened a new pull request, #326, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Feb 9, 2026

@wemeetagain I've opened a new pull request, #327, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Feb 9, 2026

@wemeetagain I've opened a new pull request, #328, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 4 commits February 9, 2026 17:05
…#325)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: wemeetagain <1348242+wemeetagain@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: wemeetagain <1348242+wemeetagain@users.noreply.github.com>
…#327)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: wemeetagain <1348242+wemeetagain@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: wemeetagain <1348242+wemeetagain@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 73 out of 77 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

packages/enr/test/unit/enr.test.ts:148

  • Vitest test suites should not use an async describe callback. The await generateKeyPair(...) inside this describe can break test registration/ordering. Make the describe callback synchronous and perform async key generation in a beforeAll (or with top-level await), storing the generated key/enr in outer-scoped variables.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 8 to 14
describe("Discv5", async () => {
const kp0 = generateKeypair("secp256k1");
const privateKey0 = privateKeyFromRaw(kp0.privateKey);
const enr0 = SignableENR.createV4(kp0.privateKey);
const kp0 = await generateKeyPair("secp256k1");
const enr0 = SignableENR.createV4(kp0.raw);
const mu0 = multiaddr("/ip4/127.0.0.1/udp/40000");

const service0 = Discv5.create({ enr: enr0, privateKey: privateKey0, bindAddrs: { ip4: mu0 } });
const service0 = Discv5.create({bindAddrs: {ip4: mu0}, enr: enr0, privateKey: kp0});

Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vitest does not support an async describe callback for defining tests (test collection is synchronous). The await generateKeyPair(...) inside describe will prevent tests from being registered reliably. Move async setup into a beforeAll (or use top-level await) and keep describe synchronous.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI commented Feb 9, 2026

@wemeetagain I've opened a new pull request, #329, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits February 9, 2026 17:22
…nversion (#329)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: wemeetagain <1348242+wemeetagain@users.noreply.github.com>
@wemeetagain wemeetagain merged commit 1780af6 into master Feb 9, 2026
5 checks passed
@wemeetagain wemeetagain deleted the cayman/refresh branch February 9, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants