Skip to content

Commit aff2fec

Browse files
committed
Merge branch 'main' into elmattic/chain-get-events
2 parents fd6bee8 + 4341111 commit aff2fec

File tree

37 files changed

+1416
-489
lines changed

37 files changed

+1416
-489
lines changed

.github/workflows/js-lint.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: JS linters
2+
3+
# Cancel workflow if there is a new change to the branch.
4+
concurrency:
5+
group: ${{ github.workflow }}-${{ github.ref }}
6+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
7+
8+
on:
9+
merge_group:
10+
pull_request:
11+
branches:
12+
- main
13+
push:
14+
branches:
15+
- main
16+
paths:
17+
- 'benchmarks/**'
18+
19+
jobs:
20+
run-js-linters:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: "18"
27+
- run: |
28+
cd benchmarks/
29+
corepack enable
30+
yarn install --immutable
31+
yarn js-lint
32+
yarn js-fmt-check

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ web_modules/
189189
.yarn-integrity
190190

191191
# dotenv environment variable files
192-
.env
193192
.env.development.local
194193
.env.test.local
195194
.env.production.local
@@ -389,4 +388,4 @@ rust-project.json
389388

390389
# End of https://www.toptal.com/developers/gitignore/api/go,rust,rust-analyzer,osx,visualstudiocode,intellij+all,yarn,node,ruby
391390

392-
lychee-report.md
391+
lychee-report.md

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,16 @@
3131

3232
### Changed
3333

34+
- [#5452](https://github.com/ChainSafe/forest/pull/5452) Speed up void database migration.
35+
3436
### Removed
3537

38+
- [#5449](https://github.com/ChainSafe/forest/pull/5449) Remove unnecessary/duplicate metrics.
39+
3640
### Fixed
3741

42+
- [#5458](https://github.com/ChainSafe/forest/pull/5458) Fix stack overflow occurring when running Forest in debug mode.
43+
3844
## Forest v0.25.0 "Bombadil"
3945

4046
This is a mandatory release for calibnet node operators. It includes the revised NV25 _Teep_ network upgrade at epoch `2_523_454` which corresponds to `2025-03-26T23:00:00Z`. This release also includes a number of new RPC methods, fixes and other improvements. Be sure to check the breaking changes before upgrading.

Cargo.lock

Lines changed: 28 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ cfg-vis = "0.3"
4949
chrono = { version = "0.4", default-features = false, features = ["clock"] }
5050
cid = { workspace = true }
5151
clap = { version = "4", features = ["derive"] }
52+
clap_complete = "4"
5253
colored = "3"
5354
crypto_secretbox = "0.1"
5455
daemonize-me = "2"
@@ -220,7 +221,6 @@ walkdir = "2"
220221
zstd = "0.13"
221222

222223
# optional dependencies
223-
clap_complete = "4.5.46"
224224
console-subscriber = { version = "0.4", features = ["parking_lot"], optional = true }
225225
mimalloc = { version = "0.1", optional = true, default-features = false }
226226
paste = "1"

benchmarks/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.yarn
2+
node_modules

benchmarks/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
all-forest-cloud:
2+
k6 cloud run -e K6_TEST_URL=http://localhost:2345/rpc/v1 --local-execution tests/all.js
3+
4+
all-lotus-cloud:
5+
k6 cloud run -e K6_TEST_URL=http://localhost:1234/rpc/v1 --local-execution tests/all.js
6+
7+
all-forest-local:
8+
k6 run -e K6_TEST_URL=http://localhost:2345/rpc/v1 tests/all.js
9+
10+
all-lotus-local:
11+
k6 run -e K6_TEST_URL=http://localhost:1234/rpc/v1 tests/all.js
12+
13+
.PHONY: all-forest-cloud all-lotus-cloud all-forest-local all-lotus-local

benchmarks/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# K6 benchmarking for Filecoin JSON-RPC
2+
3+
Implementation-agnostic benchmark for RPC
4+
5+
## Requirements
6+
7+
This benchmarking suite requires [k6](https://grafana.com/docs/k6/latest/) installed on the host. Follow the instructions for your operating system. Alternatively, you can run them via Docker.
8+
9+
## Local benchmarks
10+
11+
You can run the benchmarks fully locally. To do so, you will need a running Filecoin node; ensure it's synced.
12+
13+
Sample benchmark run:
14+
15+
```bash
16+
k6 run -e K6_TEST_URL=http://localhost:2345/rpc/v1 tests/all.js --duration 30s --vus 20
17+
```
18+
19+
## Upload benchmarks to Grafana Cloud
20+
21+
You can create a free account on Grafana Cloud (the free tier should suffice if you run the tests locally). Login with `k6 cloud login --token <token>`. Now, you can run the benchmarks locally but have them uploaded to your Grafana Cloud for visual inspection and comparisons.
22+
23+
```bash
24+
k6 cloud run -e K6_TEST_URL=http://localhost:2345/rpc/v1 --local-execution tests/top5.js
25+
```
26+
27+
## Configuring benchmarks
28+
29+
Read about [k6 options](https://grafana.com/docs/k6/latest/using-k6/k6-options/).
30+
31+
## Environment variables
32+
33+
| Name | Description | Type | Default |
34+
| --------------- | --------------------------- | ---- | ------------------------------ |
35+
| `K6_TEST_URL` | Node RPC endpoint | URL | `http://localhost:2345/rpc/v1` |
36+
| `K6_TEST_DEBUG` | Print additional debug info | bool | false |
37+
38+
## Pitfalls
39+
40+
- Don't run the benchmarks in a environment with shared CPU, e.g., on a VPS. The results will vary depending on the load on that CPU.
41+
- Don't run the node in a virtualized environment, e.g., Docker for Mac. Use a native build.
42+
- Ensure your test parameters match your hardware. Ensure your machine is not saturated, e.g., `k6` itself using most of the resources and leaving the node with too little CPU/RAM. If need be, run the test on separate machines. `k6` and the node could also be limited, e.g., via Docker.
43+
44+
## Potential improvements
45+
46+
- [ ] include more methods
47+
- [ ] rewrite in TypeScript
48+
- [ ] visualize results locally

benchmarks/eslint.config.mjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { defineConfig } from "eslint/config";
2+
import globals from "globals";
3+
import js from "@eslint/js";
4+
5+
6+
export default defineConfig([
7+
{ files: ["**/*.{js,mjs,cjs}"] },
8+
{ files: ["**/*.{js,mjs,cjs}"], languageOptions: { globals: globals.browser } },
9+
{ files: ["**/*.{js,mjs,cjs}"], plugins: { js }, extends: ["js/recommended"] },
10+
11+
// Those don't play well with `k6`
12+
{ files: ["**/*.{js,mjs,cjs}"], rules: { "no-unused-vars": "off" } },
13+
{ files: ["**/*.{js,mjs,cjs}"], rules: { "no-undef": "off" } },
14+
]);

0 commit comments

Comments
 (0)