19 Commits

Author SHA1 Message Date
Nazar Hussain
fe261483ef chore: use npm trusted publishing (#8675)
**Motivation**

Use more secure way publish a release.

**Description**

- Use `npm` [trusted
publishing](https://docs.npmjs.com/trusted-publishers)

---------

Co-authored-by: Matthew Keil <me@matthewkeil.com>
2025-12-10 09:55:26 -04:00
Cayman
ba92bd8a88 feat: add lodestar-bun and bun leveldb binding (#8462)
**Motivation**

- #7280 

**Description**

- update `@types/node` to the latest node v22 version
- add `@lodestar/bun` dependency using git+https (for now! so that we
don't have to republish a bazillion times)
- keep in mind that this requires a manual build/rebuild of the so (via
`cd node_modules/@lodestar/bun && zig build`)
- Add a bun-specific `LevelDbController` which uses
[`@lodestar/bun`](https://github.com/ChainSafe/lodestar-bun)
- Only expose the leveldb controller via a subpath export (and for
tests, as a custom import, like in #8320 )
- add bun bun global override types
2025-09-25 09:23:11 -04:00
Nazar Hussain
0c6f50771f chore: use latest TS module resolution (#8419)
**Motivation**

Use latest `module` and `moduleResolution` for TS.

**Description**

- To use [subpath
imports](https://nodejs.org/api/packages.html#subpath-imports) in the PR
#8320 we need to update the module solution strategy for TS.
- That requires to change the `module` for the TS as well. 
- Earlier tried to stay with `node18` or `node20`, but the `ts-node`
does not work with that.
- Maintaining different tsconfig for ts-node is more of hassle on wrong
run.
- So decided to stick with `nodenext` strategy for `moduleResolution` 

**Steps to test or reproduce**

Run all tests

---------

Co-authored-by: Cayman <caymannava@gmail.com>
2025-09-18 11:36:48 -04:00
Nazar Hussain
93489491e0 feat: add type support for Bun (#8288)
**Motivation**

Add types support for Bun. So we can start using `if(Bun)` in our
codebase.

**Description**

- Add `@types/bun` package

**Steps to test or reproduce**

- Run all tests
2025-09-01 14:18:16 +02:00
Nazar Hussain
3c466f1f65 fix: type checks for build config (#7519)
**Motivation**

It is commonly practice that if code builds fine, it works fine. 


**Description**

- Having type checking and other checks disabled for the build step
causing confusing in dev experience
- Revert the **noCheck** from the build tsconfig. 


**Steps to test or reproduce**

- Run all tests
2025-03-03 06:17:10 +00:00
Nazar Hussain
51efa3d604 chore: update the test runner (#7404)
**Motivation**

Update vitest and browser engine.

**Description**

- Move root level shared configs to `configs` directory
- Update to vitest 3.x
- Migrate from `webdriverio` to `playwright` which is more stable and
recommended by Vitest.

**NOTE**
Reverted the `playwright` upgrade. See the comments. 


d2a7af0308/configs/vitest.config.base.browser.ts (L41-L43)

**Steps to test or reproduce**

Run all tests
2025-02-27 10:27:43 -05:00
Nazar Hussain
b2ebe4921b deps: upgrade tyepscript to 5.7 (#7160)
**Motivation**

Keep the deps updated.

**Description**

Use latest features provided by Typescript. See the comments below. 

**Steps to test or reproduce**

- Run all tests
2025-02-25 14:24:14 +01:00
Nazar Hussain
5b129f0f00 chore: cleanup mocha/chai/sinon usage across the repo (#6311)
* Cleanup mocha/chai usage

* Split the config files for each package

* Fix types

* Fix lint errors

* Sort the lint rules

* Fix types

* Cleanup sinon usage

* Fix tests

* Fix lint error

* Add vitest word to dictionary

* Fix the test iteration

* Fix e2e tests

* Sort the words

* Fix sim test assertion

* Fix data import

* Fix import order for mocks

* Fix import order

* Fix e2e tests

* Add contribution guide

* Fix the lint error

* Add src to dictionary

* Remove eslint-disable for skipped tests

* Fix assertions

* Update CONTRIBUTING.md

Co-authored-by: Matthew Keil <me@matthewkeil.com>

---------

Co-authored-by: Matthew Keil <me@matthewkeil.com>
2024-01-22 18:35:20 +01:00
Nazar Hussain
53378e1e08 test(prover): move tests for prover to vitest (#6074)
* Automatic assertion migration

* Fix some left over assertions

* Remove sinon

* Add config files

* Move browser tests to vitest

* Fix browser tests

* Add a skip lib check for now

* Fix the spellings

* Fix deprecated flags

* Fix types

* Update the script tasks

* Fix the e2e tests

* Fix e2e tests

* Update webdriverio to fix browser installtion issue

* Fix the vitest config

* Add a peer dependency

* Add vite resolution

* Add a manual install for browsers

* Update packages to support additional browser options

* Update the resolutions

* Add resolutions to fix dependencies

* Update the yarn linter script

* Add sigfault handler

* Rebuild native modules with debug flag

* Update depedencies

* Update e2e tests

* Update dependencies

* Add browser capabilities

* Revert a whitespace change

* Remove segfault handler

* Remove native dep for lightclient

* Add debug flag to introspect error

* Rename a file

* Upgrade the vitest package

* Fix the regressions introduced in vitest 1 >

* Revert the regression of vitest 1.0.1

* Clean dependencies

* Update multiple fork fix

* Add dependency fix

* Fix broken singleThread option for e2e
2023-12-08 10:30:08 +01:00
Cayman
042adb1372 chore!: update target to es2021 (#5866)
* chore!: update target to es2021

* chore: update ES Version badges
2023-08-10 11:35:17 -04:00
g11tech
fa13bdbe51 Race building execution and builder block with cutoff (#5223)
* Race building execution and builder block with cutoff

* resolve race before deadline if nothing pending

* improve race

* improve flow

* update builder test args

* cleanup

* improve log ux

* update the race with better flow

* return early post cutoff

* improve comment

* add jsdoc

* add test cases to race

* comment

* cleanup

* more test cases and events improvs

* more jsdocs and tests

* some more refinement

* cutoff resolution refinement

* measure event delayms

* cleanup

* some more improvs and feedback inclusion

* reduce diff

* improv
2023-03-06 12:51:10 +05:30
Cayman
c2377f2de1 Update libp2p to ESM version (#4114)
* WIP

* Revert eslint changes

* Revert dependency update

* Revert dependencies

* Revert yarn.lock

* Update yarn.lock

* Update noise

* Fix lint errors

* Update discv5

* Fix linter errors

* Fix check-types

* Fix up libp2p connection manager handling

* Update gossipsub

* Add import statement

* Use upstream GossipsubEvents type

* Remove stray lint disable comment

* Only ping a single peer when it connects

* Update gossipsub

* libp2p-gossipsub 3.5.0

* Use libp2p-noise 7.0.3

* Use @libp2p/mplex 4.0.3

* Fix write heap dump in libp2p esm branch (#4387)

* Remove 'require' check in writeHeapDump

* Fix BELLATRIX_FORK_EPOCH

* Update libp2p dependencies

* Bump libp2p

* Fix heap memory issue

* Fix some tests

* Fix type error

* Fix req/resp 'index out of bounds' issue

* Fix linter errors

* Add libp2p metrics and dashboard

* Update gossipsub and set max outbound buffer size

* Update @libp2p/tcp

* Update uint8arrays

* v0.0.0

* Lint libp2p grafana dashboard

* Add leveldown dev dependency

* Set msgIdToStrFn to Buffer.toString

* Do not set udp to enr (#4591)

* Fix e2e reqresp test

* Fix lint

* Fix unit tests

* Update yarn.lock after merge

* Update libp2p

Co-authored-by: Tuyen Nguyen <vutuyen2636@gmail.com>
Co-authored-by: tuyennhv <tuyen@chainsafe.io>
2022-09-27 12:56:01 -05:00
Cayman
dd0e4dd731 ESM Support (#3978)
* ESM changes

* Fix root lodestar script

* Fix some linter errors

* trying directly re-exporting under an alias from networks module

* Fix types exports

* Fix more linter errors

* Fix spec test download

* Update bls to 7.1.0

* Fix spec tests

* temp reverting eslint parser option to 10 and disabling the check of .js file extenstion. Should fix lint errors

* temp commented out file-extension-in-import

* Disable readme checks

* Fix check-build

* Fix params e2e tests

* Bump @chainsafe/threads

* Bump bls to v7.1.1

* Add timeouts after node initialization but before sim test run

* Tweak timeouts

* Tweak timeout

* Tweak sim merge timeout

* Tweak sim merge timeout

* Tweak sim merge timeout

* Tweak sim merge timeout

* Add more timeouts

* Add another timeout

* Fix linter errors

* Fix some tests

* Fix some linter errors and spec tests

* Fix benchmarks

* Fix linter errors

* Update each bls dependency

* Tweak timeouts

* Add another timeout

* More timeouts

* Fix bls pool size

* Set root package.json to ESM

* Remove old linter comment

* Revert "Set root package.json to ESM"

This reverts commit 347b0fdd18.

* Remove stray file (probably old)

* Undo unnecessary diff

* Add comment on __dirname replacement

* Import type @chainsafe/bls/types

* Use lodestar path imports

* Revert multifork to lodestar package

* Format .mocharc.yaml

* Use same @chainsafe/as-sha256 version

* Fix lodash path imports

* Use src instead of lib

* Load db metrics

* Remove experimental-specifier-resolution

* Remove lodestat/chain export

* Add stray missing file extension

* Revert ValidatorDir changes

* Fix stray missing file extensions

* Fix check-types

Co-authored-by: Dadepo Aderemi <dadepo@gmail.com>
Co-authored-by: dapplion <35266934+dapplion@users.noreply.github.com>
2022-05-24 16:12:55 -05:00
Lion - dapplion
d7a4379d93 Type error in catch clause (with TS feature) (#3072)
* Bump typescript to 4.4.0

* Type catch e clause

* Bump observable-fns

* Type lodestar error

* Skip readme checks
2021-09-09 14:44:57 -05:00
tuyennhv
0296cdd9f5 Enable sourceMap option to debug (#2956) 2021-08-13 09:08:28 -05:00
Lion - dapplion
5c48527d93 Remove babel (#2933)
* Remove babel

* Update tsconfig.build.json
2021-08-10 15:13:33 -05:00
dapplion
610bcfe9b3 Enable Typescript strict opts 2021-03-16 17:30:50 +01:00
dapplion
a0ad363cea Hoist common tsc options to the root tsconfig 2021-03-07 11:45:45 +01:00
dapplion
d3b40cbed0 Reference tsconfig.build.json 2021-03-07 11:19:21 +01:00