Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make MAX_REQUEST_BLOB_SIDECARS and MAX_BLOBS_PER_BLOCK configurable #7294

Merged
merged 5 commits into from
Dec 13, 2024

Conversation

ensi321
Copy link
Contributor

@ensi321 ensi321 commented Dec 13, 2024

We need to make these two parameters configurable before we implement EIP-7691

  • Any function that needs access to MAX_BLOBS_PER_BLOCK will need to have config passed in
  • Move BlobSidecarsByRootRequest out of packages/types to packages/beacon-node since it is now "dynamic' depending on config.MAX_REQUEST_BLOB_SIDECARS.
  • Any method with ssz response type BlobSidecarsByRootRequest will need to access config.

Closes #7172

@ensi321 ensi321 requested a review from a team as a code owner December 13, 2024 01:59
@ensi321 ensi321 changed the title feat: make MAX_REQUEST_BLOB_SIDECARS and MAX_BLOBS_PER_BLOCK configurable refactor: make MAX_REQUEST_BLOB_SIDECARS and MAX_BLOBS_PER_BLOCK configurable Dec 13, 2024
@ensi321 ensi321 changed the title refactor: make MAX_REQUEST_BLOB_SIDECARS and MAX_BLOBS_PER_BLOCK configurable feat: make MAX_REQUEST_BLOB_SIDECARS and MAX_BLOBS_PER_BLOCK configurable Dec 13, 2024
Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 44.64286% with 31 lines in your changes missing coverage. Please review.

Project coverage is 48.76%. Comparing base (99794d3) to head (7fa6d9c).
Report is 2 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #7294      +/-   ##
============================================
- Coverage     48.91%   48.76%   -0.15%     
============================================
  Files           601      601              
  Lines         40188    40195       +7     
  Branches       2061     2061              
============================================
- Hits          19658    19602      -56     
- Misses        20492    20555      +63     
  Partials         38       38              

Copy link
Contributor

github-actions bot commented Dec 13, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: ac1a175 Previous: 99794d3 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.7798 ms/op 2.1367 ms/op 0.83
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 39.586 us/op 52.834 us/op 0.75
BLS verify - blst 882.69 us/op 1.0209 ms/op 0.86
BLS verifyMultipleSignatures 3 - blst 1.3327 ms/op 1.5870 ms/op 0.84
BLS verifyMultipleSignatures 8 - blst 2.1727 ms/op 2.0045 ms/op 1.08
BLS verifyMultipleSignatures 32 - blst 4.4964 ms/op 6.0829 ms/op 0.74
BLS verifyMultipleSignatures 64 - blst 8.3508 ms/op 11.431 ms/op 0.73
BLS verifyMultipleSignatures 128 - blst 16.379 ms/op 17.863 ms/op 0.92
BLS deserializing 10000 signatures 623.59 ms/op 707.37 ms/op 0.88
BLS deserializing 100000 signatures 6.1000 s/op 7.0437 s/op 0.87
BLS verifyMultipleSignatures - same message - 3 - blst 960.12 us/op 1.0103 ms/op 0.95
BLS verifyMultipleSignatures - same message - 8 - blst 1.0946 ms/op 1.0538 ms/op 1.04
BLS verifyMultipleSignatures - same message - 32 - blst 1.7004 ms/op 1.8970 ms/op 0.90
BLS verifyMultipleSignatures - same message - 64 - blst 2.5073 ms/op 2.7941 ms/op 0.90
BLS verifyMultipleSignatures - same message - 128 - blst 4.0673 ms/op 4.3489 ms/op 0.94
BLS aggregatePubkeys 32 - blst 17.816 us/op 20.752 us/op 0.86
BLS aggregatePubkeys 128 - blst 61.912 us/op 71.782 us/op 0.86
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 48.643 ms/op 69.835 ms/op 0.70
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 49.433 ms/op 75.671 ms/op 0.65
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 40.563 ms/op 61.302 ms/op 0.66
getSlashingsAndExits - default max 65.390 us/op 105.56 us/op 0.62
getSlashingsAndExits - 2k 261.13 us/op 327.04 us/op 0.80
proposeBlockBody type=full, size=empty 5.0686 ms/op 6.4051 ms/op 0.79
isKnown best case - 1 super set check 492.00 ns/op 313.00 ns/op 1.57
isKnown normal case - 2 super set checks 480.00 ns/op 305.00 ns/op 1.57
isKnown worse case - 16 super set checks 471.00 ns/op 343.00 ns/op 1.37
InMemoryCheckpointStateCache - add get delete 3.0010 us/op 2.9530 us/op 1.02
validate api signedAggregateAndProof - struct 1.7276 ms/op 1.5933 ms/op 1.08
validate gossip signedAggregateAndProof - struct 1.4264 ms/op 2.5475 ms/op 0.56
batch validate gossip attestation - vc 640000 - chunk 32 122.27 us/op 140.06 us/op 0.87
batch validate gossip attestation - vc 640000 - chunk 64 104.35 us/op 120.14 us/op 0.87
batch validate gossip attestation - vc 640000 - chunk 128 95.765 us/op 128.59 us/op 0.74
batch validate gossip attestation - vc 640000 - chunk 256 89.844 us/op 116.50 us/op 0.77
pickEth1Vote - no votes 827.06 us/op 1.0723 ms/op 0.77
pickEth1Vote - max votes 4.4267 ms/op 6.1472 ms/op 0.72
pickEth1Vote - Eth1Data hashTreeRoot value x2048 9.2024 ms/op 12.793 ms/op 0.72
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 13.438 ms/op 20.314 ms/op 0.66
pickEth1Vote - Eth1Data fastSerialize value x2048 339.11 us/op 552.41 us/op 0.61
pickEth1Vote - Eth1Data fastSerialize tree x2048 1.8120 ms/op 3.1602 ms/op 0.57
bytes32 toHexString 578.00 ns/op 524.00 ns/op 1.10
bytes32 Buffer.toString(hex) 415.00 ns/op 272.00 ns/op 1.53
bytes32 Buffer.toString(hex) from Uint8Array 524.00 ns/op 452.00 ns/op 1.16
bytes32 Buffer.toString(hex) + 0x 432.00 ns/op 272.00 ns/op 1.59
Object access 1 prop 0.34100 ns/op 0.15400 ns/op 2.21
Map access 1 prop 0.32200 ns/op 0.13900 ns/op 2.32
Object get x1000 4.8190 ns/op 6.1020 ns/op 0.79
Map get x1000 5.7090 ns/op 6.4950 ns/op 0.88
Object set x1000 25.616 ns/op 40.753 ns/op 0.63
Map set x1000 19.567 ns/op 23.581 ns/op 0.83
Return object 10000 times 0.29530 ns/op 0.30170 ns/op 0.98
Throw Error 10000 times 2.7021 us/op 3.4509 us/op 0.78
toHex 116.26 ns/op 165.37 ns/op 0.70
Buffer.from 106.07 ns/op 150.31 ns/op 0.71
shared Buffer 73.048 ns/op 88.094 ns/op 0.83
fastMsgIdFn sha256 / 200 bytes 1.9770 us/op 2.2040 us/op 0.90
fastMsgIdFn h32 xxhash / 200 bytes 432.00 ns/op 249.00 ns/op 1.73
fastMsgIdFn h64 xxhash / 200 bytes 455.00 ns/op 272.00 ns/op 1.67
fastMsgIdFn sha256 / 1000 bytes 5.7930 us/op 7.6630 us/op 0.76
fastMsgIdFn h32 xxhash / 1000 bytes 567.00 ns/op 359.00 ns/op 1.58
fastMsgIdFn h64 xxhash / 1000 bytes 530.00 ns/op 338.00 ns/op 1.57
fastMsgIdFn sha256 / 10000 bytes 49.218 us/op 62.467 us/op 0.79
fastMsgIdFn h32 xxhash / 10000 bytes 1.9020 us/op 1.7910 us/op 1.06
fastMsgIdFn h64 xxhash / 10000 bytes 1.3290 us/op 1.1750 us/op 1.13
send data - 1000 256B messages 10.135 ms/op 13.365 ms/op 0.76
send data - 1000 512B messages 12.988 ms/op 16.083 ms/op 0.81
send data - 1000 1024B messages 23.373 ms/op 25.447 ms/op 0.92
send data - 1000 1200B messages 23.745 ms/op 26.663 ms/op 0.89
send data - 1000 2048B messages 28.455 ms/op 33.173 ms/op 0.86
send data - 1000 4096B messages 28.099 ms/op 32.352 ms/op 0.87
send data - 1000 16384B messages 69.345 ms/op 75.458 ms/op 0.92
send data - 1000 65536B messages 295.40 ms/op 198.69 ms/op 1.49
enrSubnets - fastDeserialize 64 bits 1.2680 us/op 1.0580 us/op 1.20
enrSubnets - ssz BitVector 64 bits 565.00 ns/op 362.00 ns/op 1.56
enrSubnets - fastDeserialize 4 bits 345.00 ns/op 153.00 ns/op 2.25
enrSubnets - ssz BitVector 4 bits 541.00 ns/op 355.00 ns/op 1.52
prioritizePeers score -10:0 att 32-0.1 sync 2-0 122.61 us/op 150.20 us/op 0.82
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 135.67 us/op 193.84 us/op 0.70
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 364.71 us/op 292.00 us/op 1.25
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 481.35 us/op 562.01 us/op 0.86
prioritizePeers score 0:0 att 64-1 sync 4-1 680.66 us/op 813.44 us/op 0.84
array of 16000 items push then shift 1.3883 us/op 1.6706 us/op 0.83
LinkedList of 16000 items push then shift 7.0490 ns/op 7.3140 ns/op 0.96
array of 16000 items push then pop 91.266 ns/op 126.66 ns/op 0.72
LinkedList of 16000 items push then pop 6.6120 ns/op 7.0540 ns/op 0.94
array of 24000 items push then shift 2.1093 us/op 2.4939 us/op 0.85
LinkedList of 24000 items push then shift 6.8340 ns/op 7.6070 ns/op 0.90
array of 24000 items push then pop 117.01 ns/op 153.39 ns/op 0.76
LinkedList of 24000 items push then pop 6.3130 ns/op 7.5100 ns/op 0.84
intersect bitArray bitLen 8 7.0270 ns/op 6.5340 ns/op 1.08
intersect array and set length 8 44.668 ns/op 60.650 ns/op 0.74
intersect bitArray bitLen 128 30.391 ns/op 29.489 ns/op 1.03
intersect array and set length 128 606.76 ns/op 734.54 ns/op 0.83
bitArray.getTrueBitIndexes() bitLen 128 1.5840 us/op 2.3350 us/op 0.68
bitArray.getTrueBitIndexes() bitLen 248 2.8670 us/op 4.2000 us/op 0.68
bitArray.getTrueBitIndexes() bitLen 512 5.8540 us/op 8.2570 us/op 0.71
Buffer.concat 32 items 1.1240 us/op 1.0120 us/op 1.11
Uint8Array.set 32 items 2.2340 us/op 2.1700 us/op 1.03
Buffer.copy 1.9580 us/op 2.0970 us/op 0.93
Uint8Array.set - with subarray 2.3610 us/op 3.2420 us/op 0.73
Uint8Array.set - without subarray 1.6160 us/op 2.0460 us/op 0.79
getUint32 - dataview 496.00 ns/op 285.00 ns/op 1.74
getUint32 - manual 489.00 ns/op 204.00 ns/op 2.40
Set add up to 64 items then delete first 1.8255 us/op 2.4318 us/op 0.75
OrderedSet add up to 64 items then delete first 2.8437 us/op 3.8953 us/op 0.73
Set add up to 64 items then delete last 2.1116 us/op 3.2553 us/op 0.65
OrderedSet add up to 64 items then delete last 3.2172 us/op 5.1187 us/op 0.63
Set add up to 64 items then delete middle 2.1682 us/op 3.1542 us/op 0.69
OrderedSet add up to 64 items then delete middle 4.5673 us/op 6.5177 us/op 0.70
Set add up to 128 items then delete first 4.1952 us/op 5.2697 us/op 0.80
OrderedSet add up to 128 items then delete first 7.2518 us/op 7.4923 us/op 0.97
Set add up to 128 items then delete last 4.1929 us/op 5.3564 us/op 0.78
OrderedSet add up to 128 items then delete last 6.3363 us/op 8.0202 us/op 0.79
Set add up to 128 items then delete middle 4.1672 us/op 5.0520 us/op 0.82
OrderedSet add up to 128 items then delete middle 13.849 us/op 13.766 us/op 1.01
Set add up to 256 items then delete first 8.1283 us/op 10.716 us/op 0.76
OrderedSet add up to 256 items then delete first 13.146 us/op 16.761 us/op 0.78
Set add up to 256 items then delete last 7.7687 us/op 11.774 us/op 0.66
OrderedSet add up to 256 items then delete last 11.980 us/op 17.543 us/op 0.68
Set add up to 256 items then delete middle 7.7538 us/op 10.361 us/op 0.75
OrderedSet add up to 256 items then delete middle 34.749 us/op 41.821 us/op 0.83
transfer serialized Status (84 B) 1.3820 us/op 1.3980 us/op 0.99
copy serialized Status (84 B) 1.3180 us/op 1.1010 us/op 1.20
transfer serialized SignedVoluntaryExit (112 B) 1.6400 us/op 1.4300 us/op 1.15
copy serialized SignedVoluntaryExit (112 B) 1.4450 us/op 1.2500 us/op 1.16
transfer serialized ProposerSlashing (416 B) 2.0170 us/op 1.6020 us/op 1.26
copy serialized ProposerSlashing (416 B) 2.0620 us/op 1.6230 us/op 1.27
transfer serialized Attestation (485 B) 1.6550 us/op 1.7070 us/op 0.97
copy serialized Attestation (485 B) 1.9500 us/op 1.5160 us/op 1.29
transfer serialized AttesterSlashing (33232 B) 2.0190 us/op 2.7440 us/op 0.74
copy serialized AttesterSlashing (33232 B) 9.4530 us/op 6.9820 us/op 1.35
transfer serialized Small SignedBeaconBlock (128000 B) 2.8480 us/op 3.3140 us/op 0.86
copy serialized Small SignedBeaconBlock (128000 B) 30.286 us/op 17.504 us/op 1.73
transfer serialized Avg SignedBeaconBlock (200000 B) 3.7440 us/op 3.5390 us/op 1.06
copy serialized Avg SignedBeaconBlock (200000 B) 50.958 us/op 26.331 us/op 1.94
transfer serialized BlobsSidecar (524380 B) 6.3610 us/op 3.0430 us/op 2.09
copy serialized BlobsSidecar (524380 B) 180.65 us/op 75.157 us/op 2.40
transfer serialized Big SignedBeaconBlock (1000000 B) 5.0000 us/op 3.1640 us/op 1.58
copy serialized Big SignedBeaconBlock (1000000 B) 321.64 us/op 178.79 us/op 1.80
pass gossip attestations to forkchoice per slot 2.7560 ms/op 2.8442 ms/op 0.97
forkChoice updateHead vc 100000 bc 64 eq 0 554.98 us/op 454.07 us/op 1.22
forkChoice updateHead vc 600000 bc 64 eq 0 2.3395 ms/op 3.1727 ms/op 0.74
forkChoice updateHead vc 1000000 bc 64 eq 0 5.4914 ms/op 5.3831 ms/op 1.02
forkChoice updateHead vc 600000 bc 320 eq 0 2.2192 ms/op 2.9000 ms/op 0.77
forkChoice updateHead vc 600000 bc 1200 eq 0 2.2865 ms/op 3.0096 ms/op 0.76
forkChoice updateHead vc 600000 bc 7200 eq 0 2.9185 ms/op 4.1364 ms/op 0.71
forkChoice updateHead vc 600000 bc 64 eq 1000 9.9062 ms/op 10.642 ms/op 0.93
forkChoice updateHead vc 600000 bc 64 eq 10000 10.842 ms/op 10.593 ms/op 1.02
forkChoice updateHead vc 600000 bc 64 eq 300000 11.858 ms/op 15.158 ms/op 0.78
computeDeltas 500000 validators 300 proto nodes 3.7634 ms/op 4.1799 ms/op 0.90
computeDeltas 500000 validators 1200 proto nodes 3.6863 ms/op 4.2880 ms/op 0.86
computeDeltas 500000 validators 7200 proto nodes 3.5018 ms/op 4.2920 ms/op 0.82
computeDeltas 750000 validators 300 proto nodes 5.2931 ms/op 6.1591 ms/op 0.86
computeDeltas 750000 validators 1200 proto nodes 5.3602 ms/op 6.1044 ms/op 0.88
computeDeltas 750000 validators 7200 proto nodes 5.3534 ms/op 6.2919 ms/op 0.85
computeDeltas 1400000 validators 300 proto nodes 9.6106 ms/op 11.831 ms/op 0.81
computeDeltas 1400000 validators 1200 proto nodes 9.8522 ms/op 12.157 ms/op 0.81
computeDeltas 1400000 validators 7200 proto nodes 9.6667 ms/op 12.457 ms/op 0.78
computeDeltas 2100000 validators 300 proto nodes 15.263 ms/op 18.545 ms/op 0.82
computeDeltas 2100000 validators 1200 proto nodes 14.256 ms/op 18.077 ms/op 0.79
computeDeltas 2100000 validators 7200 proto nodes 14.063 ms/op 17.864 ms/op 0.79
altair processAttestation - 250000 vs - 7PWei normalcase 1.5039 ms/op 2.1741 ms/op 0.69
altair processAttestation - 250000 vs - 7PWei worstcase 2.2177 ms/op 2.8406 ms/op 0.78
altair processAttestation - setStatus - 1/6 committees join 67.157 us/op 88.547 us/op 0.76
altair processAttestation - setStatus - 1/3 committees join 146.29 us/op 178.63 us/op 0.82
altair processAttestation - setStatus - 1/2 committees join 188.68 us/op 253.33 us/op 0.74
altair processAttestation - setStatus - 2/3 committees join 258.66 us/op 318.35 us/op 0.81
altair processAttestation - setStatus - 4/5 committees join 390.07 us/op 466.05 us/op 0.84
altair processAttestation - setStatus - 100% committees join 467.47 us/op 556.11 us/op 0.84
altair processBlock - 250000 vs - 7PWei normalcase 5.4744 ms/op 4.4770 ms/op 1.22
altair processBlock - 250000 vs - 7PWei normalcase hashState 27.155 ms/op 28.018 ms/op 0.97
altair processBlock - 250000 vs - 7PWei worstcase 38.864 ms/op 39.620 ms/op 0.98
altair processBlock - 250000 vs - 7PWei worstcase hashState 73.879 ms/op 81.854 ms/op 0.90
phase0 processBlock - 250000 vs - 7PWei normalcase 2.0428 ms/op 2.3298 ms/op 0.88
phase0 processBlock - 250000 vs - 7PWei worstcase 22.808 ms/op 25.928 ms/op 0.88
altair processEth1Data - 250000 vs - 7PWei normalcase 251.69 us/op 336.67 us/op 0.75
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 5.2680 us/op 6.9170 us/op 0.76
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 31.256 us/op 38.155 us/op 0.82
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 10.806 us/op 13.695 us/op 0.79
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 5.4640 us/op 6.7000 us/op 0.82
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 121.67 us/op 170.64 us/op 0.71
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 824.82 us/op 1.3964 ms/op 0.59
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.1806 ms/op 1.9376 ms/op 0.61
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.1205 ms/op 2.2502 ms/op 0.50
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.0838 ms/op 3.7648 ms/op 0.82
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.9483 ms/op 1.7747 ms/op 1.10
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.1777 ms/op 3.8894 ms/op 0.82
Tree 40 250000 create 181.57 ms/op 242.42 ms/op 0.75
Tree 40 250000 get(125000) 116.91 ns/op 160.95 ns/op 0.73
Tree 40 250000 set(125000) 566.97 ns/op 706.80 ns/op 0.80
Tree 40 250000 toArray() 14.020 ms/op 17.146 ms/op 0.82
Tree 40 250000 iterate all - toArray() + loop 13.196 ms/op 18.148 ms/op 0.73
Tree 40 250000 iterate all - get(i) 44.811 ms/op 56.910 ms/op 0.79
Array 250000 create 2.3440 ms/op 3.2207 ms/op 0.73
Array 250000 clone - spread 1.1609 ms/op 1.3667 ms/op 0.85
Array 250000 get(125000) 0.59400 ns/op 0.44100 ns/op 1.35
Array 250000 set(125000) 0.60600 ns/op 0.45200 ns/op 1.34
Array 250000 iterate all - loop 77.445 us/op 96.023 us/op 0.81
phase0 afterProcessEpoch - 250000 vs - 7PWei 41.499 ms/op 51.613 ms/op 0.80
Array.fill - length 1000000 2.4564 ms/op 3.4402 ms/op 0.71
Array push - length 1000000 14.865 ms/op 18.810 ms/op 0.79
Array.get 0.24202 ns/op 0.29403 ns/op 0.82
Uint8Array.get 0.31797 ns/op 0.44582 ns/op 0.71
phase0 beforeProcessEpoch - 250000 vs - 7PWei 15.009 ms/op 19.139 ms/op 0.78
altair processEpoch - mainnet_e81889 255.19 ms/op 283.28 ms/op 0.90
mainnet_e81889 - altair beforeProcessEpoch 18.165 ms/op 19.319 ms/op 0.94
mainnet_e81889 - altair processJustificationAndFinalization 12.341 us/op 13.034 us/op 0.95
mainnet_e81889 - altair processInactivityUpdates 3.9272 ms/op 5.9560 ms/op 0.66
mainnet_e81889 - altair processRewardsAndPenalties 56.125 ms/op 44.413 ms/op 1.26
mainnet_e81889 - altair processRegistryUpdates 1.8730 us/op 1.8560 us/op 1.01
mainnet_e81889 - altair processSlashings 743.00 ns/op 331.00 ns/op 2.24
mainnet_e81889 - altair processEth1DataReset 678.00 ns/op 328.00 ns/op 2.07
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.6724 ms/op 1.7128 ms/op 0.98
mainnet_e81889 - altair processSlashingsReset 2.2160 us/op 2.7870 us/op 0.80
mainnet_e81889 - altair processRandaoMixesReset 2.6200 us/op 3.3520 us/op 0.78
mainnet_e81889 - altair processHistoricalRootsUpdate 692.00 ns/op 717.00 ns/op 0.97
mainnet_e81889 - altair processParticipationFlagUpdates 1.5290 us/op 2.1710 us/op 0.70
mainnet_e81889 - altair processSyncCommitteeUpdates 624.00 ns/op 443.00 ns/op 1.41
mainnet_e81889 - altair afterProcessEpoch 40.977 ms/op 52.039 ms/op 0.79
capella processEpoch - mainnet_e217614 811.37 ms/op 1.0638 s/op 0.76
mainnet_e217614 - capella beforeProcessEpoch 64.606 ms/op 69.553 ms/op 0.93
mainnet_e217614 - capella processJustificationAndFinalization 11.187 us/op 16.496 us/op 0.68
mainnet_e217614 - capella processInactivityUpdates 13.354 ms/op 17.825 ms/op 0.75
mainnet_e217614 - capella processRewardsAndPenalties 226.79 ms/op 251.80 ms/op 0.90
mainnet_e217614 - capella processRegistryUpdates 10.192 us/op 14.574 us/op 0.70
mainnet_e217614 - capella processSlashings 715.00 ns/op 524.00 ns/op 1.36
mainnet_e217614 - capella processEth1DataReset 659.00 ns/op 464.00 ns/op 1.42
mainnet_e217614 - capella processEffectiveBalanceUpdates 12.900 ms/op 14.816 ms/op 0.87
mainnet_e217614 - capella processSlashingsReset 2.0790 us/op 4.4640 us/op 0.47
mainnet_e217614 - capella processRandaoMixesReset 3.0320 us/op 4.5080 us/op 0.67
mainnet_e217614 - capella processHistoricalRootsUpdate 695.00 ns/op 505.00 ns/op 1.38
mainnet_e217614 - capella processParticipationFlagUpdates 1.2730 us/op 1.6630 us/op 0.77
mainnet_e217614 - capella afterProcessEpoch 105.23 ms/op 128.04 ms/op 0.82
phase0 processEpoch - mainnet_e58758 274.46 ms/op 357.70 ms/op 0.77
mainnet_e58758 - phase0 beforeProcessEpoch 56.504 ms/op 79.499 ms/op 0.71
mainnet_e58758 - phase0 processJustificationAndFinalization 13.775 us/op 14.853 us/op 0.93
mainnet_e58758 - phase0 processRewardsAndPenalties 25.467 ms/op 31.090 ms/op 0.82
mainnet_e58758 - phase0 processRegistryUpdates 6.6010 us/op 9.7970 us/op 0.67
mainnet_e58758 - phase0 processSlashings 750.00 ns/op 356.00 ns/op 2.11
mainnet_e58758 - phase0 processEth1DataReset 688.00 ns/op 354.00 ns/op 1.94
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 908.96 us/op 1.9338 ms/op 0.47
mainnet_e58758 - phase0 processSlashingsReset 1.4740 us/op 2.8360 us/op 0.52
mainnet_e58758 - phase0 processRandaoMixesReset 3.9810 us/op 3.9930 us/op 1.00
mainnet_e58758 - phase0 processHistoricalRootsUpdate 671.00 ns/op 336.00 ns/op 2.00
mainnet_e58758 - phase0 processParticipationRecordUpdates 2.9510 us/op 3.1070 us/op 0.95
mainnet_e58758 - phase0 afterProcessEpoch 34.106 ms/op 45.467 ms/op 0.75
phase0 processEffectiveBalanceUpdates - 250000 normalcase 961.81 us/op 2.2656 ms/op 0.42
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4363 ms/op 2.5771 ms/op 0.56
altair processInactivityUpdates - 250000 normalcase 14.584 ms/op 18.419 ms/op 0.79
altair processInactivityUpdates - 250000 worstcase 11.865 ms/op 19.396 ms/op 0.61
phase0 processRegistryUpdates - 250000 normalcase 4.4050 us/op 6.9160 us/op 0.64
phase0 processRegistryUpdates - 250000 badcase_full_deposits 307.16 us/op 331.20 us/op 0.93
phase0 processRegistryUpdates - 250000 worstcase 0.5 111.56 ms/op 123.77 ms/op 0.90
altair processRewardsAndPenalties - 250000 normalcase 38.677 ms/op 40.005 ms/op 0.97
altair processRewardsAndPenalties - 250000 worstcase 25.616 ms/op 40.810 ms/op 0.63
phase0 getAttestationDeltas - 250000 normalcase 5.9257 ms/op 8.7210 ms/op 0.68
phase0 getAttestationDeltas - 250000 worstcase 5.9244 ms/op 8.0521 ms/op 0.74
phase0 processSlashings - 250000 worstcase 80.989 us/op 117.56 us/op 0.69
altair processSyncCommitteeUpdates - 250000 91.217 ms/op 133.51 ms/op 0.68
BeaconState.hashTreeRoot - No change 435.00 ns/op 229.00 ns/op 1.90
BeaconState.hashTreeRoot - 1 full validator 73.235 us/op 93.802 us/op 0.78
BeaconState.hashTreeRoot - 32 full validator 847.55 us/op 1.1633 ms/op 0.73
BeaconState.hashTreeRoot - 512 full validator 8.5205 ms/op 10.562 ms/op 0.81
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 107.58 us/op 109.43 us/op 0.98
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.5209 ms/op 2.0024 ms/op 0.76
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 15.428 ms/op 26.430 ms/op 0.58
BeaconState.hashTreeRoot - 1 balances 84.636 us/op 129.65 us/op 0.65
BeaconState.hashTreeRoot - 32 balances 849.22 us/op 954.03 us/op 0.89
BeaconState.hashTreeRoot - 512 balances 7.1363 ms/op 8.2070 ms/op 0.87
BeaconState.hashTreeRoot - 250000 balances 130.55 ms/op 166.60 ms/op 0.78
aggregationBits - 2048 els - zipIndexesInBitList 19.623 us/op 28.768 us/op 0.68
byteArrayEquals 32 46.984 ns/op 54.937 ns/op 0.86
Buffer.compare 32 16.704 ns/op 17.388 ns/op 0.96
byteArrayEquals 1024 1.2754 us/op 1.6102 us/op 0.79
Buffer.compare 1024 24.482 ns/op 25.833 ns/op 0.95
byteArrayEquals 16384 20.231 us/op 25.942 us/op 0.78
Buffer.compare 16384 203.81 ns/op 205.39 ns/op 0.99
byteArrayEquals 123687377 151.05 ms/op 196.42 ms/op 0.77
Buffer.compare 123687377 6.0389 ms/op 8.2932 ms/op 0.73
byteArrayEquals 32 - diff last byte 45.563 ns/op 53.574 ns/op 0.85
Buffer.compare 32 - diff last byte 15.943 ns/op 17.865 ns/op 0.89
byteArrayEquals 1024 - diff last byte 1.2721 us/op 1.6240 us/op 0.78
Buffer.compare 1024 - diff last byte 24.206 ns/op 27.028 ns/op 0.90
byteArrayEquals 16384 - diff last byte 20.185 us/op 25.782 us/op 0.78
Buffer.compare 16384 - diff last byte 207.95 ns/op 206.21 ns/op 1.01
byteArrayEquals 123687377 - diff last byte 154.54 ms/op 196.59 ms/op 0.79
Buffer.compare 123687377 - diff last byte 4.5795 ms/op 8.4444 ms/op 0.54
byteArrayEquals 32 - random bytes 4.9690 ns/op 5.3290 ns/op 0.93
Buffer.compare 32 - random bytes 15.811 ns/op 17.646 ns/op 0.90
byteArrayEquals 1024 - random bytes 4.9960 ns/op 5.3700 ns/op 0.93
Buffer.compare 1024 - random bytes 20.061 ns/op 17.701 ns/op 1.13
byteArrayEquals 16384 - random bytes 4.8990 ns/op 5.3930 ns/op 0.91
Buffer.compare 16384 - random bytes 15.667 ns/op 17.686 ns/op 0.89
byteArrayEquals 123687377 - random bytes 7.9200 ns/op 6.7400 ns/op 1.18
Buffer.compare 123687377 - random bytes 18.820 ns/op 20.050 ns/op 0.94
regular array get 100000 times 30.889 us/op 34.767 us/op 0.89
wrappedArray get 100000 times 30.852 us/op 34.191 us/op 0.90
arrayWithProxy get 100000 times 9.9469 ms/op 15.376 ms/op 0.65
ssz.Root.equals 37.746 ns/op 49.467 ns/op 0.76
byteArrayEquals 41.033 ns/op 46.607 ns/op 0.88
Buffer.compare 8.5030 ns/op 10.881 ns/op 0.78
processSlot - 1 slots 16.118 us/op 16.540 us/op 0.97
processSlot - 32 slots 3.2952 ms/op 2.9831 ms/op 1.10
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 36.307 ms/op 35.797 ms/op 1.01
getCommitteeAssignments - req 1 vs - 250000 vc 1.8105 ms/op 2.2300 ms/op 0.81
getCommitteeAssignments - req 100 vs - 250000 vc 3.5828 ms/op 4.2968 ms/op 0.83
getCommitteeAssignments - req 1000 vs - 250000 vc 3.9918 ms/op 4.5424 ms/op 0.88
findModifiedValidators - 10000 modified validators 241.91 ms/op 271.85 ms/op 0.89
findModifiedValidators - 1000 modified validators 162.36 ms/op 190.10 ms/op 0.85
findModifiedValidators - 100 modified validators 160.57 ms/op 176.88 ms/op 0.91
findModifiedValidators - 10 modified validators 157.09 ms/op 151.63 ms/op 1.04
findModifiedValidators - 1 modified validators 175.88 ms/op 160.80 ms/op 1.09
findModifiedValidators - no difference 154.05 ms/op 193.05 ms/op 0.80
compare ViewDUs 3.4724 s/op 3.2735 s/op 1.06
compare each validator Uint8Array 1.4214 s/op 1.8314 s/op 0.78
compare ViewDU to Uint8Array 755.32 ms/op 1.0876 s/op 0.69
migrate state 1000000 validators, 24 modified, 0 new 671.25 ms/op 769.12 ms/op 0.87
migrate state 1000000 validators, 1700 modified, 1000 new 936.19 ms/op 1.0739 s/op 0.87
migrate state 1000000 validators, 3400 modified, 2000 new 1.1467 s/op 1.4071 s/op 0.81
migrate state 1500000 validators, 24 modified, 0 new 649.29 ms/op 864.70 ms/op 0.75
migrate state 1500000 validators, 1700 modified, 1000 new 976.18 ms/op 1.0941 s/op 0.89
migrate state 1500000 validators, 3400 modified, 2000 new 1.1662 s/op 1.2798 s/op 0.91
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 6.7700 ns/op 5.0700 ns/op 1.34
state getBlockRootAtSlot - 250000 vs - 7PWei 683.36 ns/op 672.29 ns/op 1.02
computeProposers - vc 250000 6.2909 ms/op 7.9593 ms/op 0.79
computeEpochShuffling - vc 250000 34.972 ms/op 44.043 ms/op 0.79
getNextSyncCommittee - vc 250000 111.98 ms/op 136.04 ms/op 0.82
computeSigningRoot for AttestationData 24.909 us/op 22.891 us/op 1.09
hash AttestationData serialized data then Buffer.toString(base64) 1.2275 us/op 1.6829 us/op 0.73
toHexString serialized data 810.18 ns/op 1.0694 us/op 0.76
Buffer.toString(base64) 159.14 ns/op 190.55 ns/op 0.84
nodejs block root to RootHex using toHex 135.56 ns/op 162.95 ns/op 0.83
nodejs block root to RootHex using toRootHex 82.185 ns/op 98.356 ns/op 0.84
browser block root to RootHex using the deprecated toHexString 221.89 ns/op 239.21 ns/op 0.93
browser block root to RootHex using toHex 212.46 ns/op 193.20 ns/op 1.10
browser block root to RootHex using toRootHex 158.92 ns/op 177.52 ns/op 0.90

by benchmarkbot/action

Copy link
Member

@nflaig nflaig left a comment

Choose a reason for hiding this comment

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

LGTM - there are a few more constants we should move into config but can be addressed separately

@@ -198,7 +197,6 @@ export const SYNC_COMMITTEE_SUBNET_SIZE = Math.floor(SYNC_COMMITTEE_SIZE / SYNC_

export const MAX_REQUEST_BLOCKS = 2 ** 10; // 1024
export const MAX_REQUEST_BLOCKS_DENEB = 2 ** 7; // 128
Copy link
Member

Choose a reason for hiding this comment

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

as per spec those should be part of config as well, see configs/mainnet.yaml#L146

@@ -12,3 +13,7 @@ export const signedBLSToExecutionChangeVersionedType = new ContainerType(
{jsonCase: "eth2", typeName: "SignedBLSToExecutionChangeVersionedType"}
);
export type SignedBLSToExecutionChangeVersioned = ValueOf<typeof signedBLSToExecutionChangeVersionedType>;

export const BlobSidecarsByRootRequestType = (config: Pick<ChainConfig, "MAX_REQUEST_BLOB_SIDECARS">) =>
Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's helpful to pick just the specific key, this is actually more error prone than making sure the proper config object is passed

@@ -213,7 +213,7 @@ export function getCoreTopicsAtFork(

// After Deneb also track blob_sidecar_{index}
if (ForkSeq[fork] >= ForkSeq.deneb) {
for (let index = 0; index < MAX_BLOBS_PER_BLOCK; index++) {
for (let index = 0; index < config.MAX_BLOBS_PER_BLOCK; index++) {
Copy link
Member

Choose a reason for hiding this comment

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

just a side note, we should use BLOB_SIDECAR_SUBNET_COUNT here instead, currently this does not matter as BLOB_SIDECAR_SUBNET_COUNT == MAX_BLOBS_PER_BLOCK but would be good to clean up some open todos left over from Deneb

Will put up a separate PR for that

@@ -62,8 +61,6 @@ export const BlobIdentifier = new ContainerType(
{typeName: "BlobIdentifier", jsonCase: "eth2"}
);

export const BlobSidecarsByRootRequest = new ListCompositeType(BlobIdentifier, MAX_REQUEST_BLOB_SIDECARS);
Copy link
Member

Choose a reason for hiding this comment

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

moving this out of types should be fine as it's not a ssz container defined in the spec, only specs/deneb/p2p-interface.md?plain=1#L284

packages/validator/src/util/params.ts Outdated Show resolved Hide resolved
@ensi321 ensi321 requested a review from nflaig December 13, 2024 19:53
@ensi321 ensi321 merged commit 30c669b into unstable Dec 13, 2024
18 of 20 checks passed
@ensi321 ensi321 deleted the nc/blob-config branch December 13, 2024 20:51
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.

Make MAX_REQUEST_BLOB_SIDECARS and MAX_BLOBS_PER_BLOCK configurable
2 participants