Skip to content

Commit 393a0e3

Browse files
committed
test(bindings): drop redundant comments
1 parent 53db9cd commit 393a0e3

3 files changed

Lines changed: 2 additions & 20 deletions

File tree

bindings/napi/BeaconStateView.zig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ pub const js_meta = js.class(.{ .properties = .{
6666
} });
6767

6868
cached_state: ?*CachedBeaconState = null,
69-
/// Holds a strong reference to the shared `Node.Pool` for the lifetime of
70-
/// `cached_state`. Released in `deinit` AFTER `cached_state.deinit` finishes
71-
/// its `pool.unref` calls, so the pool stays alive even if the module's
72-
/// NAPI env cleanup hook fired before this view's JS finalizer.
7369
pool_rc: ?*pool.PoolRc = null,
7470
const BeaconStateView = @This();
7571

bindings/napi/pool.zig

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ const default_pool_size: u32 = 0;
1111

1212
pub const PoolRc = RefCount(Node.Pool);
1313

14-
/// Pool is wrapped in `RefCount` so that any `BeaconStateView` (or other
15-
/// binding object) holding pool references at process exit keeps the pool
16-
/// alive until its own JS finalizer runs. Without this, NAPI env cleanup
17-
/// can run before module-level JS holders are finalized, freeing the pool
18-
/// before the holder's `pool.unref()` calls — causing "incorrect alignment"
19-
/// panics during teardown.
2014
pub const State = struct {
2115
pool_rc: ?*PoolRc = null,
2216

@@ -27,9 +21,6 @@ pub const State = struct {
2721
self.pool_rc = try PoolRc.init(allocator, pool_value);
2822
}
2923

30-
/// Drops the module's reference. Pool is actually destroyed when the
31-
/// last live reference is released (could be here or in a later
32-
/// BeaconStateView finalizer).
3324
pub fn deinit(self: *State) void {
3425
if (self.pool_rc) |rc| {
3526
rc.unref();

bindings/test/teardown.test.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,10 @@ import {describe, expect, it} from "vitest";
66
describe("BeaconStateView teardown", () => {
77
it("creates view at module scope and exits cleanly", () => {
88
const projectRoot = join(import.meta.dirname, "../..");
9-
// Fixture must live under the project root so Node resolves its
10-
// node_modules from there (workspace packages like @lodestar/config).
9+
// Fixture must live under the project root so Node resolves
10+
// workspace packages like @lodestar/config from local node_modules.
1111
const fixturePath = join(projectRoot, `bindings/test/.tmp-teardown-${process.pid}.mjs`);
1212

13-
// Module-scope `const seedState = ...` mirrors how perf bench files
14-
// hold native objects. Without the Pool refcount fix, NAPI env cleanup
15-
// frees the pool before this view's finalizer runs, and the chained
16-
// pool.unref calls panic with "incorrect alignment" on process exit
17-
// (exit code 134 / SIGABRT).
1813
writeFileSync(
1914
fixturePath,
2015
`

0 commit comments

Comments
 (0)