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

fix: refactor the blockcontent types as fork aware types for api #6999

Merged
merged 2 commits into from
Aug 2, 2024

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Aug 2, 2024

as noticed by @wemeetagain in electra pr review, this change can be abstracted out in general and propagated against other work like peerdas , epbs while electra branch gets merged

@g11tech g11tech requested a review from a team as a code owner August 2, 2024 11:58
Copy link

codecov bot commented Aug 2, 2024

Codecov Report

Attention: Patch coverage is 65.95745% with 16 lines in your changes missing coverage. Please review.

Project coverage is 49.09%. Comparing base (be03ef1) to head (665454c).
Report is 2 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #6999      +/-   ##
============================================
- Coverage     49.10%   49.09%   -0.02%     
============================================
  Files           577      577              
  Lines         37336    37345       +9     
  Branches       2139     2136       -3     
============================================
- Hits          18334    18333       -1     
- Misses        18963    18973      +10     
  Partials         39       39              

Copy link
Contributor

github-actions bot commented Aug 2, 2024

⚠️ Performance Alert ⚠️

Possible performance regression was detected for some benchmarks.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold.

Benchmark suite Current: 8b55066 Previous: be03ef1 Ratio
phase0 processBlock - 250000 vs - 7PWei normalcase 4.6500 ms/op 1.4605 ms/op 3.18
altair processEth1Data - 250000 vs - 7PWei normalcase 729.97 us/op 242.13 us/op 3.01
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 23.636 us/op 6.8930 us/op 3.43
Array.fill - length 1000000 11.694 ms/op 2.6332 ms/op 4.44
Full benchmark results
Benchmark suite Current: 8b55066 Previous: be03ef1 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.2521 ms/op 1.9112 ms/op 1.18
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 78.223 us/op 38.236 us/op 2.05
BLS verify - blst 1.0966 ms/op 860.87 us/op 1.27
BLS verifyMultipleSignatures 3 - blst 1.3765 ms/op 1.2817 ms/op 1.07
BLS verifyMultipleSignatures 8 - blst 2.2508 ms/op 2.1041 ms/op 1.07
BLS verifyMultipleSignatures 32 - blst 5.6928 ms/op 4.4789 ms/op 1.27
BLS verifyMultipleSignatures 64 - blst 10.923 ms/op 8.2773 ms/op 1.32
BLS verifyMultipleSignatures 128 - blst 18.310 ms/op 16.008 ms/op 1.14
BLS deserializing 10000 signatures 699.84 ms/op 600.88 ms/op 1.16
BLS deserializing 100000 signatures 6.8368 s/op 6.0766 s/op 1.13
BLS verifyMultipleSignatures - same message - 3 - blst 1.6626 ms/op 933.15 us/op 1.78
BLS verifyMultipleSignatures - same message - 8 - blst 1.0652 ms/op 1.1058 ms/op 0.96
BLS verifyMultipleSignatures - same message - 32 - blst 1.7577 ms/op 1.6908 ms/op 1.04
BLS verifyMultipleSignatures - same message - 64 - blst 2.5765 ms/op 2.5242 ms/op 1.02
BLS verifyMultipleSignatures - same message - 128 - blst 4.3231 ms/op 4.1290 ms/op 1.05
BLS aggregatePubkeys 32 - blst 19.652 us/op 17.720 us/op 1.11
BLS aggregatePubkeys 128 - blst 69.103 us/op 62.264 us/op 1.11
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 70.245 ms/op 70.519 ms/op 1.00
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 68.982 ms/op 41.301 ms/op 1.67
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 40.656 ms/op 29.546 ms/op 1.38
getSlashingsAndExits - default max 92.125 us/op 81.598 us/op 1.13
getSlashingsAndExits - 2k 349.30 us/op 268.96 us/op 1.30
proposeBlockBody type=full, size=empty 5.9261 ms/op 4.7872 ms/op 1.24
isKnown best case - 1 super set check 329.00 ns/op 477.00 ns/op 0.69
isKnown normal case - 2 super set checks 336.00 ns/op 452.00 ns/op 0.74
isKnown worse case - 16 super set checks 324.00 ns/op 456.00 ns/op 0.71
InMemoryCheckpointStateCache - add get delete 5.5220 us/op 4.3810 us/op 1.26
validate api signedAggregateAndProof - struct 1.6523 ms/op 1.9668 ms/op 0.84
validate gossip signedAggregateAndProof - struct 1.8227 ms/op 2.0134 ms/op 0.91
validate gossip attestation - vc 640000 1.0951 ms/op 971.37 us/op 1.13
batch validate gossip attestation - vc 640000 - chunk 32 126.34 us/op 128.82 us/op 0.98
batch validate gossip attestation - vc 640000 - chunk 64 111.54 us/op 113.24 us/op 0.98
batch validate gossip attestation - vc 640000 - chunk 128 109.71 us/op 101.80 us/op 1.08
batch validate gossip attestation - vc 640000 - chunk 256 109.85 us/op 102.70 us/op 1.07
pickEth1Vote - no votes 1.0868 ms/op 874.86 us/op 1.24
pickEth1Vote - max votes 9.0299 ms/op 9.4627 ms/op 0.95
pickEth1Vote - Eth1Data hashTreeRoot value x2048 19.303 ms/op 17.292 ms/op 1.12
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 22.839 ms/op 20.372 ms/op 1.12
pickEth1Vote - Eth1Data fastSerialize value x2048 475.06 us/op 478.44 us/op 0.99
pickEth1Vote - Eth1Data fastSerialize tree x2048 6.0541 ms/op 4.0933 ms/op 1.48
bytes32 toHexString 471.00 ns/op 674.00 ns/op 0.70
bytes32 Buffer.toString(hex) 260.00 ns/op 445.00 ns/op 0.58
bytes32 Buffer.toString(hex) from Uint8Array 383.00 ns/op 591.00 ns/op 0.65
bytes32 Buffer.toString(hex) + 0x 260.00 ns/op 443.00 ns/op 0.59
Object access 1 prop 0.13700 ns/op 0.32900 ns/op 0.42
Map access 1 prop 0.14000 ns/op 0.30700 ns/op 0.46
Object get x1000 5.9610 ns/op 4.9830 ns/op 1.20
Map get x1000 6.5530 ns/op 5.6920 ns/op 1.15
Object set x1000 34.496 ns/op 24.162 ns/op 1.43
Map set x1000 23.128 ns/op 19.604 ns/op 1.18
Return object 10000 times 0.29300 ns/op 0.29490 ns/op 0.99
Throw Error 10000 times 3.4540 us/op 2.6821 us/op 1.29
fastMsgIdFn sha256 / 200 bytes 2.3300 us/op 2.0210 us/op 1.15
fastMsgIdFn h32 xxhash / 200 bytes 247.00 ns/op 440.00 ns/op 0.56
fastMsgIdFn h64 xxhash / 200 bytes 273.00 ns/op 471.00 ns/op 0.58
fastMsgIdFn sha256 / 1000 bytes 7.2970 us/op 5.9390 us/op 1.23
fastMsgIdFn h32 xxhash / 1000 bytes 395.00 ns/op 572.00 ns/op 0.69
fastMsgIdFn h64 xxhash / 1000 bytes 346.00 ns/op 534.00 ns/op 0.65
fastMsgIdFn sha256 / 10000 bytes 64.415 us/op 49.308 us/op 1.31
fastMsgIdFn h32 xxhash / 10000 bytes 1.9500 us/op 1.9940 us/op 0.98
fastMsgIdFn h64 xxhash / 10000 bytes 1.2510 us/op 1.3420 us/op 0.93
send data - 1000 256B messages 13.946 ms/op 10.383 ms/op 1.34
send data - 1000 512B messages 17.567 ms/op 14.535 ms/op 1.21
send data - 1000 1024B messages 29.583 ms/op 23.384 ms/op 1.27
send data - 1000 1200B messages 29.401 ms/op 25.356 ms/op 1.16
send data - 1000 2048B messages 31.997 ms/op 29.886 ms/op 1.07
send data - 1000 4096B messages 28.569 ms/op 26.916 ms/op 1.06
send data - 1000 16384B messages 69.786 ms/op 65.703 ms/op 1.06
send data - 1000 65536B messages 237.67 ms/op 253.41 ms/op 0.94
enrSubnets - fastDeserialize 64 bits 1.0950 us/op 1.3210 us/op 0.83
enrSubnets - ssz BitVector 64 bits 351.00 ns/op 630.00 ns/op 0.56
enrSubnets - fastDeserialize 4 bits 147.00 ns/op 388.00 ns/op 0.38
enrSubnets - ssz BitVector 4 bits 352.00 ns/op 584.00 ns/op 0.60
prioritizePeers score -10:0 att 32-0.1 sync 2-0 141.90 us/op 121.10 us/op 1.17
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 176.55 us/op 167.83 us/op 1.05
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 311.62 us/op 257.16 us/op 1.21
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 641.65 us/op 378.70 us/op 1.69
prioritizePeers score 0:0 att 64-1 sync 4-1 903.53 us/op 504.49 us/op 1.79
array of 16000 items push then shift 1.5768 us/op 1.2660 us/op 1.25
LinkedList of 16000 items push then shift 6.9290 ns/op 8.3880 ns/op 0.83
array of 16000 items push then pop 115.06 ns/op 116.83 ns/op 0.98
LinkedList of 16000 items push then pop 6.8170 ns/op 6.7730 ns/op 1.01
array of 24000 items push then shift 2.3573 us/op 1.9145 us/op 1.23
LinkedList of 24000 items push then shift 6.8830 ns/op 7.6810 ns/op 0.90
array of 24000 items push then pop 133.95 ns/op 155.93 ns/op 0.86
LinkedList of 24000 items push then pop 6.6970 ns/op 6.3040 ns/op 1.06
intersect bitArray bitLen 8 6.4790 ns/op 5.3520 ns/op 1.21
intersect array and set length 8 46.433 ns/op 38.535 ns/op 1.20
intersect bitArray bitLen 128 29.123 ns/op 26.733 ns/op 1.09
intersect array and set length 128 665.74 ns/op 585.32 ns/op 1.14
bitArray.getTrueBitIndexes() bitLen 128 2.5290 us/op 1.6850 us/op 1.50
bitArray.getTrueBitIndexes() bitLen 248 3.5940 us/op 2.3430 us/op 1.53
bitArray.getTrueBitIndexes() bitLen 512 8.4550 us/op 3.8990 us/op 2.17
Buffer.concat 32 items 978.00 ns/op 1.0190 us/op 0.96
Uint8Array.set 32 items 1.8350 us/op 1.8410 us/op 1.00
Buffer.copy 2.1650 us/op 2.2170 us/op 0.98
Uint8Array.set - with subarray 3.0200 us/op 2.4760 us/op 1.22
Uint8Array.set - without subarray 2.0330 us/op 1.8650 us/op 1.09
getUint32 - dataview 233.00 ns/op 402.00 ns/op 0.58
getUint32 - manual 161.00 ns/op 331.00 ns/op 0.49
Set add up to 64 items then delete first 2.2146 us/op 1.7919 us/op 1.24
OrderedSet add up to 64 items then delete first 3.3165 us/op 2.8891 us/op 1.15
Set add up to 64 items then delete last 2.5189 us/op 2.1335 us/op 1.18
OrderedSet add up to 64 items then delete last 3.6693 us/op 3.2477 us/op 1.13
Set add up to 64 items then delete middle 2.5437 us/op 2.0957 us/op 1.21
OrderedSet add up to 64 items then delete middle 5.2531 us/op 4.5147 us/op 1.16
Set add up to 128 items then delete first 5.2973 us/op 3.9160 us/op 1.35
OrderedSet add up to 128 items then delete first 7.9814 us/op 6.2348 us/op 1.28
Set add up to 128 items then delete last 5.0322 us/op 3.9983 us/op 1.26
OrderedSet add up to 128 items then delete last 7.4093 us/op 6.0925 us/op 1.22
Set add up to 128 items then delete middle 4.9706 us/op 3.8514 us/op 1.29
OrderedSet add up to 128 items then delete middle 13.750 us/op 13.111 us/op 1.05
Set add up to 256 items then delete first 10.799 us/op 9.2773 us/op 1.16
OrderedSet add up to 256 items then delete first 16.339 us/op 15.285 us/op 1.07
Set add up to 256 items then delete last 9.9531 us/op 9.8813 us/op 1.01
OrderedSet add up to 256 items then delete last 15.145 us/op 15.066 us/op 1.01
Set add up to 256 items then delete middle 9.8661 us/op 8.4788 us/op 1.16
OrderedSet add up to 256 items then delete middle 41.355 us/op 38.378 us/op 1.08
transfer serialized Status (84 B) 1.5120 us/op 1.5830 us/op 0.96
copy serialized Status (84 B) 1.3360 us/op 1.4020 us/op 0.95
transfer serialized SignedVoluntaryExit (112 B) 1.7290 us/op 1.5730 us/op 1.10
copy serialized SignedVoluntaryExit (112 B) 1.4470 us/op 1.3630 us/op 1.06
transfer serialized ProposerSlashing (416 B) 2.6370 us/op 2.4390 us/op 1.08
copy serialized ProposerSlashing (416 B) 2.5770 us/op 2.6460 us/op 0.97
transfer serialized Attestation (485 B) 2.6100 us/op 2.7110 us/op 0.96
copy serialized Attestation (485 B) 2.6190 us/op 2.2710 us/op 1.15
transfer serialized AttesterSlashing (33232 B) 3.0620 us/op 2.2060 us/op 1.39
copy serialized AttesterSlashing (33232 B) 6.8760 us/op 6.4530 us/op 1.07
transfer serialized Small SignedBeaconBlock (128000 B) 3.0830 us/op 2.8140 us/op 1.10
copy serialized Small SignedBeaconBlock (128000 B) 16.339 us/op 16.351 us/op 1.00
transfer serialized Avg SignedBeaconBlock (200000 B) 3.2130 us/op 3.0420 us/op 1.06
copy serialized Avg SignedBeaconBlock (200000 B) 23.018 us/op 27.094 us/op 0.85
transfer serialized BlobsSidecar (524380 B) 2.2790 us/op 3.6800 us/op 0.62
copy serialized BlobsSidecar (524380 B) 194.22 us/op 77.416 us/op 2.51
transfer serialized Big SignedBeaconBlock (1000000 B) 2.8520 us/op 4.0770 us/op 0.70
copy serialized Big SignedBeaconBlock (1000000 B) 210.33 us/op 128.91 us/op 1.63
pass gossip attestations to forkchoice per slot 3.2352 ms/op 2.9331 ms/op 1.10
forkChoice updateHead vc 100000 bc 64 eq 0 482.62 us/op 410.24 us/op 1.18
forkChoice updateHead vc 600000 bc 64 eq 0 3.0059 ms/op 2.5553 ms/op 1.18
forkChoice updateHead vc 1000000 bc 64 eq 0 5.1368 ms/op 4.3439 ms/op 1.18
forkChoice updateHead vc 600000 bc 320 eq 0 2.9809 ms/op 2.4975 ms/op 1.19
forkChoice updateHead vc 600000 bc 1200 eq 0 3.0461 ms/op 2.7642 ms/op 1.10
forkChoice updateHead vc 600000 bc 7200 eq 0 3.4273 ms/op 3.6084 ms/op 0.95
forkChoice updateHead vc 600000 bc 64 eq 1000 10.528 ms/op 10.045 ms/op 1.05
forkChoice updateHead vc 600000 bc 64 eq 10000 10.578 ms/op 9.7452 ms/op 1.09
forkChoice updateHead vc 600000 bc 64 eq 300000 14.149 ms/op 14.238 ms/op 0.99
computeDeltas 500000 validators 300 proto nodes 3.4457 ms/op 3.1219 ms/op 1.10
computeDeltas 500000 validators 1200 proto nodes 3.4381 ms/op 3.0313 ms/op 1.13
computeDeltas 500000 validators 7200 proto nodes 3.6948 ms/op 3.0399 ms/op 1.22
computeDeltas 750000 validators 300 proto nodes 5.4264 ms/op 4.4662 ms/op 1.21
computeDeltas 750000 validators 1200 proto nodes 5.4805 ms/op 4.4255 ms/op 1.24
computeDeltas 750000 validators 7200 proto nodes 5.3514 ms/op 4.7582 ms/op 1.12
computeDeltas 1400000 validators 300 proto nodes 10.204 ms/op 8.9096 ms/op 1.15
computeDeltas 1400000 validators 1200 proto nodes 10.066 ms/op 9.0633 ms/op 1.11
computeDeltas 1400000 validators 7200 proto nodes 12.062 ms/op 8.9834 ms/op 1.34
computeDeltas 2100000 validators 300 proto nodes 16.333 ms/op 13.520 ms/op 1.21
computeDeltas 2100000 validators 1200 proto nodes 15.510 ms/op 12.629 ms/op 1.23
computeDeltas 2100000 validators 7200 proto nodes 15.800 ms/op 12.276 ms/op 1.29
altair processAttestation - 250000 vs - 7PWei normalcase 2.3549 ms/op 1.4418 ms/op 1.63
altair processAttestation - 250000 vs - 7PWei worstcase 2.9074 ms/op 2.1548 ms/op 1.35
altair processAttestation - setStatus - 1/6 committees join 107.52 us/op 63.502 us/op 1.69
altair processAttestation - setStatus - 1/3 committees join 193.33 us/op 129.91 us/op 1.49
altair processAttestation - setStatus - 1/2 committees join 262.06 us/op 178.22 us/op 1.47
altair processAttestation - setStatus - 2/3 committees join 348.87 us/op 269.45 us/op 1.29
altair processAttestation - setStatus - 4/5 committees join 517.55 us/op 384.15 us/op 1.35
altair processAttestation - setStatus - 100% committees join 597.79 us/op 490.44 us/op 1.22
altair processBlock - 250000 vs - 7PWei normalcase 4.3719 ms/op 4.2366 ms/op 1.03
altair processBlock - 250000 vs - 7PWei normalcase hashState 28.356 ms/op 26.182 ms/op 1.08
altair processBlock - 250000 vs - 7PWei worstcase 41.398 ms/op 34.698 ms/op 1.19
altair processBlock - 250000 vs - 7PWei worstcase hashState 94.415 ms/op 66.701 ms/op 1.42
phase0 processBlock - 250000 vs - 7PWei normalcase 4.6500 ms/op 1.4605 ms/op 3.18
phase0 processBlock - 250000 vs - 7PWei worstcase 31.600 ms/op 22.094 ms/op 1.43
altair processEth1Data - 250000 vs - 7PWei normalcase 729.97 us/op 242.13 us/op 3.01
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 14.007 us/op 4.7430 us/op 2.95
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 44.959 us/op 18.980 us/op 2.37
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 23.636 us/op 6.8930 us/op 3.43
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 14.068 us/op 6.2520 us/op 2.25
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 173.27 us/op 84.343 us/op 2.05
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.4913 ms/op 844.80 us/op 1.77
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.0741 ms/op 840.52 us/op 2.47
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.7637 ms/op 657.04 us/op 2.68
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.2147 ms/op 2.2332 ms/op 1.89
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.2648 ms/op 1.2620 ms/op 1.79
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 6.5458 ms/op 2.9314 ms/op 2.23
Tree 40 250000 create 777.53 ms/op 188.45 ms/op 4.13
Tree 40 250000 get(125000) 185.47 ns/op 115.90 ns/op 1.60
Tree 40 250000 set(125000) 2.7469 us/op 516.98 ns/op 5.31
Tree 40 250000 toArray() 34.730 ms/op 12.871 ms/op 2.70
Tree 40 250000 iterate all - toArray() + loop 39.398 ms/op 13.321 ms/op 2.96
Tree 40 250000 iterate all - get(i) 75.206 ms/op 42.194 ms/op 1.78
MutableVector 250000 create 20.344 ms/op 9.6972 ms/op 2.10
MutableVector 250000 get(125000) 8.5420 ns/op 5.7000 ns/op 1.50
MutableVector 250000 set(125000) 830.13 ns/op 170.25 ns/op 4.88
MutableVector 250000 toArray() 6.5227 ms/op 2.9667 ms/op 2.20
MutableVector 250000 iterate all - toArray() + loop 7.3232 ms/op 2.8193 ms/op 2.60
MutableVector 250000 iterate all - get(i) 2.1297 ms/op 1.4145 ms/op 1.51
Array 250000 create 5.6441 ms/op 2.3505 ms/op 2.40
Array 250000 clone - spread 7.1354 ms/op 1.3271 ms/op 5.38
Array 250000 get(125000) 0.58300 ns/op 0.56800 ns/op 1.03
Array 250000 set(125000) 0.76900 ns/op 0.57900 ns/op 1.33
Array 250000 iterate all - loop 134.19 us/op 77.334 us/op 1.74
effectiveBalanceIncrements clone Uint8Array 300000 94.362 us/op 14.923 us/op 6.32
effectiveBalanceIncrements clone MutableVector 300000 220.00 ns/op 302.00 ns/op 0.73
effectiveBalanceIncrements rw all Uint8Array 300000 184.44 us/op 166.59 us/op 1.11
effectiveBalanceIncrements rw all MutableVector 300000 247.48 ms/op 58.562 ms/op 4.23
phase0 afterProcessEpoch - 250000 vs - 7PWei 101.26 ms/op 76.487 ms/op 1.32
Array.fill - length 1000000 11.694 ms/op 2.6332 ms/op 4.44
Array push - length 1000000 40.816 ms/op 14.883 ms/op 2.74
Array.get 0.31331 ns/op 0.25318 ns/op 1.24
Uint8Array.get 0.51887 ns/op 0.33191 ns/op 1.56
phase0 beforeProcessEpoch - 250000 vs - 7PWei 34.938 ms/op 15.073 ms/op 2.32
altair processEpoch - mainnet_e81889 526.28 ms/op 335.48 ms/op 1.57
mainnet_e81889 - altair beforeProcessEpoch 35.973 ms/op 17.405 ms/op 2.07
mainnet_e81889 - altair processJustificationAndFinalization 30.750 us/op 11.365 us/op 2.71
mainnet_e81889 - altair processInactivityUpdates 10.558 ms/op 4.0336 ms/op 2.62
mainnet_e81889 - altair processRewardsAndPenalties 62.619 ms/op 49.126 ms/op 1.27
mainnet_e81889 - altair processRegistryUpdates 8.8310 us/op 2.2570 us/op 3.91
mainnet_e81889 - altair processSlashings 1.8210 us/op 722.00 ns/op 2.52
mainnet_e81889 - altair processEth1DataReset 1.3740 us/op 717.00 ns/op 1.92
mainnet_e81889 - altair processEffectiveBalanceUpdates 3.0949 ms/op 827.43 us/op 3.74
mainnet_e81889 - altair processSlashingsReset 11.309 us/op 2.8200 us/op 4.01
mainnet_e81889 - altair processRandaoMixesReset 13.100 us/op 5.7880 us/op 2.26
mainnet_e81889 - altair processHistoricalRootsUpdate 1.4740 us/op 1.0090 us/op 1.46
mainnet_e81889 - altair processParticipationFlagUpdates 9.0730 us/op 1.8580 us/op 4.88
mainnet_e81889 - altair processSyncCommitteeUpdates 1.2760 us/op 799.00 ns/op 1.60
mainnet_e81889 - altair afterProcessEpoch 107.78 ms/op 76.944 ms/op 1.40
capella processEpoch - mainnet_e217614 1.3915 s/op 1.1468 s/op 1.21
mainnet_e217614 - capella beforeProcessEpoch 73.954 ms/op 86.581 ms/op 0.85
mainnet_e217614 - capella processJustificationAndFinalization 23.752 us/op 29.738 us/op 0.80
mainnet_e217614 - capella processInactivityUpdates 18.327 ms/op 18.913 ms/op 0.97
mainnet_e217614 - capella processRewardsAndPenalties 270.94 ms/op 285.23 ms/op 0.95
mainnet_e217614 - capella processRegistryUpdates 21.992 us/op 20.025 us/op 1.10
mainnet_e217614 - capella processSlashings 661.00 ns/op 1.4030 us/op 0.47
mainnet_e217614 - capella processEth1DataReset 460.00 ns/op 1.0830 us/op 0.42
mainnet_e217614 - capella processEffectiveBalanceUpdates 13.513 ms/op 12.935 ms/op 1.04
mainnet_e217614 - capella processSlashingsReset 5.1180 us/op 8.6730 us/op 0.59
mainnet_e217614 - capella processRandaoMixesReset 9.8690 us/op 7.6720 us/op 1.29
mainnet_e217614 - capella processHistoricalRootsUpdate 874.00 ns/op 1.1510 us/op 0.76
mainnet_e217614 - capella processParticipationFlagUpdates 2.7970 us/op 4.9800 us/op 0.56
mainnet_e217614 - capella afterProcessEpoch 269.41 ms/op 242.34 ms/op 1.11
phase0 processEpoch - mainnet_e58758 404.04 ms/op 435.00 ms/op 0.93
mainnet_e58758 - phase0 beforeProcessEpoch 82.886 ms/op 74.343 ms/op 1.11
mainnet_e58758 - phase0 processJustificationAndFinalization 16.583 us/op 13.421 us/op 1.24
mainnet_e58758 - phase0 processRewardsAndPenalties 35.628 ms/op 32.750 ms/op 1.09
mainnet_e58758 - phase0 processRegistryUpdates 7.7170 us/op 6.8390 us/op 1.13
mainnet_e58758 - phase0 processSlashings 288.00 ns/op 767.00 ns/op 0.38
mainnet_e58758 - phase0 processEth1DataReset 310.00 ns/op 712.00 ns/op 0.44
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.0939 ms/op 806.31 us/op 1.36
mainnet_e58758 - phase0 processSlashingsReset 4.0510 us/op 1.7220 us/op 2.35
mainnet_e58758 - phase0 processRandaoMixesReset 5.8140 us/op 3.8600 us/op 1.51
mainnet_e58758 - phase0 processHistoricalRootsUpdate 516.00 ns/op 797.00 ns/op 0.65
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.6280 us/op 4.6490 us/op 1.00
mainnet_e58758 - phase0 afterProcessEpoch 77.115 ms/op 71.779 ms/op 1.07
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.0136 ms/op 833.59 us/op 2.42
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.9338 ms/op 1.8331 ms/op 1.05
altair processInactivityUpdates - 250000 normalcase 19.982 ms/op 14.558 ms/op 1.37
altair processInactivityUpdates - 250000 worstcase 24.050 ms/op 20.404 ms/op 1.18
phase0 processRegistryUpdates - 250000 normalcase 9.3480 us/op 13.392 us/op 0.70
phase0 processRegistryUpdates - 250000 badcase_full_deposits 452.63 us/op 360.88 us/op 1.25
phase0 processRegistryUpdates - 250000 worstcase 0.5 130.83 ms/op 114.33 ms/op 1.14
altair processRewardsAndPenalties - 250000 normalcase 48.057 ms/op 46.633 ms/op 1.03
altair processRewardsAndPenalties - 250000 worstcase 58.482 ms/op 43.938 ms/op 1.33
phase0 getAttestationDeltas - 250000 normalcase 7.4549 ms/op 5.8539 ms/op 1.27
phase0 getAttestationDeltas - 250000 worstcase 7.4747 ms/op 5.9968 ms/op 1.25
phase0 processSlashings - 250000 worstcase 74.475 us/op 88.787 us/op 0.84
altair processSyncCommitteeUpdates - 250000 116.55 ms/op 124.65 ms/op 0.93
BeaconState.hashTreeRoot - No change 272.00 ns/op 791.00 ns/op 0.34
BeaconState.hashTreeRoot - 1 full validator 108.74 us/op 119.19 us/op 0.91
BeaconState.hashTreeRoot - 32 full validator 1.3088 ms/op 1.2384 ms/op 1.06
BeaconState.hashTreeRoot - 512 full validator 16.501 ms/op 14.802 ms/op 1.11
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 161.67 us/op 188.06 us/op 0.86
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.1115 ms/op 3.1846 ms/op 0.66
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 29.469 ms/op 43.559 ms/op 0.68
BeaconState.hashTreeRoot - 1 balances 87.891 us/op 155.21 us/op 0.57
BeaconState.hashTreeRoot - 32 balances 785.61 us/op 1.6697 ms/op 0.47
BeaconState.hashTreeRoot - 512 balances 7.3899 ms/op 15.444 ms/op 0.48
BeaconState.hashTreeRoot - 250000 balances 173.71 ms/op 218.51 ms/op 0.79
aggregationBits - 2048 els - zipIndexesInBitList 23.289 us/op 19.513 us/op 1.19
byteArrayEquals 32 53.230 ns/op 45.808 ns/op 1.16
Buffer.compare 32 16.893 ns/op 15.743 ns/op 1.07
byteArrayEquals 1024 1.5673 us/op 1.3716 us/op 1.14
Buffer.compare 1024 25.803 ns/op 24.014 ns/op 1.07
byteArrayEquals 16384 24.977 us/op 20.729 us/op 1.20
Buffer.compare 16384 200.94 ns/op 196.16 ns/op 1.02
byteArrayEquals 123687377 187.51 ms/op 151.80 ms/op 1.24
Buffer.compare 123687377 6.2617 ms/op 4.1386 ms/op 1.51
byteArrayEquals 32 - diff last byte 50.998 ns/op 42.186 ns/op 1.21
Buffer.compare 32 - diff last byte 16.558 ns/op 15.868 ns/op 1.04
byteArrayEquals 1024 - diff last byte 1.5332 us/op 1.2732 us/op 1.20
Buffer.compare 1024 - diff last byte 25.675 ns/op 23.347 ns/op 1.10
byteArrayEquals 16384 - diff last byte 24.422 us/op 20.005 us/op 1.22
Buffer.compare 16384 - diff last byte 191.56 ns/op 297.32 ns/op 0.64
byteArrayEquals 123687377 - diff last byte 189.63 ms/op 149.08 ms/op 1.27
Buffer.compare 123687377 - diff last byte 7.5677 ms/op 5.8442 ms/op 1.29
byteArrayEquals 32 - random bytes 5.4090 ns/op 4.7450 ns/op 1.14
Buffer.compare 32 - random bytes 17.350 ns/op 15.297 ns/op 1.13
byteArrayEquals 1024 - random bytes 5.2890 ns/op 4.8300 ns/op 1.10
Buffer.compare 1024 - random bytes 17.427 ns/op 15.430 ns/op 1.13
byteArrayEquals 16384 - random bytes 5.4980 ns/op 4.9530 ns/op 1.11
Buffer.compare 16384 - random bytes 17.714 ns/op 15.277 ns/op 1.16
byteArrayEquals 123687377 - random bytes 6.5600 ns/op 7.6900 ns/op 0.85
Buffer.compare 123687377 - random bytes 19.300 ns/op 18.510 ns/op 1.04
regular array get 100000 times 40.691 us/op 31.326 us/op 1.30
wrappedArray get 100000 times 32.739 us/op 31.350 us/op 1.04
arrayWithProxy get 100000 times 14.482 ms/op 10.708 ms/op 1.35
ssz.Root.equals 46.790 ns/op 43.061 ns/op 1.09
byteArrayEquals 45.644 ns/op 41.681 ns/op 1.10
Buffer.compare 10.577 ns/op 9.1640 ns/op 1.15
shuffle list - 16384 els 6.3599 ms/op 5.5169 ms/op 1.15
shuffle list - 250000 els 94.095 ms/op 81.718 ms/op 1.15
processSlot - 1 slots 14.811 us/op 10.361 us/op 1.43
processSlot - 32 slots 2.8760 ms/op 2.3906 ms/op 1.20
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 38.721 ms/op 33.110 ms/op 1.17
getCommitteeAssignments - req 1 vs - 250000 vc 2.1634 ms/op 1.8055 ms/op 1.20
getCommitteeAssignments - req 100 vs - 250000 vc 4.1387 ms/op 3.5497 ms/op 1.17
getCommitteeAssignments - req 1000 vs - 250000 vc 4.5313 ms/op 3.8117 ms/op 1.19
findModifiedValidators - 10000 modified validators 311.21 ms/op 243.19 ms/op 1.28
findModifiedValidators - 1000 modified validators 173.36 ms/op 157.25 ms/op 1.10
findModifiedValidators - 100 modified validators 161.38 ms/op 142.77 ms/op 1.13
findModifiedValidators - 10 modified validators 191.78 ms/op 135.97 ms/op 1.41
findModifiedValidators - 1 modified validators 216.43 ms/op 133.85 ms/op 1.62
findModifiedValidators - no difference 181.37 ms/op 168.06 ms/op 1.08
compare ViewDUs 3.5039 s/op 3.3893 s/op 1.03
compare each validator Uint8Array 1.4314 s/op 1.7073 s/op 0.84
compare ViewDU to Uint8Array 1.2715 s/op 926.70 ms/op 1.37
migrate state 1000000 validators, 24 modified, 0 new 673.09 ms/op 661.39 ms/op 1.02
migrate state 1000000 validators, 1700 modified, 1000 new 920.98 ms/op 839.20 ms/op 1.10
migrate state 1000000 validators, 3400 modified, 2000 new 1.3680 s/op 1.0660 s/op 1.28
migrate state 1500000 validators, 24 modified, 0 new 867.97 ms/op 642.89 ms/op 1.35
migrate state 1500000 validators, 1700 modified, 1000 new 1.1095 s/op 926.43 ms/op 1.20
migrate state 1500000 validators, 3400 modified, 2000 new 1.3174 s/op 1.0628 s/op 1.24
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.2600 ns/op 7.0100 ns/op 0.75
state getBlockRootAtSlot - 250000 vs - 7PWei 603.15 ns/op 522.48 ns/op 1.15
computeProposers - vc 250000 7.3012 ms/op 6.3386 ms/op 1.15
computeEpochShuffling - vc 250000 95.105 ms/op 83.484 ms/op 1.14
getNextSyncCommittee - vc 250000 123.32 ms/op 103.93 ms/op 1.19
computeSigningRoot for AttestationData 26.907 us/op 20.258 us/op 1.33
hash AttestationData serialized data then Buffer.toString(base64) 1.5063 us/op 1.2536 us/op 1.20
toHexString serialized data 891.98 ns/op 993.27 ns/op 0.90
Buffer.toString(base64) 198.51 ns/op 146.42 ns/op 1.36

by benchmarkbot/action

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
@wemeetagain wemeetagain merged commit cf00c3f into unstable Aug 2, 2024
19 of 20 checks passed
@wemeetagain wemeetagain deleted the api-blockcontents branch August 2, 2024 14:31
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.21.0 🎉

philknows pushed a commit that referenced this pull request Sep 3, 2024
* fix: refactor the blockcontent types as fork aware types for api

* Update packages/types/src/deneb/sszTypes.ts

Co-authored-by: Nico Flaig <nflaig@protonmail.com>

---------

Co-authored-by: Cayman <caymannava@gmail.com>
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
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.

3 participants