这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@nflaig
Copy link
Member

@nflaig nflaig commented Oct 8, 2025

Motivation

Conform to CL spec

Description

  • move networking constants to config
  • remove constants no longer part of spec
  • enable "p2p-interface.md" in config test

Closes #6351
Closes #7529

@nflaig
Copy link
Member Author

nflaig commented Oct 8, 2025

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is a great initiative to refactor networking configurations to align with the Consensus Layer (CL) specifications. The changes are extensive and consistently applied across the codebase, including updates to tests, which significantly improves maintainability by centralizing these constants. I've identified one minor point regarding a new configuration that could be clarified. Overall, this is a high-quality contribution.

@nflaig
Copy link
Member Author

nflaig commented Oct 8, 2025

/gemini review

// Reject ContributionAndProofs of previous slots
// for api ContributionAndProofs, we allow them to be added to the pool
if (!priority && slot < this.clock.slotWithPastTolerance(MAXIMUM_GOSSIP_CLOCK_DISPARITY)) {
if (!priority && slot < this.clock.slotWithPastTolerance(this.config.MAXIMUM_GOSSIP_CLOCK_DISPARITY / 1000)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

this was wrong before slotWithPastTolerance expects value in seconds

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This is a great pull request that refactors networking configurations to align with the Consensus Layer (CL) specifications. The changes are well-organized and consistently applied across the codebase, which significantly improves maintainability by centralizing configuration parameters. The removal of hardcoded constants in favor of values from ChainConfig is a solid improvement. All tests have been updated accordingly, and the new constant names and values appear correct. Overall, this is a high-quality contribution.

export const EPOCHS_PER_SUBNET_SUBSCRIPTION = 256;
export const ATTESTATION_SUBNET_EXTRA_BITS = 0;
export const ATTESTATION_SUBNET_PREFIX_BITS =
Math.ceil(Math.log2(ATTESTATION_SUBNET_COUNT)) + ATTESTATION_SUBNET_EXTRA_BITS;
Copy link
Member Author

Choose a reason for hiding this comment

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

The ATTESTATION_ constants are part of config as per spec but kept here since we use them in ssz containers which makes it hard to move them. We still return them from config/spec now and I don't think anyone wants to configure those.

Copy link
Member

Choose a reason for hiding this comment

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

If I had to guess, that would be an oversight/bug? Not sure if its worth updating the spec by now, but I don't think config should affect ssz container definitions.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I don't see why those are in config and likely an oversight in the spec but it's part of phase0 and I don't really feel like it's worth fixing this as it's simple for us to just keep them as constants.

@nflaig nflaig marked this pull request as ready for review October 8, 2025 12:32
@nflaig nflaig requested a review from a team as a code owner October 8, 2025 12:32
@codecov
Copy link

codecov bot commented Oct 8, 2025

Codecov Report

❌ Patch coverage is 83.14607% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.22%. Comparing base (7a240d3) to head (89bc0e3).
⚠️ Report is 9 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #8510      +/-   ##
============================================
+ Coverage     52.19%   52.22%   +0.02%     
============================================
  Files           852      852              
  Lines         65054    65082      +28     
  Branches       4771     4771              
============================================
+ Hits          33955    33986      +31     
+ Misses        31030    31027       -3     
  Partials         69       69              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2025

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 40aca91 Previous: 7a240d3 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 754.89 us/op 735.02 us/op 1.03
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 31.244 us/op 30.348 us/op 1.03
BLS verify - blst 897.86 us/op 877.58 us/op 1.02
BLS verifyMultipleSignatures 3 - blst 1.3289 ms/op 1.2933 ms/op 1.03
BLS verifyMultipleSignatures 8 - blst 2.0971 ms/op 2.0638 ms/op 1.02
BLS verifyMultipleSignatures 32 - blst 4.3728 ms/op 4.6537 ms/op 0.94
BLS verifyMultipleSignatures 64 - blst 8.3148 ms/op 8.4765 ms/op 0.98
BLS verifyMultipleSignatures 128 - blst 16.029 ms/op 15.647 ms/op 1.02
BLS deserializing 10000 signatures 624.93 ms/op 618.65 ms/op 1.01
BLS deserializing 100000 signatures 6.1979 s/op 6.1554 s/op 1.01
BLS verifyMultipleSignatures - same message - 3 - blst 940.57 us/op 869.88 us/op 1.08
BLS verifyMultipleSignatures - same message - 8 - blst 1.0715 ms/op 914.41 us/op 1.17
BLS verifyMultipleSignatures - same message - 32 - blst 1.6864 ms/op 1.6701 ms/op 1.01
BLS verifyMultipleSignatures - same message - 64 - blst 2.5531 ms/op 2.5544 ms/op 1.00
BLS verifyMultipleSignatures - same message - 128 - blst 4.1598 ms/op 4.1617 ms/op 1.00
BLS aggregatePubkeys 32 - blst 17.738 us/op 17.443 us/op 1.02
BLS aggregatePubkeys 128 - blst 62.889 us/op 61.947 us/op 1.02
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 39.074 ms/op 39.855 ms/op 0.98
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 36.466 ms/op 38.678 ms/op 0.94
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 33.580 ms/op 37.762 ms/op 0.89
getSlashingsAndExits - default max 55.702 us/op 46.901 us/op 1.19
getSlashingsAndExits - 2k 266.93 us/op 276.57 us/op 0.97
isKnown best case - 1 super set check 408.00 ns/op 406.00 ns/op 1.00
isKnown normal case - 2 super set checks 412.00 ns/op 406.00 ns/op 1.01
isKnown worse case - 16 super set checks 405.00 ns/op 405.00 ns/op 1.00
InMemoryCheckpointStateCache - add get delete 2.4790 us/op 2.4190 us/op 1.02
validate api signedAggregateAndProof - struct 2.0635 ms/op 1.5216 ms/op 1.36
validate gossip signedAggregateAndProof - struct 1.5095 ms/op 1.4925 ms/op 1.01
batch validate gossip attestation - vc 640000 - chunk 32 109.08 us/op 105.83 us/op 1.03
batch validate gossip attestation - vc 640000 - chunk 64 94.420 us/op 91.000 us/op 1.04
batch validate gossip attestation - vc 640000 - chunk 128 87.066 us/op 84.888 us/op 1.03
batch validate gossip attestation - vc 640000 - chunk 256 85.160 us/op 86.400 us/op 0.99
pickEth1Vote - no votes 810.90 us/op 807.34 us/op 1.00
pickEth1Vote - max votes 4.3166 ms/op 5.3566 ms/op 0.81
pickEth1Vote - Eth1Data hashTreeRoot value x2048 9.9227 ms/op 9.7768 ms/op 1.01
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 15.289 ms/op 14.844 ms/op 1.03
pickEth1Vote - Eth1Data fastSerialize value x2048 318.75 us/op 316.33 us/op 1.01
pickEth1Vote - Eth1Data fastSerialize tree x2048 3.5028 ms/op 2.3288 ms/op 1.50
bytes32 toHexString 488.00 ns/op 517.00 ns/op 0.94
bytes32 Buffer.toString(hex) 401.00 ns/op 431.00 ns/op 0.93
bytes32 Buffer.toString(hex) from Uint8Array 485.00 ns/op 473.00 ns/op 1.03
bytes32 Buffer.toString(hex) + 0x 422.00 ns/op 408.00 ns/op 1.03
Object access 1 prop 0.30700 ns/op 0.30100 ns/op 1.02
Map access 1 prop 0.31600 ns/op 0.31000 ns/op 1.02
Object get x1000 5.5130 ns/op 4.9380 ns/op 1.12
Map get x1000 6.2100 ns/op 5.7230 ns/op 1.09
Object set x1000 22.025 ns/op 20.928 ns/op 1.05
Map set x1000 16.675 ns/op 17.081 ns/op 0.98
Return object 10000 times 0.29330 ns/op 0.28440 ns/op 1.03
Throw Error 10000 times 3.3768 us/op 3.4689 us/op 0.97
toHex 104.76 ns/op 106.74 ns/op 0.98
Buffer.from 97.169 ns/op 99.062 ns/op 0.98
shared Buffer 68.747 ns/op 69.654 ns/op 0.99
fastMsgIdFn sha256 / 200 bytes 1.9730 us/op 1.9400 us/op 1.02
fastMsgIdFn h32 xxhash / 200 bytes 375.00 ns/op 378.00 ns/op 0.99
fastMsgIdFn h64 xxhash / 200 bytes 428.00 ns/op 442.00 ns/op 0.97
fastMsgIdFn sha256 / 1000 bytes 5.8920 us/op 5.7420 us/op 1.03
fastMsgIdFn h32 xxhash / 1000 bytes 494.00 ns/op 509.00 ns/op 0.97
fastMsgIdFn h64 xxhash / 1000 bytes 496.00 ns/op 513.00 ns/op 0.97
fastMsgIdFn sha256 / 10000 bytes 49.739 us/op 49.448 us/op 1.01
fastMsgIdFn h32 xxhash / 10000 bytes 1.8330 us/op 1.9060 us/op 0.96
fastMsgIdFn h64 xxhash / 10000 bytes 1.3170 us/op 1.3330 us/op 0.99
send data - 1000 256B messages 11.696 ms/op 12.262 ms/op 0.95
send data - 1000 512B messages 14.549 ms/op 18.818 ms/op 0.77
send data - 1000 1024B messages 20.508 ms/op 24.180 ms/op 0.85
send data - 1000 1200B messages 13.825 ms/op 18.303 ms/op 0.76
send data - 1000 2048B messages 13.929 ms/op 16.047 ms/op 0.87
send data - 1000 4096B messages 16.189 ms/op 15.841 ms/op 1.02
send data - 1000 16384B messages 24.081 ms/op 23.565 ms/op 1.02
send data - 1000 65536B messages 66.172 ms/op 61.924 ms/op 1.07
enrSubnets - fastDeserialize 64 bits 988.00 ns/op 956.00 ns/op 1.03
enrSubnets - ssz BitVector 64 bits 479.00 ns/op 508.00 ns/op 0.94
enrSubnets - fastDeserialize 4 bits 316.00 ns/op 314.00 ns/op 1.01
enrSubnets - ssz BitVector 4 bits 494.00 ns/op 501.00 ns/op 0.99
prioritizePeers score -10:0 att 32-0.1 sync 2-0 200.96 us/op 196.40 us/op 1.02
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 228.65 us/op 225.91 us/op 1.01
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 370.08 us/op 398.35 us/op 0.93
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 646.59 us/op 689.37 us/op 0.94
prioritizePeers score 0:0 att 64-1 sync 4-1 783.43 us/op 829.62 us/op 0.94
array of 16000 items push then shift 1.2844 us/op 1.3035 us/op 0.99
LinkedList of 16000 items push then shift 6.2430 ns/op 6.9960 ns/op 0.89
array of 16000 items push then pop 60.068 ns/op 71.119 ns/op 0.84
LinkedList of 16000 items push then pop 6.1090 ns/op 6.3480 ns/op 0.96
array of 24000 items push then shift 1.8645 us/op 1.9132 us/op 0.97
LinkedList of 24000 items push then shift 6.2640 ns/op 6.4360 ns/op 0.97
array of 24000 items push then pop 83.727 ns/op 96.367 ns/op 0.87
LinkedList of 24000 items push then pop 6.1700 ns/op 6.3250 ns/op 0.98
intersect bitArray bitLen 8 5.3320 ns/op 5.4210 ns/op 0.98
intersect array and set length 8 33.058 ns/op 32.343 ns/op 1.02
intersect bitArray bitLen 128 26.084 ns/op 26.411 ns/op 0.99
intersect array and set length 128 546.90 ns/op 549.38 ns/op 1.00
bitArray.getTrueBitIndexes() bitLen 128 1.1000 us/op 1.1510 us/op 0.96
bitArray.getTrueBitIndexes() bitLen 248 1.7480 us/op 1.8260 us/op 0.96
bitArray.getTrueBitIndexes() bitLen 512 3.2210 us/op 3.2610 us/op 0.99
Buffer.concat 32 items 775.00 ns/op 805.00 ns/op 0.96
Uint8Array.set 32 items 1.0580 us/op 1.0750 us/op 0.98
Buffer.copy 1.8970 us/op 2.0560 us/op 0.92
Uint8Array.set - with subarray 1.5500 us/op 1.7030 us/op 0.91
Uint8Array.set - without subarray 970.00 ns/op 1.0990 us/op 0.88
getUint32 - dataview 371.00 ns/op 373.00 ns/op 0.99
getUint32 - manual 308.00 ns/op 308.00 ns/op 1.00
Set add up to 64 items then delete first 1.8503 us/op 1.8643 us/op 0.99
OrderedSet add up to 64 items then delete first 2.8965 us/op 2.6891 us/op 1.08
Set add up to 64 items then delete last 2.1115 us/op 2.1219 us/op 1.00
OrderedSet add up to 64 items then delete last 3.1967 us/op 3.1657 us/op 1.01
Set add up to 64 items then delete middle 2.1152 us/op 2.0934 us/op 1.01
OrderedSet add up to 64 items then delete middle 4.6314 us/op 4.7098 us/op 0.98
Set add up to 128 items then delete first 4.1703 us/op 5.4324 us/op 0.77
OrderedSet add up to 128 items then delete first 6.6013 us/op 7.7723 us/op 0.85
Set add up to 128 items then delete last 4.0322 us/op 5.0391 us/op 0.80
OrderedSet add up to 128 items then delete last 6.2334 us/op 7.3626 us/op 0.85
Set add up to 128 items then delete middle 4.0458 us/op 4.8885 us/op 0.83
OrderedSet add up to 128 items then delete middle 12.266 us/op 13.099 us/op 0.94
Set add up to 256 items then delete first 8.2201 us/op 8.4094 us/op 0.98
OrderedSet add up to 256 items then delete first 12.872 us/op 13.720 us/op 0.94
Set add up to 256 items then delete last 7.9544 us/op 7.8945 us/op 1.01
OrderedSet add up to 256 items then delete last 12.170 us/op 12.334 us/op 0.99
Set add up to 256 items then delete middle 7.9202 us/op 9.0827 us/op 0.87
OrderedSet add up to 256 items then delete middle 35.442 us/op 34.694 us/op 1.02
transfer serialized Status (84 B) 1.9120 us/op 1.8800 us/op 1.02
copy serialized Status (84 B) 1.1810 us/op 1.1610 us/op 1.02
transfer serialized SignedVoluntaryExit (112 B) 1.9440 us/op 1.8920 us/op 1.03
copy serialized SignedVoluntaryExit (112 B) 1.1870 us/op 1.1620 us/op 1.02
transfer serialized ProposerSlashing (416 B) 1.9680 us/op 1.9230 us/op 1.02
copy serialized ProposerSlashing (416 B) 1.2250 us/op 1.2980 us/op 0.94
transfer serialized Attestation (485 B) 1.9970 us/op 1.9310 us/op 1.03
copy serialized Attestation (485 B) 1.2480 us/op 1.2120 us/op 1.03
transfer serialized AttesterSlashing (33232 B) 2.0670 us/op 1.9700 us/op 1.05
copy serialized AttesterSlashing (33232 B) 3.4530 us/op 2.4960 us/op 1.38
transfer serialized Small SignedBeaconBlock (128000 B) 2.0290 us/op 2.0440 us/op 0.99
copy serialized Small SignedBeaconBlock (128000 B) 9.9590 us/op 5.8280 us/op 1.71
transfer serialized Avg SignedBeaconBlock (200000 B) 2.2090 us/op 2.2340 us/op 0.99
copy serialized Avg SignedBeaconBlock (200000 B) 8.2190 us/op 8.3670 us/op 0.98
transfer serialized BlobsSidecar (524380 B) 2.7670 us/op 3.3240 us/op 0.83
copy serialized BlobsSidecar (524380 B) 81.952 us/op 59.937 us/op 1.37
transfer serialized Big SignedBeaconBlock (1000000 B) 3.3230 us/op 3.3340 us/op 1.00
copy serialized Big SignedBeaconBlock (1000000 B) 168.08 us/op 111.27 us/op 1.51
pass gossip attestations to forkchoice per slot 2.3378 ms/op 2.2753 ms/op 1.03
forkChoice updateHead vc 100000 bc 64 eq 0 412.95 us/op 339.36 us/op 1.22
forkChoice updateHead vc 600000 bc 64 eq 0 2.3446 ms/op 2.2615 ms/op 1.04
forkChoice updateHead vc 1000000 bc 64 eq 0 3.7726 ms/op 4.1031 ms/op 0.92
forkChoice updateHead vc 600000 bc 320 eq 0 2.3353 ms/op 2.3868 ms/op 0.98
forkChoice updateHead vc 600000 bc 1200 eq 0 2.3578 ms/op 2.3950 ms/op 0.98
forkChoice updateHead vc 600000 bc 7200 eq 0 2.6188 ms/op 2.4590 ms/op 1.07
forkChoice updateHead vc 600000 bc 64 eq 1000 9.4771 ms/op 9.2256 ms/op 1.03
forkChoice updateHead vc 600000 bc 64 eq 10000 9.3911 ms/op 9.0894 ms/op 1.03
forkChoice updateHead vc 600000 bc 64 eq 300000 11.268 ms/op 11.340 ms/op 0.99
computeDeltas 500000 validators 300 proto nodes 3.3646 ms/op 3.1208 ms/op 1.08
computeDeltas 500000 validators 1200 proto nodes 3.3584 ms/op 3.1470 ms/op 1.07
computeDeltas 500000 validators 7200 proto nodes 3.1954 ms/op 3.0695 ms/op 1.04
computeDeltas 750000 validators 300 proto nodes 4.7924 ms/op 4.5513 ms/op 1.05
computeDeltas 750000 validators 1200 proto nodes 4.7660 ms/op 4.5960 ms/op 1.04
computeDeltas 750000 validators 7200 proto nodes 5.9274 ms/op 4.5825 ms/op 1.29
computeDeltas 1400000 validators 300 proto nodes 8.7038 ms/op 8.5964 ms/op 1.01
computeDeltas 1400000 validators 1200 proto nodes 9.1455 ms/op 8.7033 ms/op 1.05
computeDeltas 1400000 validators 7200 proto nodes 9.0924 ms/op 8.8231 ms/op 1.03
computeDeltas 2100000 validators 300 proto nodes 13.463 ms/op 13.399 ms/op 1.00
computeDeltas 2100000 validators 1200 proto nodes 13.218 ms/op 12.815 ms/op 1.03
computeDeltas 2100000 validators 7200 proto nodes 13.849 ms/op 13.502 ms/op 1.03
altair processAttestation - 250000 vs - 7PWei normalcase 2.7808 ms/op 1.7983 ms/op 1.55
altair processAttestation - 250000 vs - 7PWei worstcase 3.0764 ms/op 2.5011 ms/op 1.23
altair processAttestation - setStatus - 1/6 committees join 100.52 us/op 92.713 us/op 1.08
altair processAttestation - setStatus - 1/3 committees join 193.18 us/op 186.42 us/op 1.04
altair processAttestation - setStatus - 1/2 committees join 286.65 us/op 274.44 us/op 1.04
altair processAttestation - setStatus - 2/3 committees join 345.18 us/op 348.86 us/op 0.99
altair processAttestation - setStatus - 4/5 committees join 492.75 us/op 496.19 us/op 0.99
altair processAttestation - setStatus - 100% committees join 590.70 us/op 593.13 us/op 1.00
altair processBlock - 250000 vs - 7PWei normalcase 3.3874 ms/op 4.3754 ms/op 0.77
altair processBlock - 250000 vs - 7PWei normalcase hashState 26.943 ms/op 32.568 ms/op 0.83
altair processBlock - 250000 vs - 7PWei worstcase 38.513 ms/op 38.520 ms/op 1.00
altair processBlock - 250000 vs - 7PWei worstcase hashState 90.524 ms/op 91.823 ms/op 0.99
phase0 processBlock - 250000 vs - 7PWei normalcase 2.2766 ms/op 1.7499 ms/op 1.30
phase0 processBlock - 250000 vs - 7PWei worstcase 27.319 ms/op 24.308 ms/op 1.12
altair processEth1Data - 250000 vs - 7PWei normalcase 266.16 us/op 265.18 us/op 1.00
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 5.7180 us/op 5.5180 us/op 1.04
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 37.266 us/op 35.052 us/op 1.06
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 9.6150 us/op 9.5240 us/op 1.01
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 5.9750 us/op 5.2820 us/op 1.13
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 162.22 us/op 96.619 us/op 1.68
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.4000 ms/op 1.4494 ms/op 0.97
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.8223 ms/op 1.8372 ms/op 0.99
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.8623 ms/op 1.8132 ms/op 1.03
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.7115 ms/op 3.5647 ms/op 1.04
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.8781 ms/op 2.4355 ms/op 0.77
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.7439 ms/op 3.8619 ms/op 0.97
Tree 40 250000 create 373.99 ms/op 354.88 ms/op 1.05
Tree 40 250000 get(125000) 114.22 ns/op 103.35 ns/op 1.11
Tree 40 250000 set(125000) 1.3003 us/op 1.2018 us/op 1.08
Tree 40 250000 toArray() 11.004 ms/op 17.452 ms/op 0.63
Tree 40 250000 iterate all - toArray() + loop 10.902 ms/op 17.780 ms/op 0.61
Tree 40 250000 iterate all - get(i) 47.969 ms/op 47.124 ms/op 1.02
Array 250000 create 2.0148 ms/op 2.0846 ms/op 0.97
Array 250000 clone - spread 648.79 us/op 644.50 us/op 1.01
Array 250000 get(125000) 0.57400 ns/op 0.55700 ns/op 1.03
Array 250000 set(125000) 0.59300 ns/op 0.57700 ns/op 1.03
Array 250000 iterate all - loop 77.377 us/op 97.667 us/op 0.79
phase0 afterProcessEpoch - 250000 vs - 7PWei 38.609 ms/op 36.897 ms/op 1.05
Array.fill - length 1000000 2.5257 ms/op 2.6158 ms/op 0.97
Array push - length 1000000 9.5195 ms/op 11.253 ms/op 0.85
Array.get 0.26286 ns/op 0.24939 ns/op 1.05
Uint8Array.get 0.34609 ns/op 0.39763 ns/op 0.87
phase0 beforeProcessEpoch - 250000 vs - 7PWei 13.277 ms/op 21.616 ms/op 0.61
altair processEpoch - mainnet_e81889 197.89 ms/op 287.59 ms/op 0.69
mainnet_e81889 - altair beforeProcessEpoch 14.276 ms/op 14.257 ms/op 1.00
mainnet_e81889 - altair processJustificationAndFinalization 4.4200 us/op 4.5890 us/op 0.96
mainnet_e81889 - altair processInactivityUpdates 3.4961 ms/op 3.6075 ms/op 0.97
mainnet_e81889 - altair processRewardsAndPenalties 39.936 ms/op 43.850 ms/op 0.91
mainnet_e81889 - altair processRegistryUpdates 829.00 ns/op 886.00 ns/op 0.94
mainnet_e81889 - altair processSlashings 391.00 ns/op 401.00 ns/op 0.98
mainnet_e81889 - altair processEth1DataReset 386.00 ns/op 396.00 ns/op 0.97
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.0248 ms/op 1.0721 ms/op 0.96
mainnet_e81889 - altair processSlashingsReset 1.1830 us/op 1.0160 us/op 1.16
mainnet_e81889 - altair processRandaoMixesReset 1.2910 us/op 1.2380 us/op 1.04
mainnet_e81889 - altair processHistoricalRootsUpdate 377.00 ns/op 396.00 ns/op 0.95
mainnet_e81889 - altair processParticipationFlagUpdates 689.00 ns/op 703.00 ns/op 0.98
mainnet_e81889 - altair processSyncCommitteeUpdates 355.00 ns/op 357.00 ns/op 0.99
mainnet_e81889 - altair afterProcessEpoch 38.963 ms/op 39.190 ms/op 0.99
capella processEpoch - mainnet_e217614 944.60 ms/op 931.41 ms/op 1.01
mainnet_e217614 - capella beforeProcessEpoch 59.037 ms/op 61.006 ms/op 0.97
mainnet_e217614 - capella processJustificationAndFinalization 4.2870 us/op 5.5660 us/op 0.77
mainnet_e217614 - capella processInactivityUpdates 11.086 ms/op 11.733 ms/op 0.94
mainnet_e217614 - capella processRewardsAndPenalties 190.23 ms/op 192.11 ms/op 0.99
mainnet_e217614 - capella processRegistryUpdates 5.3860 us/op 5.6990 us/op 0.95
mainnet_e217614 - capella processSlashings 395.00 ns/op 417.00 ns/op 0.95
mainnet_e217614 - capella processEth1DataReset 394.00 ns/op 389.00 ns/op 1.01
mainnet_e217614 - capella processEffectiveBalanceUpdates 3.5145 ms/op 3.8615 ms/op 0.91
mainnet_e217614 - capella processSlashingsReset 1.0150 us/op 1.1690 us/op 0.87
mainnet_e217614 - capella processRandaoMixesReset 1.2780 us/op 1.2510 us/op 1.02
mainnet_e217614 - capella processHistoricalRootsUpdate 395.00 ns/op 405.00 ns/op 0.98
mainnet_e217614 - capella processParticipationFlagUpdates 692.00 ns/op 699.00 ns/op 0.99
mainnet_e217614 - capella afterProcessEpoch 104.83 ms/op 106.61 ms/op 0.98
phase0 processEpoch - mainnet_e58758 306.66 ms/op 312.83 ms/op 0.98
mainnet_e58758 - phase0 beforeProcessEpoch 66.578 ms/op 89.361 ms/op 0.75
mainnet_e58758 - phase0 processJustificationAndFinalization 4.4740 us/op 5.3640 us/op 0.83
mainnet_e58758 - phase0 processRewardsAndPenalties 38.462 ms/op 39.460 ms/op 0.97
mainnet_e58758 - phase0 processRegistryUpdates 4.7630 us/op 2.8390 us/op 1.68
mainnet_e58758 - phase0 processSlashings 400.00 ns/op 400.00 ns/op 1.00
mainnet_e58758 - phase0 processEth1DataReset 384.00 ns/op 409.00 ns/op 0.94
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 942.01 us/op 988.96 us/op 0.95
mainnet_e58758 - phase0 processSlashingsReset 1.1090 us/op 1.2470 us/op 0.89
mainnet_e58758 - phase0 processRandaoMixesReset 1.3050 us/op 1.3100 us/op 1.00
mainnet_e58758 - phase0 processHistoricalRootsUpdate 398.00 ns/op 412.00 ns/op 0.97
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.2090 us/op 1.3360 us/op 0.90
mainnet_e58758 - phase0 afterProcessEpoch 32.955 ms/op 33.983 ms/op 0.97
phase0 processEffectiveBalanceUpdates - 250000 normalcase 971.86 us/op 1.0023 ms/op 0.97
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.3934 ms/op 1.5316 ms/op 0.91
altair processInactivityUpdates - 250000 normalcase 18.181 ms/op 18.662 ms/op 0.97
altair processInactivityUpdates - 250000 worstcase 18.807 ms/op 19.646 ms/op 0.96
phase0 processRegistryUpdates - 250000 normalcase 5.1110 us/op 8.4700 us/op 0.60
phase0 processRegistryUpdates - 250000 badcase_full_deposits 281.85 us/op 422.41 us/op 0.67
phase0 processRegistryUpdates - 250000 worstcase 0.5 102.11 ms/op 98.254 ms/op 1.04
altair processRewardsAndPenalties - 250000 normalcase 24.207 ms/op 22.536 ms/op 1.07
altair processRewardsAndPenalties - 250000 worstcase 27.300 ms/op 24.038 ms/op 1.14
phase0 getAttestationDeltas - 250000 normalcase 4.7608 ms/op 6.3321 ms/op 0.75
phase0 getAttestationDeltas - 250000 worstcase 5.6357 ms/op 4.9588 ms/op 1.14
phase0 processSlashings - 250000 worstcase 93.752 us/op 97.500 us/op 0.96
altair processSyncCommitteeUpdates - 250000 9.4909 ms/op 10.371 ms/op 0.92
BeaconState.hashTreeRoot - No change 444.00 ns/op 442.00 ns/op 1.00
BeaconState.hashTreeRoot - 1 full validator 72.113 us/op 60.377 us/op 1.19
BeaconState.hashTreeRoot - 32 full validator 760.11 us/op 738.50 us/op 1.03
BeaconState.hashTreeRoot - 512 full validator 7.9011 ms/op 7.4506 ms/op 1.06
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 82.558 us/op 73.570 us/op 1.12
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.2184 ms/op 1.1760 ms/op 1.04
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 16.655 ms/op 17.506 ms/op 0.95
BeaconState.hashTreeRoot - 1 balances 76.388 us/op 61.109 us/op 1.25
BeaconState.hashTreeRoot - 32 balances 756.11 us/op 538.80 us/op 1.40
BeaconState.hashTreeRoot - 512 balances 6.7526 ms/op 5.5251 ms/op 1.22
BeaconState.hashTreeRoot - 250000 balances 170.90 ms/op 106.88 ms/op 1.60
aggregationBits - 2048 els - zipIndexesInBitList 19.948 us/op 17.346 us/op 1.15
byteArrayEquals 32 45.869 ns/op 42.493 ns/op 1.08
Buffer.compare 32 14.703 ns/op 16.086 ns/op 0.91
byteArrayEquals 1024 1.2162 us/op 1.2720 us/op 0.96
Buffer.compare 1024 23.050 ns/op 23.230 ns/op 0.99
byteArrayEquals 16384 19.271 us/op 19.951 us/op 0.97
Buffer.compare 16384 185.94 ns/op 166.26 ns/op 1.12
byteArrayEquals 123687377 151.21 ms/op 142.37 ms/op 1.06
Buffer.compare 123687377 5.3395 ms/op 5.2725 ms/op 1.01
byteArrayEquals 32 - diff last byte 42.747 ns/op 39.493 ns/op 1.08
Buffer.compare 32 - diff last byte 15.005 ns/op 14.535 ns/op 1.03
byteArrayEquals 1024 - diff last byte 1.2752 us/op 1.1813 us/op 1.08
Buffer.compare 1024 - diff last byte 22.392 ns/op 22.484 ns/op 1.00
byteArrayEquals 16384 - diff last byte 19.397 us/op 18.796 us/op 1.03
Buffer.compare 16384 - diff last byte 190.28 ns/op 152.27 ns/op 1.25
byteArrayEquals 123687377 - diff last byte 154.53 ms/op 142.65 ms/op 1.08
Buffer.compare 123687377 - diff last byte 4.3956 ms/op 4.6485 ms/op 0.95
byteArrayEquals 32 - random bytes 4.9090 ns/op 4.8270 ns/op 1.02
Buffer.compare 32 - random bytes 16.841 ns/op 16.061 ns/op 1.05
byteArrayEquals 1024 - random bytes 4.8890 ns/op 4.8000 ns/op 1.02
Buffer.compare 1024 - random bytes 17.038 ns/op 16.484 ns/op 1.03
byteArrayEquals 16384 - random bytes 4.9240 ns/op 4.8100 ns/op 1.02
Buffer.compare 16384 - random bytes 17.027 ns/op 17.087 ns/op 1.00
byteArrayEquals 123687377 - random bytes 7.7200 ns/op 7.5800 ns/op 1.02
Buffer.compare 123687377 - random bytes 21.060 ns/op 17.240 ns/op 1.22
regular array get 100000 times 30.991 us/op 38.294 us/op 0.81
wrappedArray get 100000 times 30.997 us/op 39.997 us/op 0.77
arrayWithProxy get 100000 times 9.3747 ms/op 8.5928 ms/op 1.09
ssz.Root.equals 44.465 ns/op 37.735 ns/op 1.18
byteArrayEquals 43.579 ns/op 37.156 ns/op 1.17
Buffer.compare 9.9000 ns/op 8.5800 ns/op 1.15
processSlot - 1 slots 9.1540 us/op 10.509 us/op 0.87
processSlot - 32 slots 2.0970 ms/op 2.6626 ms/op 0.79
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 2.2144 ms/op 3.0323 ms/op 0.73
getCommitteeAssignments - req 1 vs - 250000 vc 1.8461 ms/op 1.7019 ms/op 1.08
getCommitteeAssignments - req 100 vs - 250000 vc 3.5850 ms/op 3.3666 ms/op 1.06
getCommitteeAssignments - req 1000 vs - 250000 vc 3.8211 ms/op 3.5876 ms/op 1.07
findModifiedValidators - 10000 modified validators 789.59 ms/op 750.54 ms/op 1.05
findModifiedValidators - 1000 modified validators 692.49 ms/op 627.21 ms/op 1.10
findModifiedValidators - 100 modified validators 249.05 ms/op 154.77 ms/op 1.61
findModifiedValidators - 10 modified validators 128.66 ms/op 159.03 ms/op 0.81
findModifiedValidators - 1 modified validators 126.72 ms/op 124.64 ms/op 1.02
findModifiedValidators - no difference 135.07 ms/op 143.54 ms/op 0.94
compare ViewDUs 6.2376 s/op 5.9384 s/op 1.05
compare each validator Uint8Array 2.1812 s/op 1.3543 s/op 1.61
compare ViewDU to Uint8Array 863.96 ms/op 699.01 ms/op 1.24
migrate state 1000000 validators, 24 modified, 0 new 823.32 ms/op 845.25 ms/op 0.97
migrate state 1000000 validators, 1700 modified, 1000 new 1.0943 s/op 1.0788 s/op 1.01
migrate state 1000000 validators, 3400 modified, 2000 new 1.2758 s/op 1.2775 s/op 1.00
migrate state 1500000 validators, 24 modified, 0 new 796.84 ms/op 924.20 ms/op 0.86
migrate state 1500000 validators, 1700 modified, 1000 new 1.0368 s/op 1.2660 s/op 0.82
migrate state 1500000 validators, 3400 modified, 2000 new 1.2394 s/op 1.6480 s/op 0.75
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.8300 ns/op 8.8800 ns/op 0.66
state getBlockRootAtSlot - 250000 vs - 7PWei 465.97 ns/op 456.70 ns/op 1.02
naive computeProposerIndex 100000 validators 40.857 ms/op 44.739 ms/op 0.91
computeProposerIndex 100000 validators 1.3323 ms/op 1.3148 ms/op 1.01
naiveGetNextSyncCommitteeIndices 1000 validators 6.2365 s/op 6.7735 s/op 0.92
getNextSyncCommitteeIndices 1000 validators 95.932 ms/op 97.573 ms/op 0.98
naiveGetNextSyncCommitteeIndices 10000 validators 6.6129 s/op 7.2091 s/op 0.92
getNextSyncCommitteeIndices 10000 validators 91.828 ms/op 98.637 ms/op 0.93
naiveGetNextSyncCommitteeIndices 100000 validators 6.6714 s/op 6.3033 s/op 1.06
getNextSyncCommitteeIndices 100000 validators 100.70 ms/op 97.254 ms/op 1.04
naive computeShuffledIndex 100000 validators 22.999 s/op 19.751 s/op 1.16
cached computeShuffledIndex 100000 validators 490.41 ms/op 450.54 ms/op 1.09
naive computeShuffledIndex 2000000 validators 393.95 s/op 447.10 s/op 0.88
cached computeShuffledIndex 2000000 validators 28.530 s/op 14.655 s/op 1.95
computeProposers - vc 250000 550.86 us/op 545.95 us/op 1.01
computeEpochShuffling - vc 250000 38.875 ms/op 38.782 ms/op 1.00
getNextSyncCommittee - vc 250000 9.4932 ms/op 9.1973 ms/op 1.03
computeSigningRoot for AttestationData 20.600 us/op 18.664 us/op 1.10
hash AttestationData serialized data then Buffer.toString(base64) 1.2120 us/op 1.1211 us/op 1.08
toHexString serialized data 1.1050 us/op 904.52 ns/op 1.22
Buffer.toString(base64) 112.68 ns/op 109.00 ns/op 1.03
nodejs block root to RootHex using toHex 103.13 ns/op 110.42 ns/op 0.93
nodejs block root to RootHex using toRootHex 70.090 ns/op 75.040 ns/op 0.93
nodejs fromhex(blob) 101.69 ms/op 93.853 ms/op 1.08
nodejs fromHexInto(blob) 80.574 ms/op 78.390 ms/op 1.03
browser block root to RootHex using the deprecated toHexString 190.13 ns/op 189.70 ns/op 1.00
browser block root to RootHex using toHex 157.25 ns/op 149.81 ns/op 1.05
browser block root to RootHex using toRootHex 146.56 ns/op 138.07 ns/op 1.06
browser fromHexInto(blob) 720.61 us/op 624.79 us/op 1.15
browser fromHex(blob) 693.44 ms/op 610.91 ms/op 1.14

by benchmarkbot/action

@nflaig nflaig merged commit 598c1ec into unstable Oct 13, 2025
25 of 32 checks passed
@nflaig nflaig deleted the nflaig/network-config branch October 13, 2025 13:44
AbolareRoheemah pushed a commit to AbolareRoheemah/lodestar that referenced this pull request Oct 14, 2025
**Motivation**

Conform to CL spec

**Description**

- move networking constants to config
- remove constants no longer part of spec
- enable "p2p-interface.md" in config test

Closes ChainSafe#6351
Closes ChainSafe#7529
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.36.0 🎉

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.

Mainnet configuration values missing from API spec output Support all network configs

3 participants