Skip to content

deps: patch @libp2p/tcp to fix network worker shutdown hang - #9825

Merged
matthewkeil merged 1 commit into
unstablefrom
nflaig/patch-libp2p-tcp-shutdown-hang
Aug 14, 2026
Merged

deps: patch @libp2p/tcp to fix network worker shutdown hang#9825
matthewkeil merged 1 commit into
unstablefrom
nflaig/patch-libp2p-tcp-shutdown-hang

Conversation

@nflaig

@nflaig nflaig commented Aug 14, 2026

Copy link
Copy Markdown
Member

Applies libp2p/js-libp2p#3597 as a local pnpm patch until it is released. This fixes the network worker shutdown hang, the underlying handle that #9790 mitigated but did not identify.

Root cause

TCPSocketMultiaddrConnection.sendReset() calls socket.resetAndDestroy() unconditionally. When the writable side has already ended that does not tear the handle down, so the socket stays alive as an active TCPSocketWrap while libp2p considers it closed. Nothing else holds a reference, so nothing ever closes it.

Node's worker teardown then spins forever, because Environment::CleanupHandles() runs until every handle is closed:

while (handle_cleanup_waiting_ != 0 || request_waiting_ != 0 || !handle_wrap_queue_.IsEmpty()) {
  uv_run(event_loop(), UV_RUN_ONCE);
}

The thread never exits, so Worker.terminate() never resolves, so the main thread blocks in uv_thread_join from process.exit() until the process manager kills it.

The patch guards the case the reset cannot handle:

sendReset (): void {
  if (this.socket.writableEnded) {
    this.socket.destroy()
    return
  }
  this.socket.resetAndDestroy()
}

Why the exact-version pin

@libp2p/tcp is declared as ^11.0.13 and patchedDependencies keys are version exact, so an 11.0.14 release would resolve past the patch and silently drop the fix. The overrides pin prevents that, same as the existing sigstore patch. It does mean no @libp2p/tcp bump until the patch is dropped.

Testing

Validated on a mainnet node against a baseline hang rate of 4 in 36 shutdowns (11.1%).

70 consecutive shutdowns, synced with >=200 peers and a 5 minute soak each:

criterion result
hangs 0 / 70
TCPSocketWrap present after libp2p.stop() 0 / 70
worker terminate 0.027-0.072s, hang signature is 3.000s
exit code 0 on all 70, never SIGKILLed
shutdown duration mean 7.20s, max 9.8s
state archived 70 / 70

Plus one shutdown at 9.07h uptime, since orphaned socket counts grew with uptime: terminate 0.180s, no TCPSocketWrap, exit 0.

Counted independently from the raw node logs as well as from the test harness. The last unpatched shutdown on the same machine, three minutes before deploying the patched build, hung at 3.001s with activeResources=MessagePort=1,TCPSocketWrap=6,Timeout=1.

Observing 70 consecutive clean shutdowns if the bug were still present has probability 0.00026. Fisher exact against the measured baseline gives p = 0.012.

The activeResources logging added by #9790 is what made this diagnosable, the presence of TCPSocketWrap separated 5 hangs from 32 clean shutdowns perfectly (Fisher p = 0.0000023).

Longest uptime tested was 9.07h. The worst case observed, 28 orphaned sockets, took ~38h to accumulate, so this validates the mechanism rather than proving an upper bound.

Full write-up: https://gist.github.com/nflaig/5f41cfc50f38baf5046a034162943dc3

When to remove

Drop the patch and the overrides pin together once js-libp2p#3597 is released and @libp2p/tcp is bumped to a version containing it.

AI Assistance Disclosure

Investigation, patch and validation with Claude Code.

馃 Generated with Claude Code

`sendReset()` calls `socket.resetAndDestroy()` unconditionally, which does not
tear down the handle if the writable side has already ended. The socket stays
alive as an active `TCPSocketWrap` while libp2p considers it closed, and since
nothing else holds a reference it is never closed. The stranded handle keeps
the worker spinning in `Environment::CleanupHandles()`, so `Worker.terminate()`
never resolves and the process blocks in `uv_thread_join` until the process
manager kills it.

Applies libp2p/js-libp2p#3597 until it is released.

Validated on a mainnet node over 71 shutdowns with no hang, against a baseline
rate of 4 in 36. Details in
https://gist.github.com/nflaig/5f41cfc50f38baf5046a034162943dc3

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

馃挕 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ccf007cfb0

鈩癸笍 About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 馃憤.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pnpm-workspace.yaml
sigstore: "4.0.0"

patchedDependencies:
"@libp2p/tcp@11.0.13": patches/@libp2p__tcp@11.0.13.patch

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Ship the TCP fix with published packages

When Lodestar is installed from npm, this workspace-level patchedDependencies entry is not included in the published tarball, so consumers still receive an unpatched @libp2p/tcp. The release workflow publishes with Lerna, while packages/beacon-node/package.json:128 retains "@libp2p/tcp": "^11.0.13" and excludes both this workspace configuration and the patch file. Consequently, npm installations of @chainsafe/lodestar or @lodestar/beacon-node remain vulnerable to the shutdown hang this commit is intended to fix; ensure the published dependency path also carries the fix.

Useful? React with 馃憤聽/ 馃憥.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

pretty sure this comment is wrong @matthewkeil ?

Comment on lines +23 to +27
sendReset (): void {
+ if (this.socket.writableEnded) {
+ this.socket.destroy()
+ return
+ }

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

not sure it's required to patch src but why not 馃し

@nflaig nflaig left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

LGTM, self-review

@github-actions

Copy link
Copy Markdown
Contributor

Performance Report

馃殌馃殌 Significant benchmark improvement detected

Benchmark suite Current: 73a6075 Previous: 32aed64 Ratio
send data - 1000 16384B messages 81.059 ms/op 417.97 ms/op 0.19
Full benchmark results
Benchmark suite Current: 73a6075 Previous: 32aed64 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 911.45 us/op 910.91 us/op 1.00
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 39.520 us/op 38.931 us/op 1.02
BLS verify - blst 669.98 us/op 717.75 us/op 0.93
BLS verifyMultipleSignatures 3 - blst 1.2986 ms/op 1.3294 ms/op 0.98
BLS verifyMultipleSignatures 8 - blst 2.0292 ms/op 2.1129 ms/op 0.96
BLS verifyMultipleSignatures 32 - blst 6.4459 ms/op 6.8141 ms/op 0.95
BLS verifyMultipleSignatures 64 - blst 12.811 ms/op 12.540 ms/op 1.02
BLS verifyMultipleSignatures 128 - blst 25.223 ms/op 25.633 ms/op 0.98
BLS deserializing 10000 signatures 617.12 ms/op 633.33 ms/op 0.97
BLS deserializing 100000 signatures 6.2274 s/op 6.4360 s/op 0.97
BLS verifyMultipleSignatures - same message - 3 - blst 670.89 us/op 790.15 us/op 0.85
BLS verifyMultipleSignatures - same message - 8 - blst 904.19 us/op 885.48 us/op 1.02
BLS verifyMultipleSignatures - same message - 32 - blst 1.5115 ms/op 1.5143 ms/op 1.00
BLS verifyMultipleSignatures - same message - 64 - blst 2.3192 ms/op 2.3339 ms/op 0.99
BLS verifyMultipleSignatures - same message - 128 - blst 3.9233 ms/op 4.0003 ms/op 0.98
BLS aggregatePubkeys 32 - blst 17.272 us/op 17.692 us/op 0.98
BLS aggregatePubkeys 128 - blst 61.663 us/op 62.878 us/op 0.98
getSlashingsAndExits - default max 49.970 us/op 48.431 us/op 1.03
getSlashingsAndExits - 2k 333.95 us/op 390.95 us/op 0.85
proposeBlockBody type=full, size=empty 597.04 us/op 750.22 us/op 0.80
isKnown best case - 1 super set check 179.00 ns/op 171.00 ns/op 1.05
isKnown normal case - 2 super set checks 155.00 ns/op 167.00 ns/op 0.93
isKnown worse case - 16 super set checks 155.00 ns/op 167.00 ns/op 0.93
validate api signedAggregateAndProof - struct 1.4477 ms/op 1.5307 ms/op 0.95
validate gossip signedAggregateAndProof - struct 1.4531 ms/op 1.5226 ms/op 0.95
batch validate gossip attestation - vc 640000 - chunk 32 105.23 us/op 109.65 us/op 0.96
batch validate gossip attestation - vc 640000 - chunk 64 92.594 us/op 100.30 us/op 0.92
batch validate gossip attestation - vc 640000 - chunk 128 92.026 us/op 95.080 us/op 0.97
batch validate gossip attestation - vc 640000 - chunk 256 86.662 us/op 90.886 us/op 0.95
bytes32 toHexString 277.00 ns/op 284.00 ns/op 0.98
bytes32 Buffer.toString(hex) 172.00 ns/op 175.00 ns/op 0.98
bytes32 Buffer.toString(hex) from Uint8Array 239.00 ns/op 243.00 ns/op 0.98
bytes32 Buffer.toString(hex) + 0x 173.00 ns/op 176.00 ns/op 0.98
Return object 10000 times 0.20950 ns/op 0.21420 ns/op 0.98
Throw Error 10000 times 3.2272 us/op 3.3037 us/op 0.98
toHex 91.216 ns/op 98.215 ns/op 0.93
Buffer.from 82.920 ns/op 94.432 ns/op 0.88
shared Buffer 56.878 ns/op 58.162 ns/op 0.98
fastMsgIdFn sha256 / 200 bytes 1.4540 us/op 1.4900 us/op 0.98
fastMsgIdFn h32 xxhash / 200 bytes 155.00 ns/op 160.00 ns/op 0.97
fastMsgIdFn h64 xxhash / 200 bytes 209.00 ns/op 205.00 ns/op 1.02
fastMsgIdFn sha256 / 1000 bytes 4.6210 us/op 4.8000 us/op 0.96
fastMsgIdFn h32 xxhash / 1000 bytes 240.00 ns/op 252.00 ns/op 0.95
fastMsgIdFn h64 xxhash / 1000 bytes 255.00 ns/op 259.00 ns/op 0.98
fastMsgIdFn sha256 / 10000 bytes 40.917 us/op 42.343 us/op 0.97
fastMsgIdFn h32 xxhash / 10000 bytes 1.2270 us/op 1.3040 us/op 0.94
fastMsgIdFn h64 xxhash / 10000 bytes 803.00 ns/op 851.00 ns/op 0.94
send data - 1000 256B messages 4.2223 ms/op 4.7838 ms/op 0.88
send data - 1000 512B messages 5.2834 ms/op 7.8646 ms/op 0.67
send data - 1000 1024B messages 5.4897 ms/op 6.4497 ms/op 0.85
send data - 1000 1200B messages 6.3558 ms/op 7.4563 ms/op 0.85
send data - 1000 2048B messages 16.340 ms/op 13.982 ms/op 1.17
send data - 1000 4096B messages 41.858 ms/op 68.598 ms/op 0.61
send data - 1000 16384B messages 81.059 ms/op 417.97 ms/op 0.19
send data - 1000 65536B messages 963.45 ms/op 1.7475 s/op 0.55
enrSubnets - fastDeserialize 64 bits 705.00 ns/op 806.00 ns/op 0.87
enrSubnets - ssz BitVector 64 bits 258.00 ns/op 277.00 ns/op 0.93
enrSubnets - fastDeserialize 4 bits 95.000 ns/op 104.00 ns/op 0.91
enrSubnets - ssz BitVector 4 bits 256.00 ns/op 275.00 ns/op 0.93
prioritizePeers score -10:0 att 32-0.1 sync 2-0 193.15 us/op 212.65 us/op 0.91
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 221.15 us/op 308.14 us/op 0.72
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 319.74 us/op 361.97 us/op 0.88
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 568.67 us/op 611.44 us/op 0.93
prioritizePeers score 0:0 att 64-1 sync 4-1 664.31 us/op 724.91 us/op 0.92
array of 16000 items push then shift 1.2359 us/op 1.2954 us/op 0.95
LinkedList of 16000 items push then shift 7.3010 ns/op 9.6080 ns/op 0.76
array of 16000 items push then pop 77.331 ns/op 77.275 ns/op 1.00
LinkedList of 16000 items push then pop 5.7780 ns/op 6.3890 ns/op 0.90
array of 24000 items push then shift 1.8078 us/op 1.9473 us/op 0.93
LinkedList of 24000 items push then shift 6.8070 ns/op 8.7930 ns/op 0.77
array of 24000 items push then pop 110.43 ns/op 119.12 ns/op 0.93
LinkedList of 24000 items push then pop 5.8620 ns/op 6.7980 ns/op 0.86
intersect bitArray bitLen 8 3.8530 ns/op 3.9540 ns/op 0.97
intersect array and set length 8 28.363 ns/op 30.464 ns/op 0.93
intersect bitArray bitLen 128 22.703 ns/op 23.743 ns/op 0.96
intersect array and set length 128 486.87 ns/op 502.69 ns/op 0.97
bitArray.getTrueBitIndexes() bitLen 128 900.00 ns/op 959.00 ns/op 0.94
bitArray.getTrueBitIndexes() bitLen 248 1.6330 us/op 1.7200 us/op 0.95
bitArray.getTrueBitIndexes() bitLen 512 3.4210 us/op 3.6290 us/op 0.94
Full columns - reconstruct all 6 blobs 141.69 us/op 167.68 us/op 0.84
Full columns - reconstruct half of the blobs out of 6 96.493 us/op 82.841 us/op 1.16
Full columns - reconstruct single blob out of 6 73.411 us/op 44.066 us/op 1.67
Half columns - reconstruct all 6 blobs 384.64 ms/op 385.31 ms/op 1.00
Half columns - reconstruct half of the blobs out of 6 192.59 ms/op 197.32 ms/op 0.98
Half columns - reconstruct single blob out of 6 68.347 ms/op 69.964 ms/op 0.98
Set add up to 64 items then delete first 1.5826 us/op 1.6155 us/op 0.98
OrderedSet add up to 64 items then delete first 2.4675 us/op 2.4841 us/op 0.99
Set add up to 64 items then delete last 1.8135 us/op 1.8169 us/op 1.00
OrderedSet add up to 64 items then delete last 2.8022 us/op 2.8397 us/op 0.99
Set add up to 64 items then delete middle 1.8402 us/op 1.8582 us/op 0.99
OrderedSet add up to 64 items then delete middle 4.3619 us/op 4.3272 us/op 1.01
Set add up to 128 items then delete first 3.5622 us/op 3.5546 us/op 1.00
OrderedSet add up to 128 items then delete first 5.2986 us/op 5.3547 us/op 0.99
Set add up to 128 items then delete last 3.5442 us/op 3.4896 us/op 1.02
OrderedSet add up to 128 items then delete last 5.4949 us/op 5.4145 us/op 1.01
Set add up to 128 items then delete middle 3.5585 us/op 3.4480 us/op 1.03
OrderedSet add up to 128 items then delete middle 11.439 us/op 11.138 us/op 1.03
Set add up to 256 items then delete first 7.4158 us/op 7.4480 us/op 1.00
OrderedSet add up to 256 items then delete first 11.710 us/op 11.702 us/op 1.00
Set add up to 256 items then delete last 7.0226 us/op 7.5271 us/op 0.93
OrderedSet add up to 256 items then delete last 12.149 us/op 12.084 us/op 1.01
Set add up to 256 items then delete middle 7.4653 us/op 7.0975 us/op 1.05
OrderedSet add up to 256 items then delete middle 35.640 us/op 35.868 us/op 0.99
runFastConfirmationRules vc:100000 bc:96 eq:0 4.4755 ms/op 4.6616 ms/op 0.96
runFastConfirmationRules vc:600000 bc:96 eq:0 37.606 ms/op 38.494 ms/op 0.98
runFastConfirmationRules vc:1000000 bc:96 eq:0 58.944 ms/op 69.862 ms/op 0.84
runFastConfirmationRules vc:600000 bc:320 eq:0 35.888 ms/op 36.499 ms/op 0.98
runFastConfirmationRules vc:100000 bc:96 eq:1000 1.1511 s/op 1.3936 s/op 0.83
pass gossip attestations to forkchoice per slot 2.7753 ms/op 2.6352 ms/op 1.05
forkChoice updateHead vc 100000 bc 64 eq 0 414.33 us/op 409.84 us/op 1.01
forkChoice updateHead vc 600000 bc 64 eq 0 2.4969 ms/op 2.4525 ms/op 1.02
forkChoice updateHead vc 1000000 bc 64 eq 0 4.1669 ms/op 4.0754 ms/op 1.02
forkChoice updateHead vc 600000 bc 320 eq 0 2.5572 ms/op 2.4921 ms/op 1.03
forkChoice updateHead vc 600000 bc 1200 eq 0 2.5785 ms/op 2.6113 ms/op 0.99
forkChoice updateHead vc 600000 bc 7200 eq 0 3.6335 ms/op 3.5654 ms/op 1.02
forkChoice updateHead vc 600000 bc 64 eq 1000 2.5526 ms/op 2.4968 ms/op 1.02
forkChoice updateHead vc 600000 bc 64 eq 10000 2.6159 ms/op 2.5661 ms/op 1.02
forkChoice updateHead vc 600000 bc 64 eq 300000 7.2059 ms/op 7.2086 ms/op 1.00
computeDeltas 1400000 validators 0% inactive 12.626 ms/op 12.499 ms/op 1.01
computeDeltas 1400000 validators 10% inactive 14.200 ms/op 11.803 ms/op 1.20
computeDeltas 1400000 validators 20% inactive 10.899 ms/op 11.061 ms/op 0.99
computeDeltas 1400000 validators 50% inactive 9.0116 ms/op 9.1297 ms/op 0.99
computeDeltas 2100000 validators 0% inactive 18.493 ms/op 18.707 ms/op 0.99
computeDeltas 2100000 validators 10% inactive 17.516 ms/op 17.793 ms/op 0.98
computeDeltas 2100000 validators 20% inactive 16.511 ms/op 16.691 ms/op 0.99
computeDeltas 2100000 validators 50% inactive 10.897 ms/op 11.342 ms/op 0.96
altair processAttestation - 250000 vs - 7PWei normalcase 2.2791 ms/op 2.6241 ms/op 0.87
altair processAttestation - 250000 vs - 7PWei worstcase 3.0488 ms/op 3.2106 ms/op 0.95
altair processAttestation - setStatus - 1/6 committees join 102.18 us/op 98.600 us/op 1.04
altair processAttestation - setStatus - 1/3 committees join 213.05 us/op 193.63 us/op 1.10
altair processAttestation - setStatus - 1/2 committees join 282.05 us/op 303.13 us/op 0.93
altair processAttestation - setStatus - 2/3 committees join 378.97 us/op 369.66 us/op 1.03
altair processAttestation - setStatus - 4/5 committees join 519.84 us/op 517.44 us/op 1.00
altair processAttestation - setStatus - 100% committees join 601.81 us/op 601.93 us/op 1.00
altair processBlock - 250000 vs - 7PWei normalcase 4.7845 ms/op 4.5213 ms/op 1.06
altair processBlock - 250000 vs - 7PWei normalcase hashState 19.070 ms/op 15.832 ms/op 1.20
altair processBlock - 250000 vs - 7PWei worstcase 22.257 ms/op 21.720 ms/op 1.02
altair processBlock - 250000 vs - 7PWei worstcase hashState 54.372 ms/op 41.077 ms/op 1.32
phase0 processBlock - 250000 vs - 7PWei normalcase 1.6440 ms/op 1.4449 ms/op 1.14
phase0 processBlock - 250000 vs - 7PWei worstcase 19.767 ms/op 17.634 ms/op 1.12
altair processEth1Data - 250000 vs - 7PWei normalcase 287.57 us/op 286.00 us/op 1.01
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 5.5900 us/op 6.0180 us/op 0.93
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 26.274 us/op 21.042 us/op 1.25
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 8.2280 us/op 6.0910 us/op 1.35
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 8.7070 us/op 3.7490 us/op 2.32
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 92.518 us/op 82.286 us/op 1.12
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 1.4267 ms/op 1.3271 ms/op 1.08
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.7959 ms/op 1.7812 ms/op 1.01
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.8542 ms/op 1.7779 ms/op 1.04
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.6562 ms/op 3.6455 ms/op 1.00
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.0588 ms/op 1.9814 ms/op 1.04
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.9173 ms/op 3.8040 ms/op 1.03
Tree 40 250000 create 326.13 ms/op 298.67 ms/op 1.09
Tree 40 250000 get(125000) 91.408 ns/op 87.053 ns/op 1.05
Tree 40 250000 set(125000) 964.69 ns/op 938.01 ns/op 1.03
Tree 40 250000 toArray() 14.272 ms/op 14.239 ms/op 1.00
Tree 40 250000 iterate all - toArray() + loop 14.318 ms/op 12.919 ms/op 1.11
Tree 40 250000 iterate all - get(i) 40.034 ms/op 35.356 ms/op 1.13
Array 250000 create 2.4752 ms/op 2.3394 ms/op 1.06
Array 250000 clone - spread 761.37 us/op 730.96 us/op 1.04
Array 250000 get(125000) 0.28300 ns/op 0.27700 ns/op 1.02
Array 250000 set(125000) 0.28300 ns/op 0.28200 ns/op 1.00
Array 250000 iterate all - loop 55.620 us/op 55.128 us/op 1.01
phase0 afterProcessEpoch - 250000 vs - 7PWei 38.297 ms/op 39.803 ms/op 0.96
Array.fill - length 1000000 3.9412 ms/op 3.6633 ms/op 1.08
Array push - length 1000000 15.191 ms/op 13.814 ms/op 1.10
Array.get 0.20093 ns/op 0.19831 ns/op 1.01
Uint8Array.get 0.23605 ns/op 0.23119 ns/op 1.02
phase0 beforeProcessEpoch - 250000 vs - 7PWei 13.676 ms/op 14.563 ms/op 0.94
altair processEpoch - mainnet_e81889 262.84 ms/op 292.92 ms/op 0.90
mainnet_e81889 - altair beforeProcessEpoch 38.638 ms/op 36.151 ms/op 1.07
mainnet_e81889 - altair processJustificationAndFinalization 6.7150 us/op 6.9700 us/op 0.96
mainnet_e81889 - altair processInactivityUpdates 6.5555 ms/op 7.3530 ms/op 0.89
mainnet_e81889 - altair processRewardsAndPenalties 19.406 ms/op 20.377 ms/op 0.95
mainnet_e81889 - altair processRegistryUpdates 545.00 ns/op 574.00 ns/op 0.95
mainnet_e81889 - altair processSlashings 139.00 ns/op 140.00 ns/op 0.99
mainnet_e81889 - altair processEth1DataReset 135.00 ns/op 135.00 ns/op 1.00
mainnet_e81889 - altair processEffectiveBalanceUpdates 9.2825 ms/op 7.0401 ms/op 1.32
mainnet_e81889 - altair processSlashingsReset 694.00 ns/op 694.00 ns/op 1.00
mainnet_e81889 - altair processRandaoMixesReset 1.3110 us/op 1.3600 us/op 0.96
mainnet_e81889 - altair processHistoricalRootsUpdate 136.00 ns/op 136.00 ns/op 1.00
mainnet_e81889 - altair processParticipationFlagUpdates 437.00 ns/op 456.00 ns/op 0.96
mainnet_e81889 - altair processSyncCommitteeUpdates 109.00 ns/op 112.00 ns/op 0.97
mainnet_e81889 - altair afterProcessEpoch 41.165 ms/op 41.697 ms/op 0.99
capella processEpoch - mainnet_e217614 854.48 ms/op 827.30 ms/op 1.03
mainnet_e217614 - capella beforeProcessEpoch 73.630 ms/op 64.226 ms/op 1.15
mainnet_e217614 - capella processJustificationAndFinalization 7.5240 us/op 6.6730 us/op 1.13
mainnet_e217614 - capella processInactivityUpdates 16.002 ms/op 16.850 ms/op 0.95
mainnet_e217614 - capella processRewardsAndPenalties 94.935 ms/op 93.419 ms/op 1.02
mainnet_e217614 - capella processRegistryUpdates 4.4680 us/op 4.8970 us/op 0.91
mainnet_e217614 - capella processSlashings 138.00 ns/op 154.00 ns/op 0.90
mainnet_e217614 - capella processEth1DataReset 136.00 ns/op 146.00 ns/op 0.93
mainnet_e217614 - capella processEffectiveBalanceUpdates 17.671 ms/op 17.079 ms/op 1.03
mainnet_e217614 - capella processSlashingsReset 679.00 ns/op 692.00 ns/op 0.98
mainnet_e217614 - capella processRandaoMixesReset 1.3670 us/op 1.3420 us/op 1.02
mainnet_e217614 - capella processHistoricalRootsUpdate 142.00 ns/op 152.00 ns/op 0.93
mainnet_e217614 - capella processParticipationFlagUpdates 442.00 ns/op 466.00 ns/op 0.95
mainnet_e217614 - capella afterProcessEpoch 107.36 ms/op 107.84 ms/op 1.00
phase0 processEpoch - mainnet_e58758 325.59 ms/op 317.28 ms/op 1.03
mainnet_e58758 - phase0 beforeProcessEpoch 73.060 ms/op 69.868 ms/op 1.05
mainnet_e58758 - phase0 processJustificationAndFinalization 6.7010 us/op 6.6240 us/op 1.01
mainnet_e58758 - phase0 processRewardsAndPenalties 17.021 ms/op 16.848 ms/op 1.01
mainnet_e58758 - phase0 processRegistryUpdates 2.2690 us/op 2.3290 us/op 0.97
mainnet_e58758 - phase0 processSlashings 141.00 ns/op 138.00 ns/op 1.02
mainnet_e58758 - phase0 processEth1DataReset 135.00 ns/op 170.00 ns/op 0.79
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.1083 ms/op 811.57 us/op 1.37
mainnet_e58758 - phase0 processSlashingsReset 889.00 ns/op 972.00 ns/op 0.91
mainnet_e58758 - phase0 processRandaoMixesReset 1.3080 us/op 1.4200 us/op 0.92
mainnet_e58758 - phase0 processHistoricalRootsUpdate 143.00 ns/op 143.00 ns/op 1.00
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.1970 us/op 1.2990 us/op 0.92
mainnet_e58758 - phase0 afterProcessEpoch 33.092 ms/op 34.771 ms/op 0.95
phase0 processEffectiveBalanceUpdates - 250000 normalcase 981.35 us/op 1.0031 ms/op 0.98
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.5779 ms/op 2.8054 ms/op 0.56
altair processInactivityUpdates - 250000 normalcase 14.709 ms/op 12.198 ms/op 1.21
altair processInactivityUpdates - 250000 worstcase 14.787 ms/op 12.705 ms/op 1.16
phase0 processRegistryUpdates - 250000 normalcase 2.2960 us/op 2.4050 us/op 0.95
phase0 processRegistryUpdates - 250000 badcase_full_deposits 139.17 us/op 138.71 us/op 1.00
phase0 processRegistryUpdates - 250000 worstcase 0.5 70.583 ms/op 59.161 ms/op 1.19
altair processRewardsAndPenalties - 250000 normalcase 15.795 ms/op 16.402 ms/op 0.96
altair processRewardsAndPenalties - 250000 worstcase 14.587 ms/op 15.903 ms/op 0.92
phase0 getAttestationDeltas - 250000 normalcase 5.6707 ms/op 5.4498 ms/op 1.04
phase0 getAttestationDeltas - 250000 worstcase 8.0512 ms/op 5.7102 ms/op 1.41
phase0 processSlashings - 250000 worstcase 62.272 us/op 62.844 us/op 0.99
altair processSyncCommitteeUpdates - 250000 11.003 ms/op 10.190 ms/op 1.08
BeaconState.hashTreeRoot - No change 176.00 ns/op 185.00 ns/op 0.95
BeaconState.hashTreeRoot - 1 full validator 95.549 us/op 75.687 us/op 1.26
BeaconState.hashTreeRoot - 32 full validator 857.95 us/op 848.90 us/op 1.01
BeaconState.hashTreeRoot - 512 full validator 9.8876 ms/op 7.3496 ms/op 1.35
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 111.20 us/op 94.518 us/op 1.18
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.4744 ms/op 1.3857 ms/op 1.06
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 21.921 ms/op 16.403 ms/op 1.34
BeaconState.hashTreeRoot - 1 balances 84.987 us/op 77.434 us/op 1.10
BeaconState.hashTreeRoot - 32 balances 755.12 us/op 747.67 us/op 1.01
BeaconState.hashTreeRoot - 512 balances 6.5504 ms/op 6.1366 ms/op 1.07
BeaconState.hashTreeRoot - 250000 balances 146.11 ms/op 177.65 ms/op 0.82
aggregationBits - 2048 els - zipIndexesInBitList 20.610 us/op 21.041 us/op 0.98
regular array get 100000 times 23.182 us/op 22.875 us/op 1.01
wrappedArray get 100000 times 23.183 us/op 22.723 us/op 1.02
arrayWithProxy get 100000 times 17.608 ms/op 9.4347 ms/op 1.87
ssz.Root.equals 75.654 ns/op 21.163 ns/op 3.57
byteArrayEquals 23.776 ns/op 21.012 ns/op 1.13
Buffer.compare 8.7340 ns/op 8.7310 ns/op 1.00
processSlot - 1 slots 10.729 us/op 11.121 us/op 0.96
processSlot - 32 slots 2.2504 ms/op 2.1526 ms/op 1.05
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 4.9463 ms/op 5.2230 ms/op 0.95
getCommitteeAssignments - req 1 vs - 250000 vc 1.6624 ms/op 1.6472 ms/op 1.01
getCommitteeAssignments - req 100 vs - 250000 vc 3.4408 ms/op 3.4105 ms/op 1.01
getCommitteeAssignments - req 1000 vs - 250000 vc 3.7171 ms/op 3.7022 ms/op 1.00
findModifiedValidators - 10000 modified validators 839.89 ms/op 862.50 ms/op 0.97
findModifiedValidators - 1000 modified validators 575.52 ms/op 555.19 ms/op 1.04
findModifiedValidators - 100 modified validators 442.43 ms/op 402.23 ms/op 1.10
findModifiedValidators - 10 modified validators 321.33 ms/op 304.77 ms/op 1.05
findModifiedValidators - 1 modified validators 227.27 ms/op 209.17 ms/op 1.09
findModifiedValidators - no difference 209.70 ms/op 232.90 ms/op 0.90
migrate state 1500000 validators, 3400 modified, 2000 new 3.3008 s/op 3.6388 s/op 0.91
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 3.8200 ns/op 3.6700 ns/op 1.04
state getBlockRootAtSlot - 250000 vs - 7PWei 416.30 ns/op 410.55 ns/op 1.01
computeProposerIndex 100000 validators 1.3969 ms/op 1.3839 ms/op 1.01
getNextSyncCommitteeIndices 1000 validators 2.9279 ms/op 2.8700 ms/op 1.02
getNextSyncCommitteeIndices 10000 validators 26.343 ms/op 25.794 ms/op 1.02
getNextSyncCommitteeIndices 100000 validators 90.526 ms/op 90.016 ms/op 1.01
computeProposers - vc 250000 558.55 us/op 566.06 us/op 0.99
computeEpochShuffling - vc 250000 40.250 ms/op 40.595 ms/op 0.99
getNextSyncCommittee - vc 250000 10.096 ms/op 9.8022 ms/op 1.03
nodejs block root to RootHex using toHex 94.225 ns/op 97.446 ns/op 0.97
nodejs block root to RootHex using toRootHex 61.495 ns/op 62.956 ns/op 0.98
nodejs fromHex(blob) 802.95 us/op 779.01 us/op 1.03
nodejs fromHexInto(blob) 623.88 us/op 618.44 us/op 1.01
nodejs block root to RootHex using the deprecated toHexString 484.99 ns/op 489.95 ns/op 0.99
nodejs byteArrayEquals 32 bytes (block root) 25.990 ns/op 26.080 ns/op 1.00
nodejs byteArrayEquals 48 bytes (pubkey) 37.670 ns/op 37.746 ns/op 1.00
nodejs byteArrayEquals 96 bytes (signature) 34.090 ns/op 34.555 ns/op 0.99
nodejs byteArrayEquals 1024 bytes 41.236 ns/op 43.425 ns/op 0.95
nodejs byteArrayEquals 131072 bytes (blob) 1.7759 us/op 1.7761 us/op 1.00
browser block root to RootHex using toHex 144.18 ns/op 146.68 ns/op 0.98
browser block root to RootHex using toRootHex 129.66 ns/op 131.25 ns/op 0.99
browser fromHex(blob) 1.6072 ms/op 1.6794 ms/op 0.96
browser fromHexInto(blob) 622.49 us/op 616.50 us/op 1.01
browser block root to RootHex using the deprecated toHexString 336.18 ns/op 330.40 ns/op 1.02
browser byteArrayEquals 32 bytes (block root) 27.604 ns/op 27.565 ns/op 1.00
browser byteArrayEquals 48 bytes (pubkey) 39.438 ns/op 38.909 ns/op 1.01
browser byteArrayEquals 96 bytes (signature) 74.134 ns/op 72.984 ns/op 1.02
browser byteArrayEquals 1024 bytes 756.84 ns/op 740.13 ns/op 1.02
browser byteArrayEquals 131072 bytes (blob) 95.680 us/op 94.128 us/op 1.02

by benchmarkbot/action

@matthewkeil
matthewkeil merged commit 92bd4ef into unstable Aug 14, 2026
26 checks passed
@matthewkeil
matthewkeil deleted the nflaig/patch-libp2p-tcp-shutdown-hang branch August 14, 2026 09:41
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Lodestar Team Coordination Aug 14, 2026
wemeetagain added a commit that referenced this pull request Aug 24, 2026
## Summary

Bump libp2p and related dependencies to the latest compatible published
versions, including the released TCP shutdown fix from
libp2p/js-libp2p#3597.

### Updated

- `libp2p`: `3.1.6` -> `3.3.9`
- `@libp2p/tcp`: `^11.0.13` -> `^11.0.27`
- `@libp2p/interface`: `^3.1.0` -> `^3.3.0`
- align the remaining direct `@libp2p/*`, reqresp, and datastore
dependencies with the compatible release set
- remove the temporary `@libp2p/tcp@11.0.13` patch and exact override
added in #9825
- refresh `pnpm-lock.yaml`

Co-authored-by: Cayman <caymannava@gmail.com>
Co-authored-by: bing <spiralladder@fastmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants