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

refactor: use SubnetID type from CL spec instead of number #7298

Merged
merged 3 commits into from
Jan 8, 2025

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Dec 13, 2024

Motivation

Makes it easier to compare our implementation against CL spec

Description

Use SubnetID type from CL spec instead of number

From specs/phase0/p2p-interface.md?plain=1#L182

Name SSZ equivalent Description
SubnetID uint64 subnet identifier

Depends on #7297

Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 46.66667% with 24 lines in your changes missing coverage. Please review.

Project coverage is 48.75%. Comparing base (c9bb826) to head (e7c77e9).
Report is 2 commits behind head on unstable.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #7298   +/-   ##
=========================================
  Coverage     48.75%   48.75%           
=========================================
  Files           601      601           
  Lines         40222    40222           
  Branches       2061     2061           
=========================================
  Hits          19609    19609           
  Misses        20575    20575           
  Partials         38       38           

@nflaig nflaig force-pushed the nflaig/BLOB_SIDECAR_SUBNET_COUNT branch from 48f6c94 to 67075e9 Compare December 13, 2024 21:00
Base automatically changed from nflaig/BLOB_SIDECAR_SUBNET_COUNT to unstable December 14, 2024 00:23
@nflaig nflaig marked this pull request as ready for review December 15, 2024 12:25
@nflaig nflaig requested a review from a team as a code owner December 15, 2024 12:25
Copy link
Contributor

github-actions bot commented Dec 15, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 726cc07 Previous: c9bb826 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.6776 ms/op 1.6969 ms/op 0.99
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 54.010 us/op 47.307 us/op 1.14
BLS verify - blst 915.38 us/op 757.53 us/op 1.21
BLS verifyMultipleSignatures 3 - blst 1.4427 ms/op 1.1607 ms/op 1.24
BLS verifyMultipleSignatures 8 - blst 1.8797 ms/op 1.6154 ms/op 1.16
BLS verifyMultipleSignatures 32 - blst 5.1425 ms/op 4.7655 ms/op 1.08
BLS verifyMultipleSignatures 64 - blst 10.499 ms/op 8.8640 ms/op 1.18
BLS verifyMultipleSignatures 128 - blst 18.180 ms/op 16.643 ms/op 1.09
BLS deserializing 10000 signatures 655.43 ms/op 672.37 ms/op 0.97
BLS deserializing 100000 signatures 6.4644 s/op 6.7565 s/op 0.96
BLS verifyMultipleSignatures - same message - 3 - blst 930.45 us/op 967.46 us/op 0.96
BLS verifyMultipleSignatures - same message - 8 - blst 1.1420 ms/op 1.0105 ms/op 1.13
BLS verifyMultipleSignatures - same message - 32 - blst 1.7171 ms/op 1.8006 ms/op 0.95
BLS verifyMultipleSignatures - same message - 64 - blst 2.5688 ms/op 2.6133 ms/op 0.98
BLS verifyMultipleSignatures - same message - 128 - blst 4.1854 ms/op 4.3381 ms/op 0.96
BLS aggregatePubkeys 32 - blst 18.606 us/op 19.413 us/op 0.96
BLS aggregatePubkeys 128 - blst 64.715 us/op 68.202 us/op 0.95
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 61.400 ms/op 87.076 ms/op 0.71
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 37.176 ms/op 59.144 ms/op 0.63
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 38.878 ms/op 50.029 ms/op 0.78
getSlashingsAndExits - default max 101.52 us/op 152.38 us/op 0.67
getSlashingsAndExits - 2k 552.63 us/op 453.56 us/op 1.22
proposeBlockBody type=full, size=empty 6.7623 ms/op 6.7630 ms/op 1.00
isKnown best case - 1 super set check 596.00 ns/op 338.00 ns/op 1.76
isKnown normal case - 2 super set checks 526.00 ns/op 339.00 ns/op 1.55
isKnown worse case - 16 super set checks 533.00 ns/op 336.00 ns/op 1.59
InMemoryCheckpointStateCache - add get delete 3.6090 us/op 3.9680 us/op 0.91
validate api signedAggregateAndProof - struct 1.7856 ms/op 1.6799 ms/op 1.06
validate gossip signedAggregateAndProof - struct 1.5820 ms/op 1.6337 ms/op 0.97
batch validate gossip attestation - vc 640000 - chunk 32 159.45 us/op 158.65 us/op 1.01
batch validate gossip attestation - vc 640000 - chunk 64 135.03 us/op 131.19 us/op 1.03
batch validate gossip attestation - vc 640000 - chunk 128 133.62 us/op 111.82 us/op 1.19
batch validate gossip attestation - vc 640000 - chunk 256 129.88 us/op 101.85 us/op 1.28
pickEth1Vote - no votes 1.1018 ms/op 1.0275 ms/op 1.07
pickEth1Vote - max votes 12.381 ms/op 5.5818 ms/op 2.22
pickEth1Vote - Eth1Data hashTreeRoot value x2048 20.281 ms/op 12.132 ms/op 1.67
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 23.368 ms/op 15.220 ms/op 1.54
pickEth1Vote - Eth1Data fastSerialize value x2048 577.50 us/op 450.55 us/op 1.28
pickEth1Vote - Eth1Data fastSerialize tree x2048 2.7595 ms/op 2.3751 ms/op 1.16
bytes32 toHexString 1.1070 us/op 424.00 ns/op 2.61
bytes32 Buffer.toString(hex) 561.00 ns/op 236.00 ns/op 2.38
bytes32 Buffer.toString(hex) from Uint8Array 723.00 ns/op 378.00 ns/op 1.91
bytes32 Buffer.toString(hex) + 0x 460.00 ns/op 234.00 ns/op 1.97
Object access 1 prop 0.39800 ns/op 0.13600 ns/op 2.93
Map access 1 prop 0.35500 ns/op 0.13500 ns/op 2.63
Object get x1000 5.7810 ns/op 6.0940 ns/op 0.95
Map get x1000 6.3870 ns/op 6.3920 ns/op 1.00
Object set x1000 27.008 ns/op 33.330 ns/op 0.81
Map set x1000 21.895 ns/op 22.079 ns/op 0.99
Return object 10000 times 0.33720 ns/op 0.30030 ns/op 1.12
Throw Error 10000 times 3.1466 us/op 3.3322 us/op 0.94
toHex 130.07 ns/op 144.47 ns/op 0.90
Buffer.from 133.26 ns/op 126.82 ns/op 1.05
shared Buffer 88.236 ns/op 83.023 ns/op 1.06
fastMsgIdFn sha256 / 200 bytes 2.4280 us/op 2.1970 us/op 1.11
fastMsgIdFn h32 xxhash / 200 bytes 580.00 ns/op 244.00 ns/op 2.38
fastMsgIdFn h64 xxhash / 200 bytes 707.00 ns/op 289.00 ns/op 2.45
fastMsgIdFn sha256 / 1000 bytes 6.7530 us/op 7.3970 us/op 0.91
fastMsgIdFn h32 xxhash / 1000 bytes 786.00 ns/op 388.00 ns/op 2.03
fastMsgIdFn h64 xxhash / 1000 bytes 662.00 ns/op 357.00 ns/op 1.85
fastMsgIdFn sha256 / 10000 bytes 55.715 us/op 64.046 us/op 0.87
fastMsgIdFn h32 xxhash / 10000 bytes 2.1920 us/op 1.9290 us/op 1.14
fastMsgIdFn h64 xxhash / 10000 bytes 1.5380 us/op 1.2520 us/op 1.23
send data - 1000 256B messages 14.025 ms/op 13.182 ms/op 1.06
send data - 1000 512B messages 16.693 ms/op 18.199 ms/op 0.92
send data - 1000 1024B messages 27.754 ms/op 28.759 ms/op 0.97
send data - 1000 1200B messages 27.227 ms/op 26.692 ms/op 1.02
send data - 1000 2048B messages 41.935 ms/op 32.465 ms/op 1.29
send data - 1000 4096B messages 41.003 ms/op 30.664 ms/op 1.34
send data - 1000 16384B messages 84.090 ms/op 74.127 ms/op 1.13
send data - 1000 65536B messages 277.02 ms/op 199.16 ms/op 1.39
enrSubnets - fastDeserialize 64 bits 1.4190 us/op 1.0500 us/op 1.35
enrSubnets - ssz BitVector 64 bits 672.00 ns/op 343.00 ns/op 1.96
enrSubnets - fastDeserialize 4 bits 416.00 ns/op 147.00 ns/op 2.83
enrSubnets - ssz BitVector 4 bits 685.00 ns/op 367.00 ns/op 1.87
prioritizePeers score -10:0 att 32-0.1 sync 2-0 177.67 us/op 132.24 us/op 1.34
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 203.40 us/op 153.77 us/op 1.32
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 346.73 us/op 221.13 us/op 1.57
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 541.30 us/op 393.07 us/op 1.38
prioritizePeers score 0:0 att 64-1 sync 4-1 695.79 us/op 490.28 us/op 1.42
array of 16000 items push then shift 1.3842 us/op 1.6372 us/op 0.85
LinkedList of 16000 items push then shift 10.497 ns/op 7.0890 ns/op 1.48
array of 16000 items push then pop 137.47 ns/op 105.84 ns/op 1.30
LinkedList of 16000 items push then pop 8.8310 ns/op 6.9190 ns/op 1.28
array of 24000 items push then shift 2.1384 us/op 2.4314 us/op 0.88
LinkedList of 24000 items push then shift 10.202 ns/op 7.0200 ns/op 1.45
array of 24000 items push then pop 194.11 ns/op 132.16 ns/op 1.47
LinkedList of 24000 items push then pop 7.4870 ns/op 6.9210 ns/op 1.08
intersect bitArray bitLen 8 5.9480 ns/op 6.3260 ns/op 0.94
intersect array and set length 8 44.164 ns/op 43.172 ns/op 1.02
intersect bitArray bitLen 128 29.778 ns/op 29.351 ns/op 1.01
intersect array and set length 128 832.09 ns/op 654.00 ns/op 1.27
bitArray.getTrueBitIndexes() bitLen 128 2.1650 us/op 1.2870 us/op 1.68
bitArray.getTrueBitIndexes() bitLen 248 3.3760 us/op 2.0610 us/op 1.64
bitArray.getTrueBitIndexes() bitLen 512 7.0070 us/op 4.2750 us/op 1.64
Buffer.concat 32 items 1.0900 us/op 772.00 ns/op 1.41
Uint8Array.set 32 items 2.3020 us/op 1.7170 us/op 1.34
Buffer.copy 2.9280 us/op 2.7120 us/op 1.08
Uint8Array.set - with subarray 2.6350 us/op 1.9510 us/op 1.35
Uint8Array.set - without subarray 2.2880 us/op 1.4310 us/op 1.60
getUint32 - dataview 544.00 ns/op 250.00 ns/op 2.18
getUint32 - manual 481.00 ns/op 168.00 ns/op 2.86
Set add up to 64 items then delete first 1.9183 us/op 2.4094 us/op 0.80
OrderedSet add up to 64 items then delete first 2.8139 us/op 3.4570 us/op 0.81
Set add up to 64 items then delete last 2.1687 us/op 2.7275 us/op 0.80
OrderedSet add up to 64 items then delete last 3.2681 us/op 3.9137 us/op 0.84
Set add up to 64 items then delete middle 2.2560 us/op 2.5937 us/op 0.87
OrderedSet add up to 64 items then delete middle 4.7033 us/op 5.3427 us/op 0.88
Set add up to 128 items then delete first 4.0768 us/op 5.1295 us/op 0.79
OrderedSet add up to 128 items then delete first 6.4055 us/op 7.0469 us/op 0.91
Set add up to 128 items then delete last 4.0173 us/op 4.9002 us/op 0.82
OrderedSet add up to 128 items then delete last 6.0650 us/op 7.3775 us/op 0.82
Set add up to 128 items then delete middle 5.2575 us/op 4.7692 us/op 1.10
OrderedSet add up to 128 items then delete middle 13.962 us/op 14.705 us/op 0.95
Set add up to 256 items then delete first 10.465 us/op 9.8881 us/op 1.06
OrderedSet add up to 256 items then delete first 18.127 us/op 14.553 us/op 1.25
Set add up to 256 items then delete last 11.864 us/op 9.8974 us/op 1.20
OrderedSet add up to 256 items then delete last 21.109 us/op 15.683 us/op 1.35
Set add up to 256 items then delete middle 12.165 us/op 9.3693 us/op 1.30
OrderedSet add up to 256 items then delete middle 41.964 us/op 40.593 us/op 1.03
transfer serialized Status (84 B) 3.9480 us/op 2.7160 us/op 1.45
copy serialized Status (84 B) 2.0170 us/op 1.4620 us/op 1.38
transfer serialized SignedVoluntaryExit (112 B) 3.6140 us/op 2.8540 us/op 1.27
copy serialized SignedVoluntaryExit (112 B) 2.1010 us/op 1.4330 us/op 1.47
transfer serialized ProposerSlashing (416 B) 4.4080 us/op 3.6700 us/op 1.20
copy serialized ProposerSlashing (416 B) 3.4250 us/op 2.5950 us/op 1.32
transfer serialized Attestation (485 B) 4.4020 us/op 3.6790 us/op 1.20
copy serialized Attestation (485 B) 3.2550 us/op 2.4390 us/op 1.33
transfer serialized AttesterSlashing (33232 B) 3.3690 us/op 3.6020 us/op 0.94
copy serialized AttesterSlashing (33232 B) 8.6910 us/op 6.3480 us/op 1.37
transfer serialized Small SignedBeaconBlock (128000 B) 3.8130 us/op 3.5930 us/op 1.06
copy serialized Small SignedBeaconBlock (128000 B) 31.331 us/op 13.520 us/op 2.32
transfer serialized Avg SignedBeaconBlock (200000 B) 4.6130 us/op 3.9410 us/op 1.17
copy serialized Avg SignedBeaconBlock (200000 B) 43.125 us/op 19.794 us/op 2.18
transfer serialized BlobsSidecar (524380 B) 4.9210 us/op 4.1080 us/op 1.20
copy serialized BlobsSidecar (524380 B) 119.00 us/op 131.83 us/op 0.90
transfer serialized Big SignedBeaconBlock (1000000 B) 7.4420 us/op 4.1220 us/op 1.81
copy serialized Big SignedBeaconBlock (1000000 B) 224.24 us/op 149.78 us/op 1.50
pass gossip attestations to forkchoice per slot 2.6024 ms/op 2.8312 ms/op 0.92
forkChoice updateHead vc 100000 bc 64 eq 0 406.51 us/op 555.37 us/op 0.73
forkChoice updateHead vc 600000 bc 64 eq 0 2.1005 ms/op 3.9684 ms/op 0.53
forkChoice updateHead vc 1000000 bc 64 eq 0 3.7978 ms/op 5.4007 ms/op 0.70
forkChoice updateHead vc 600000 bc 320 eq 0 2.4347 ms/op 2.5507 ms/op 0.95
forkChoice updateHead vc 600000 bc 1200 eq 0 2.1584 ms/op 2.7008 ms/op 0.80
forkChoice updateHead vc 600000 bc 7200 eq 0 2.7544 ms/op 3.6365 ms/op 0.76
forkChoice updateHead vc 600000 bc 64 eq 1000 10.249 ms/op 10.560 ms/op 0.97
forkChoice updateHead vc 600000 bc 64 eq 10000 10.079 ms/op 10.495 ms/op 0.96
forkChoice updateHead vc 600000 bc 64 eq 300000 27.742 ms/op 15.428 ms/op 1.80
computeDeltas 500000 validators 300 proto nodes 3.5531 ms/op 4.3747 ms/op 0.81
computeDeltas 500000 validators 1200 proto nodes 3.4537 ms/op 4.4969 ms/op 0.77
computeDeltas 500000 validators 7200 proto nodes 3.4457 ms/op 4.5438 ms/op 0.76
computeDeltas 750000 validators 300 proto nodes 5.0150 ms/op 6.6693 ms/op 0.75
computeDeltas 750000 validators 1200 proto nodes 5.1199 ms/op 7.1227 ms/op 0.72
computeDeltas 750000 validators 7200 proto nodes 4.9425 ms/op 7.6007 ms/op 0.65
computeDeltas 1400000 validators 300 proto nodes 9.2939 ms/op 16.867 ms/op 0.55
computeDeltas 1400000 validators 1200 proto nodes 9.1056 ms/op 18.680 ms/op 0.49
computeDeltas 1400000 validators 7200 proto nodes 9.5041 ms/op 17.147 ms/op 0.55
computeDeltas 2100000 validators 300 proto nodes 14.654 ms/op 20.205 ms/op 0.73
computeDeltas 2100000 validators 1200 proto nodes 15.208 ms/op 22.352 ms/op 0.68
computeDeltas 2100000 validators 7200 proto nodes 14.965 ms/op 19.078 ms/op 0.78
altair processAttestation - 250000 vs - 7PWei normalcase 1.8206 ms/op 2.8811 ms/op 0.63
altair processAttestation - 250000 vs - 7PWei worstcase 3.7831 ms/op 3.5728 ms/op 1.06
altair processAttestation - setStatus - 1/6 committees join 125.89 us/op 135.84 us/op 0.93
altair processAttestation - setStatus - 1/3 committees join 248.81 us/op 272.15 us/op 0.91
altair processAttestation - setStatus - 1/2 committees join 306.07 us/op 357.61 us/op 0.86
altair processAttestation - setStatus - 2/3 committees join 379.91 us/op 455.83 us/op 0.83
altair processAttestation - setStatus - 4/5 committees join 557.96 us/op 609.17 us/op 0.92
altair processAttestation - setStatus - 100% committees join 631.26 us/op 751.10 us/op 0.84
altair processBlock - 250000 vs - 7PWei normalcase 6.6020 ms/op 4.9135 ms/op 1.34
altair processBlock - 250000 vs - 7PWei normalcase hashState 29.794 ms/op 27.470 ms/op 1.08
altair processBlock - 250000 vs - 7PWei worstcase 36.582 ms/op 38.006 ms/op 0.96
altair processBlock - 250000 vs - 7PWei worstcase hashState 70.419 ms/op 75.232 ms/op 0.94
phase0 processBlock - 250000 vs - 7PWei normalcase 1.6683 ms/op 2.4939 ms/op 0.67
phase0 processBlock - 250000 vs - 7PWei worstcase 24.435 ms/op 28.900 ms/op 0.85
altair processEth1Data - 250000 vs - 7PWei normalcase 286.37 us/op 590.20 us/op 0.49
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 8.4120 us/op 12.327 us/op 0.68
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 58.476 us/op 70.951 us/op 0.82
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 13.366 us/op 21.284 us/op 0.63
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 12.086 us/op 13.002 us/op 0.93
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 160.25 us/op 225.64 us/op 0.71
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.0498 ms/op 1.0568 ms/op 0.99
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.2522 ms/op 1.8442 ms/op 0.68
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.2050 ms/op 1.4553 ms/op 0.83
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.0176 ms/op 4.5338 ms/op 0.67
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.3236 ms/op 1.8552 ms/op 0.71
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.7580 ms/op 4.5896 ms/op 1.04
Tree 40 250000 create 192.66 ms/op 275.87 ms/op 0.70
Tree 40 250000 get(125000) 130.58 ns/op 165.84 ns/op 0.79
Tree 40 250000 set(125000) 626.11 ns/op 957.23 ns/op 0.65
Tree 40 250000 toArray() 17.618 ms/op 21.959 ms/op 0.80
Tree 40 250000 iterate all - toArray() + loop 18.962 ms/op 20.759 ms/op 0.91
Tree 40 250000 iterate all - get(i) 51.535 ms/op 61.103 ms/op 0.84
Array 250000 create 2.8622 ms/op 4.1391 ms/op 0.69
Array 250000 clone - spread 1.2136 ms/op 1.6871 ms/op 0.72
Array 250000 get(125000) 0.69000 ns/op 0.43400 ns/op 1.59
Array 250000 set(125000) 0.64100 ns/op 0.46200 ns/op 1.39
Array 250000 iterate all - loop 83.794 us/op 83.939 us/op 1.00
phase0 afterProcessEpoch - 250000 vs - 7PWei 45.904 ms/op 55.004 ms/op 0.83
Array.fill - length 1000000 2.6732 ms/op 4.9367 ms/op 0.54
Array push - length 1000000 16.290 ms/op 23.921 ms/op 0.68
Array.get 0.27033 ns/op 0.29004 ns/op 0.93
Uint8Array.get 0.36100 ns/op 0.45357 ns/op 0.80
phase0 beforeProcessEpoch - 250000 vs - 7PWei 20.628 ms/op 21.397 ms/op 0.96
altair processEpoch - mainnet_e81889 279.48 ms/op 317.20 ms/op 0.88
mainnet_e81889 - altair beforeProcessEpoch 20.667 ms/op 20.801 ms/op 0.99
mainnet_e81889 - altair processJustificationAndFinalization 18.243 us/op 19.606 us/op 0.93
mainnet_e81889 - altair processInactivityUpdates 4.6377 ms/op 7.4073 ms/op 0.63
mainnet_e81889 - altair processRewardsAndPenalties 48.159 ms/op 53.101 ms/op 0.91
mainnet_e81889 - altair processRegistryUpdates 2.2900 us/op 3.0190 us/op 0.76
mainnet_e81889 - altair processSlashings 991.00 ns/op 857.00 ns/op 1.16
mainnet_e81889 - altair processEth1DataReset 1.1270 us/op 626.00 ns/op 1.80
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2031 ms/op 1.4442 ms/op 0.83
mainnet_e81889 - altair processSlashingsReset 5.4420 us/op 7.7590 us/op 0.70
mainnet_e81889 - altair processRandaoMixesReset 5.9570 us/op 8.1820 us/op 0.73
mainnet_e81889 - altair processHistoricalRootsUpdate 1.3860 us/op 1.4150 us/op 0.98
mainnet_e81889 - altair processParticipationFlagUpdates 5.3120 us/op 2.9140 us/op 1.82
mainnet_e81889 - altair processSyncCommitteeUpdates 737.00 ns/op 1.0510 us/op 0.70
mainnet_e81889 - altair afterProcessEpoch 43.732 ms/op 55.344 ms/op 0.79
capella processEpoch - mainnet_e217614 1.1338 s/op 1.1873 s/op 0.95
mainnet_e217614 - capella beforeProcessEpoch 71.449 ms/op 70.980 ms/op 1.01
mainnet_e217614 - capella processJustificationAndFinalization 15.657 us/op 19.759 us/op 0.79
mainnet_e217614 - capella processInactivityUpdates 15.684 ms/op 18.989 ms/op 0.83
mainnet_e217614 - capella processRewardsAndPenalties 239.84 ms/op 220.95 ms/op 1.09
mainnet_e217614 - capella processRegistryUpdates 19.576 us/op 27.992 us/op 0.70
mainnet_e217614 - capella processSlashings 1.0850 us/op 747.00 ns/op 1.45
mainnet_e217614 - capella processEth1DataReset 1.0320 us/op 730.00 ns/op 1.41
mainnet_e217614 - capella processEffectiveBalanceUpdates 15.017 ms/op 15.543 ms/op 0.97
mainnet_e217614 - capella processSlashingsReset 3.3240 us/op 4.6900 us/op 0.71
mainnet_e217614 - capella processRandaoMixesReset 4.2020 us/op 17.867 us/op 0.24
mainnet_e217614 - capella processHistoricalRootsUpdate 1000.0 ns/op 677.00 ns/op 1.48
mainnet_e217614 - capella processParticipationFlagUpdates 1.8260 us/op 1.8610 us/op 0.98
mainnet_e217614 - capella afterProcessEpoch 103.63 ms/op 124.66 ms/op 0.83
phase0 processEpoch - mainnet_e58758 313.34 ms/op 372.60 ms/op 0.84
mainnet_e58758 - phase0 beforeProcessEpoch 93.801 ms/op 88.574 ms/op 1.06
mainnet_e58758 - phase0 processJustificationAndFinalization 14.523 us/op 18.999 us/op 0.76
mainnet_e58758 - phase0 processRewardsAndPenalties 22.502 ms/op 29.250 ms/op 0.77
mainnet_e58758 - phase0 processRegistryUpdates 8.6810 us/op 15.453 us/op 0.56
mainnet_e58758 - phase0 processSlashings 1.0010 us/op 800.00 ns/op 1.25
mainnet_e58758 - phase0 processEth1DataReset 940.00 ns/op 660.00 ns/op 1.42
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.5164 ms/op 1.2013 ms/op 1.26
mainnet_e58758 - phase0 processSlashingsReset 3.1550 us/op 4.0580 us/op 0.78
mainnet_e58758 - phase0 processRandaoMixesReset 5.0880 us/op 8.0630 us/op 0.63
mainnet_e58758 - phase0 processHistoricalRootsUpdate 752.00 ns/op 919.00 ns/op 0.82
mainnet_e58758 - phase0 processParticipationRecordUpdates 7.9650 us/op 5.9240 us/op 1.34
mainnet_e58758 - phase0 afterProcessEpoch 37.102 ms/op 47.644 ms/op 0.78
phase0 processEffectiveBalanceUpdates - 250000 normalcase 959.75 us/op 1.7435 ms/op 0.55
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4226 ms/op 4.0246 ms/op 0.35
altair processInactivityUpdates - 250000 normalcase 15.971 ms/op 19.563 ms/op 0.82
altair processInactivityUpdates - 250000 worstcase 15.530 ms/op 18.849 ms/op 0.82
phase0 processRegistryUpdates - 250000 normalcase 11.370 us/op 16.239 us/op 0.70
phase0 processRegistryUpdates - 250000 badcase_full_deposits 358.48 us/op 389.43 us/op 0.92
phase0 processRegistryUpdates - 250000 worstcase 0.5 98.203 ms/op 141.96 ms/op 0.69
altair processRewardsAndPenalties - 250000 normalcase 38.158 ms/op 41.906 ms/op 0.91
altair processRewardsAndPenalties - 250000 worstcase 43.436 ms/op 38.296 ms/op 1.13
phase0 getAttestationDeltas - 250000 normalcase 6.3483 ms/op 8.1544 ms/op 0.78
phase0 getAttestationDeltas - 250000 worstcase 5.9771 ms/op 8.6993 ms/op 0.69
phase0 processSlashings - 250000 worstcase 99.550 us/op 139.57 us/op 0.71
altair processSyncCommitteeUpdates - 250000 105.29 ms/op 147.43 ms/op 0.71
BeaconState.hashTreeRoot - No change 462.00 ns/op 284.00 ns/op 1.63
BeaconState.hashTreeRoot - 1 full validator 106.49 us/op 133.82 us/op 0.80
BeaconState.hashTreeRoot - 32 full validator 1.0966 ms/op 1.4599 ms/op 0.75
BeaconState.hashTreeRoot - 512 full validator 10.834 ms/op 13.762 ms/op 0.79
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 125.89 us/op 182.07 us/op 0.69
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.4796 ms/op 2.3828 ms/op 0.62
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 21.635 ms/op 33.655 ms/op 0.64
BeaconState.hashTreeRoot - 1 balances 100.37 us/op 136.50 us/op 0.74
BeaconState.hashTreeRoot - 32 balances 939.72 us/op 1.0635 ms/op 0.88
BeaconState.hashTreeRoot - 512 balances 7.1853 ms/op 10.955 ms/op 0.66
BeaconState.hashTreeRoot - 250000 balances 137.57 ms/op 195.53 ms/op 0.70
aggregationBits - 2048 els - zipIndexesInBitList 20.913 us/op 35.522 us/op 0.59
byteArrayEquals 32 48.916 ns/op 54.868 ns/op 0.89
Buffer.compare 32 15.706 ns/op 17.885 ns/op 0.88
byteArrayEquals 1024 1.2790 us/op 1.6306 us/op 0.78
Buffer.compare 1024 24.644 ns/op 26.451 ns/op 0.93
byteArrayEquals 16384 20.455 us/op 26.716 us/op 0.77
Buffer.compare 16384 172.87 ns/op 202.99 ns/op 0.85
byteArrayEquals 123687377 151.18 ms/op 193.01 ms/op 0.78
Buffer.compare 123687377 6.2271 ms/op 6.8083 ms/op 0.91
byteArrayEquals 32 - diff last byte 46.035 ns/op 51.793 ns/op 0.89
Buffer.compare 32 - diff last byte 15.653 ns/op 16.749 ns/op 0.93
byteArrayEquals 1024 - diff last byte 1.2362 us/op 1.5613 us/op 0.79
Buffer.compare 1024 - diff last byte 23.847 ns/op 24.789 ns/op 0.96
byteArrayEquals 16384 - diff last byte 20.016 us/op 24.933 us/op 0.80
Buffer.compare 16384 - diff last byte 199.06 ns/op 192.91 ns/op 1.03
byteArrayEquals 123687377 - diff last byte 156.05 ms/op 188.39 ms/op 0.83
Buffer.compare 123687377 - diff last byte 5.6543 ms/op 9.8617 ms/op 0.57
byteArrayEquals 32 - random bytes 5.0180 ns/op 5.3730 ns/op 0.93
Buffer.compare 32 - random bytes 16.059 ns/op 18.336 ns/op 0.88
byteArrayEquals 1024 - random bytes 5.0350 ns/op 5.5020 ns/op 0.92
Buffer.compare 1024 - random bytes 15.860 ns/op 18.181 ns/op 0.87
byteArrayEquals 16384 - random bytes 5.0330 ns/op 5.3980 ns/op 0.93
Buffer.compare 16384 - random bytes 15.982 ns/op 18.189 ns/op 0.88
byteArrayEquals 123687377 - random bytes 8.2700 ns/op 6.9300 ns/op 1.19
Buffer.compare 123687377 - random bytes 19.280 ns/op 19.870 ns/op 0.97
regular array get 100000 times 32.138 us/op 35.067 us/op 0.92
wrappedArray get 100000 times 31.710 us/op 35.442 us/op 0.89
arrayWithProxy get 100000 times 9.6223 ms/op 12.511 ms/op 0.77
ssz.Root.equals 44.844 ns/op 47.034 ns/op 0.95
byteArrayEquals 43.777 ns/op 45.960 ns/op 0.95
Buffer.compare 9.2210 ns/op 11.020 ns/op 0.84
processSlot - 1 slots 11.306 us/op 14.888 us/op 0.76
processSlot - 32 slots 2.1229 ms/op 3.1620 ms/op 0.67
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 38.483 ms/op 37.775 ms/op 1.02
getCommitteeAssignments - req 1 vs - 250000 vc 1.8341 ms/op 2.1811 ms/op 0.84
getCommitteeAssignments - req 100 vs - 250000 vc 3.5534 ms/op 4.2177 ms/op 0.84
getCommitteeAssignments - req 1000 vs - 250000 vc 3.8557 ms/op 4.4633 ms/op 0.86
findModifiedValidators - 10000 modified validators 242.49 ms/op 296.19 ms/op 0.82
findModifiedValidators - 1000 modified validators 159.50 ms/op 197.96 ms/op 0.81
findModifiedValidators - 100 modified validators 163.88 ms/op 169.32 ms/op 0.97
findModifiedValidators - 10 modified validators 171.03 ms/op 153.15 ms/op 1.12
findModifiedValidators - 1 modified validators 148.27 ms/op 150.16 ms/op 0.99
findModifiedValidators - no difference 159.14 ms/op 240.17 ms/op 0.66
compare ViewDUs 3.4631 s/op 3.2610 s/op 1.06
compare each validator Uint8Array 1.2486 s/op 1.3951 s/op 0.90
compare ViewDU to Uint8Array 891.72 ms/op 962.70 ms/op 0.93
migrate state 1000000 validators, 24 modified, 0 new 620.91 ms/op 662.87 ms/op 0.94
migrate state 1000000 validators, 1700 modified, 1000 new 892.91 ms/op 894.68 ms/op 1.00
migrate state 1000000 validators, 3400 modified, 2000 new 1.0914 s/op 1.2290 s/op 0.89
migrate state 1500000 validators, 24 modified, 0 new 634.51 ms/op 1.1601 s/op 0.55
migrate state 1500000 validators, 1700 modified, 1000 new 847.39 ms/op 1.5029 s/op 0.56
migrate state 1500000 validators, 3400 modified, 2000 new 1.0760 s/op 1.4257 s/op 0.75
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 6.1000 ns/op 5.2000 ns/op 1.17
state getBlockRootAtSlot - 250000 vs - 7PWei 400.59 ns/op 636.66 ns/op 0.63
computeProposers - vc 250000 5.2032 ms/op 7.3903 ms/op 0.70
computeEpochShuffling - vc 250000 34.105 ms/op 44.390 ms/op 0.77
getNextSyncCommittee - vc 250000 92.401 ms/op 130.94 ms/op 0.71
computeSigningRoot for AttestationData 19.134 us/op 27.674 us/op 0.69
hash AttestationData serialized data then Buffer.toString(base64) 1.1707 us/op 1.7037 us/op 0.69
toHexString serialized data 749.44 ns/op 1.0420 us/op 0.72
Buffer.toString(base64) 120.99 ns/op 220.67 ns/op 0.55
nodejs block root to RootHex using toHex 106.41 ns/op 165.54 ns/op 0.64
nodejs block root to RootHex using toRootHex 70.050 ns/op 97.283 ns/op 0.72
browser block root to RootHex using the deprecated toHexString 205.53 ns/op 362.98 ns/op 0.57
browser block root to RootHex using toHex 165.90 ns/op 259.43 ns/op 0.64
browser block root to RootHex using toRootHex 148.11 ns/op 204.91 ns/op 0.72

by benchmarkbot/action

@nflaig nflaig requested a review from wemeetagain December 19, 2024 09:50
Copy link
Contributor

@ensi321 ensi321 left a comment

Choose a reason for hiding this comment

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

Looks good overall. Just need more discussion on type representing subnet id in sync aggregate.

@@ -762,7 +763,7 @@ export function getCommitteeIndices(
/**
* Compute the correct subnet for a slot/committee index
*/
export function computeSubnetForSlot(shuffling: EpochShuffling, slot: number, committeeIndex: number): number {
export function computeSubnetForSlot(shuffling: EpochShuffling, slot: number, committeeIndex: number): SubnetID {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just realized computeSubnetForSlot here and computeSubnetForCommitteesAtSlot in packages/beacon-node/src/api/impl/validator/utils.ts can probably be just one function instead. Can combine them at a later PR

@nflaig nflaig requested a review from ensi321 January 8, 2025 14:02
@wemeetagain wemeetagain merged commit 877b1ae into unstable Jan 8, 2025
19 of 20 checks passed
@wemeetagain wemeetagain deleted the nflaig/subnetid branch January 8, 2025 17:44
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