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: add util to diff ssz objects #7041

Merged
merged 1 commit into from
Sep 9, 2024
Merged

feat: add util to diff ssz objects #7041

merged 1 commit into from
Sep 9, 2024

Conversation

matthewkeil
Copy link
Member

Motivation

Had some challenges debugging an invalid state root and built this util to help with diffing states. Is useful for diffing any deeply nested ssz object.

@matthewkeil matthewkeil requested a review from a team as a code owner August 21, 2024 06:12
Copy link

codecov bot commented Aug 21, 2024

Codecov Report

Attention: Patch coverage is 4.34783% with 154 lines in your changes missing coverage. Please review.

Project coverage is 49.05%. Comparing base (6f470f8) to head (f137a82).
Report is 89 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #7041      +/-   ##
============================================
- Coverage     49.25%   49.05%   -0.20%     
============================================
  Files           578      579       +1     
  Lines         37443    37604     +161     
  Branches       2172     2165       -7     
============================================
+ Hits          18441    18447       +6     
- Misses        18962    19117     +155     
  Partials         40       40              

Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: d1d54df Previous: 4ea7edd Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.9323 ms/op 2.6055 ms/op 0.74
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 48.086 us/op 80.209 us/op 0.60
BLS verify - blst 764.66 us/op 1.1234 ms/op 0.68
BLS verifyMultipleSignatures 3 - blst 1.1757 ms/op 1.7285 ms/op 0.68
BLS verifyMultipleSignatures 8 - blst 1.6723 ms/op 2.4733 ms/op 0.68
BLS verifyMultipleSignatures 32 - blst 4.8352 ms/op 7.4787 ms/op 0.65
BLS verifyMultipleSignatures 64 - blst 9.0163 ms/op 12.507 ms/op 0.72
BLS verifyMultipleSignatures 128 - blst 17.078 ms/op 21.076 ms/op 0.81
BLS deserializing 10000 signatures 681.55 ms/op 792.81 ms/op 0.86
BLS deserializing 100000 signatures 6.8906 s/op 7.8729 s/op 0.88
BLS verifyMultipleSignatures - same message - 3 - blst 969.07 us/op 1.1819 ms/op 0.82
BLS verifyMultipleSignatures - same message - 8 - blst 1.0987 ms/op 1.3040 ms/op 0.84
BLS verifyMultipleSignatures - same message - 32 - blst 1.8551 ms/op 2.0659 ms/op 0.90
BLS verifyMultipleSignatures - same message - 64 - blst 2.6844 ms/op 3.1542 ms/op 0.85
BLS verifyMultipleSignatures - same message - 128 - blst 4.3778 ms/op 5.0196 ms/op 0.87
BLS aggregatePubkeys 32 - blst 20.571 us/op 22.129 us/op 0.93
BLS aggregatePubkeys 128 - blst 71.607 us/op 80.153 us/op 0.89
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 63.321 ms/op 102.57 ms/op 0.62
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 55.613 ms/op 75.357 ms/op 0.74
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 31.457 ms/op 47.173 ms/op 0.67
getSlashingsAndExits - default max 94.678 us/op 143.79 us/op 0.66
getSlashingsAndExits - 2k 301.07 us/op 382.02 us/op 0.79
proposeBlockBody type=full, size=empty 5.6984 ms/op 7.1536 ms/op 0.80
isKnown best case - 1 super set check 329.00 ns/op 652.00 ns/op 0.50
isKnown normal case - 2 super set checks 300.00 ns/op 672.00 ns/op 0.45
isKnown worse case - 16 super set checks 301.00 ns/op 660.00 ns/op 0.46
InMemoryCheckpointStateCache - add get delete 2.7680 us/op 3.9210 us/op 0.71
validate api signedAggregateAndProof - struct 1.4427 ms/op 1.9821 ms/op 0.73
validate gossip signedAggregateAndProof - struct 1.3744 ms/op 1.9275 ms/op 0.71
validate gossip attestation - vc 640000 872.15 us/op 1.2416 ms/op 0.70
batch validate gossip attestation - vc 640000 - chunk 32 129.57 us/op 161.92 us/op 0.80
batch validate gossip attestation - vc 640000 - chunk 64 116.02 us/op 143.08 us/op 0.81
batch validate gossip attestation - vc 640000 - chunk 128 107.74 us/op 145.04 us/op 0.74
batch validate gossip attestation - vc 640000 - chunk 256 100.20 us/op 151.30 us/op 0.66
pickEth1Vote - no votes 1.0468 ms/op 1.5792 ms/op 0.66
pickEth1Vote - max votes 5.9171 ms/op 12.616 ms/op 0.47
pickEth1Vote - Eth1Data hashTreeRoot value x2048 14.899 ms/op 19.847 ms/op 0.75
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 17.919 ms/op 32.458 ms/op 0.55
pickEth1Vote - Eth1Data fastSerialize value x2048 479.72 us/op 700.45 us/op 0.68
pickEth1Vote - Eth1Data fastSerialize tree x2048 2.9253 ms/op 4.3902 ms/op 0.67
bytes32 toHexString 427.00 ns/op 909.00 ns/op 0.47
bytes32 Buffer.toString(hex) 249.00 ns/op 318.00 ns/op 0.78
bytes32 Buffer.toString(hex) from Uint8Array 369.00 ns/op 592.00 ns/op 0.62
bytes32 Buffer.toString(hex) + 0x 243.00 ns/op 336.00 ns/op 0.72
Object access 1 prop 0.13100 ns/op 0.23100 ns/op 0.57
Map access 1 prop 0.12800 ns/op 0.20200 ns/op 0.63
Object get x1000 5.7940 ns/op 8.0370 ns/op 0.72
Map get x1000 6.4960 ns/op 9.1740 ns/op 0.71
Object set x1000 32.502 ns/op 74.306 ns/op 0.44
Map set x1000 22.052 ns/op 52.721 ns/op 0.42
Return object 10000 times 0.29280 ns/op 0.36870 ns/op 0.79
Throw Error 10000 times 3.4340 us/op 4.3599 us/op 0.79
toHex 146.51 ns/op 224.30 ns/op 0.65
Buffer.from 135.37 ns/op 222.01 ns/op 0.61
shared Buffer 91.485 ns/op 121.41 ns/op 0.75
fastMsgIdFn sha256 / 200 bytes 2.1800 us/op 2.8420 us/op 0.77
fastMsgIdFn h32 xxhash / 200 bytes 239.00 ns/op 365.00 ns/op 0.65
fastMsgIdFn h64 xxhash / 200 bytes 268.00 ns/op 338.00 ns/op 0.79
fastMsgIdFn sha256 / 1000 bytes 7.2420 us/op 9.3670 us/op 0.77
fastMsgIdFn h32 xxhash / 1000 bytes 367.00 ns/op 561.00 ns/op 0.65
fastMsgIdFn h64 xxhash / 1000 bytes 345.00 ns/op 550.00 ns/op 0.63
fastMsgIdFn sha256 / 10000 bytes 64.094 us/op 93.243 us/op 0.69
fastMsgIdFn h32 xxhash / 10000 bytes 1.8330 us/op 3.0740 us/op 0.60
fastMsgIdFn h64 xxhash / 10000 bytes 1.2060 us/op 1.7500 us/op 0.69
send data - 1000 256B messages 12.435 ms/op 22.575 ms/op 0.55
send data - 1000 512B messages 16.753 ms/op 26.438 ms/op 0.63
send data - 1000 1024B messages 26.741 ms/op 36.652 ms/op 0.73
send data - 1000 1200B messages 25.561 ms/op 45.039 ms/op 0.57
send data - 1000 2048B messages 30.987 ms/op 54.344 ms/op 0.57
send data - 1000 4096B messages 30.667 ms/op 51.949 ms/op 0.59
send data - 1000 16384B messages 70.667 ms/op 137.14 ms/op 0.52
send data - 1000 65536B messages 224.26 ms/op 273.17 ms/op 0.82
enrSubnets - fastDeserialize 64 bits 1.2180 us/op 1.7130 us/op 0.71
enrSubnets - ssz BitVector 64 bits 439.00 ns/op 550.00 ns/op 0.80
enrSubnets - fastDeserialize 4 bits 162.00 ns/op 251.00 ns/op 0.65
enrSubnets - ssz BitVector 4 bits 378.00 ns/op 600.00 ns/op 0.63
prioritizePeers score -10:0 att 32-0.1 sync 2-0 151.79 us/op 230.61 us/op 0.66
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 150.48 us/op 262.09 us/op 0.57
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 254.90 us/op 658.98 us/op 0.39
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 397.60 us/op 693.32 us/op 0.57
prioritizePeers score 0:0 att 64-1 sync 4-1 694.52 us/op 1.2916 ms/op 0.54
array of 16000 items push then shift 1.6897 us/op 2.2201 us/op 0.76
LinkedList of 16000 items push then shift 7.8080 ns/op 14.804 ns/op 0.53
array of 16000 items push then pop 135.81 ns/op 222.07 ns/op 0.61
LinkedList of 16000 items push then pop 7.5180 ns/op 12.847 ns/op 0.59
array of 24000 items push then shift 2.4971 us/op 3.5852 us/op 0.70
LinkedList of 24000 items push then shift 7.7700 ns/op 14.791 ns/op 0.53
array of 24000 items push then pop 164.63 ns/op 298.84 ns/op 0.55
LinkedList of 24000 items push then pop 7.4450 ns/op 13.118 ns/op 0.57
intersect bitArray bitLen 8 6.5330 ns/op 10.865 ns/op 0.60
intersect array and set length 8 53.091 ns/op 110.78 ns/op 0.48
intersect bitArray bitLen 128 30.413 ns/op 42.524 ns/op 0.72
intersect array and set length 128 773.36 ns/op 1.4796 us/op 0.52
bitArray.getTrueBitIndexes() bitLen 128 2.2190 us/op 3.6980 us/op 0.60
bitArray.getTrueBitIndexes() bitLen 248 3.6450 us/op 7.2390 us/op 0.50
bitArray.getTrueBitIndexes() bitLen 512 7.9750 us/op 13.361 us/op 0.60
Buffer.concat 32 items 972.00 ns/op 1.6800 us/op 0.58
Uint8Array.set 32 items 1.5380 us/op 2.4630 us/op 0.62
Buffer.copy 1.6160 us/op 2.3540 us/op 0.69
Uint8Array.set - with subarray 2.0770 us/op 3.8280 us/op 0.54
Uint8Array.set - without subarray 1.5370 us/op 2.1610 us/op 0.71
getUint32 - dataview 269.00 ns/op 337.00 ns/op 0.80
getUint32 - manual 231.00 ns/op 298.00 ns/op 0.78
Set add up to 64 items then delete first 2.6838 us/op 3.4253 us/op 0.78
OrderedSet add up to 64 items then delete first 3.6233 us/op 4.9565 us/op 0.73
Set add up to 64 items then delete last 3.0419 us/op 3.6756 us/op 0.83
OrderedSet add up to 64 items then delete last 4.3767 us/op 6.1651 us/op 0.71
Set add up to 64 items then delete middle 2.7838 us/op 3.7004 us/op 0.75
OrderedSet add up to 64 items then delete middle 6.2284 us/op 7.2982 us/op 0.85
Set add up to 128 items then delete first 5.3933 us/op 6.4096 us/op 0.84
OrderedSet add up to 128 items then delete first 8.3532 us/op 10.673 us/op 0.78
Set add up to 128 items then delete last 5.4067 us/op 7.0393 us/op 0.77
OrderedSet add up to 128 items then delete last 7.8267 us/op 10.605 us/op 0.74
Set add up to 128 items then delete middle 5.3921 us/op 6.8816 us/op 0.78
OrderedSet add up to 128 items then delete middle 14.979 us/op 17.925 us/op 0.84
Set add up to 256 items then delete first 10.168 us/op 14.073 us/op 0.72
OrderedSet add up to 256 items then delete first 15.572 us/op 21.095 us/op 0.74
Set add up to 256 items then delete last 10.873 us/op 13.986 us/op 0.78
OrderedSet add up to 256 items then delete last 16.389 us/op 21.995 us/op 0.75
Set add up to 256 items then delete middle 10.357 us/op 13.388 us/op 0.77
OrderedSet add up to 256 items then delete middle 42.150 us/op 48.485 us/op 0.87
transfer serialized Status (84 B) 1.3340 us/op 1.5680 us/op 0.85
copy serialized Status (84 B) 1.1840 us/op 1.4160 us/op 0.84
transfer serialized SignedVoluntaryExit (112 B) 1.4420 us/op 1.6670 us/op 0.87
copy serialized SignedVoluntaryExit (112 B) 1.2090 us/op 1.4610 us/op 0.83
transfer serialized ProposerSlashing (416 B) 1.5720 us/op 2.6000 us/op 0.60
copy serialized ProposerSlashing (416 B) 1.3890 us/op 2.0190 us/op 0.69
transfer serialized Attestation (485 B) 1.6150 us/op 2.1290 us/op 0.76
copy serialized Attestation (485 B) 1.5130 us/op 1.9710 us/op 0.77
transfer serialized AttesterSlashing (33232 B) 1.9160 us/op 2.2040 us/op 0.87
copy serialized AttesterSlashing (33232 B) 5.2780 us/op 7.9320 us/op 0.67
transfer serialized Small SignedBeaconBlock (128000 B) 2.6710 us/op 2.6260 us/op 1.02
copy serialized Small SignedBeaconBlock (128000 B) 15.949 us/op 27.324 us/op 0.58
transfer serialized Avg SignedBeaconBlock (200000 B) 2.9790 us/op 3.4160 us/op 0.87
copy serialized Avg SignedBeaconBlock (200000 B) 21.676 us/op 34.377 us/op 0.63
transfer serialized BlobsSidecar (524380 B) 2.5560 us/op 4.4150 us/op 0.58
copy serialized BlobsSidecar (524380 B) 187.60 us/op 101.64 us/op 1.85
transfer serialized Big SignedBeaconBlock (1000000 B) 2.6410 us/op 4.5380 us/op 0.58
copy serialized Big SignedBeaconBlock (1000000 B) 295.48 us/op 423.22 us/op 0.70
pass gossip attestations to forkchoice per slot 2.8440 ms/op 3.2007 ms/op 0.89
forkChoice updateHead vc 100000 bc 64 eq 0 506.78 us/op 568.20 us/op 0.89
forkChoice updateHead vc 600000 bc 64 eq 0 3.1984 ms/op 3.8148 ms/op 0.84
forkChoice updateHead vc 1000000 bc 64 eq 0 5.4247 ms/op 6.2877 ms/op 0.86
forkChoice updateHead vc 600000 bc 320 eq 0 3.1268 ms/op 3.4152 ms/op 0.92
forkChoice updateHead vc 600000 bc 1200 eq 0 3.2224 ms/op 3.3435 ms/op 0.96
forkChoice updateHead vc 600000 bc 7200 eq 0 3.6623 ms/op 4.4148 ms/op 0.83
forkChoice updateHead vc 600000 bc 64 eq 1000 10.842 ms/op 11.242 ms/op 0.96
forkChoice updateHead vc 600000 bc 64 eq 10000 11.000 ms/op 11.358 ms/op 0.97
forkChoice updateHead vc 600000 bc 64 eq 300000 14.920 ms/op 18.408 ms/op 0.81
computeDeltas 500000 validators 300 proto nodes 3.6601 ms/op 3.9587 ms/op 0.92
computeDeltas 500000 validators 1200 proto nodes 3.6835 ms/op 3.7921 ms/op 0.97
computeDeltas 500000 validators 7200 proto nodes 3.7288 ms/op 3.7887 ms/op 0.98
computeDeltas 750000 validators 300 proto nodes 5.5187 ms/op 5.7003 ms/op 0.97
computeDeltas 750000 validators 1200 proto nodes 5.5947 ms/op 5.9040 ms/op 0.95
computeDeltas 750000 validators 7200 proto nodes 5.8515 ms/op 6.0759 ms/op 0.96
computeDeltas 1400000 validators 300 proto nodes 10.561 ms/op 11.369 ms/op 0.93
computeDeltas 1400000 validators 1200 proto nodes 10.739 ms/op 11.064 ms/op 0.97
computeDeltas 1400000 validators 7200 proto nodes 10.681 ms/op 10.665 ms/op 1.00
computeDeltas 2100000 validators 300 proto nodes 15.967 ms/op 16.616 ms/op 0.96
computeDeltas 2100000 validators 1200 proto nodes 15.554 ms/op 15.888 ms/op 0.98
computeDeltas 2100000 validators 7200 proto nodes 15.918 ms/op 15.760 ms/op 1.01
altair processAttestation - 250000 vs - 7PWei normalcase 1.9595 ms/op 1.7091 ms/op 1.15
altair processAttestation - 250000 vs - 7PWei worstcase 2.8151 ms/op 2.9195 ms/op 0.96
altair processAttestation - setStatus - 1/6 committees join 137.89 us/op 104.19 us/op 1.32
altair processAttestation - setStatus - 1/3 committees join 277.76 us/op 196.59 us/op 1.41
altair processAttestation - setStatus - 1/2 committees join 397.34 us/op 268.26 us/op 1.48
altair processAttestation - setStatus - 2/3 committees join 510.82 us/op 317.03 us/op 1.61
altair processAttestation - setStatus - 4/5 committees join 708.17 us/op 469.49 us/op 1.51
altair processAttestation - setStatus - 100% committees join 779.73 us/op 549.65 us/op 1.42
altair processBlock - 250000 vs - 7PWei normalcase 5.5477 ms/op 6.0797 ms/op 0.91
altair processBlock - 250000 vs - 7PWei normalcase hashState 26.523 ms/op 26.221 ms/op 1.01
altair processBlock - 250000 vs - 7PWei worstcase 39.313 ms/op 38.021 ms/op 1.03
altair processBlock - 250000 vs - 7PWei worstcase hashState 76.723 ms/op 77.832 ms/op 0.99
phase0 processBlock - 250000 vs - 7PWei normalcase 2.1890 ms/op 2.3454 ms/op 0.93
phase0 processBlock - 250000 vs - 7PWei worstcase 26.913 ms/op 24.904 ms/op 1.08
altair processEth1Data - 250000 vs - 7PWei normalcase 382.12 us/op 314.01 us/op 1.22
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 6.2720 us/op 6.1110 us/op 1.03
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 29.549 us/op 24.503 us/op 1.21
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 11.866 us/op 7.0420 us/op 1.69
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 7.8080 us/op 5.8360 us/op 1.34
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 143.18 us/op 101.92 us/op 1.40
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 865.34 us/op 1.0995 ms/op 0.79
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 928.74 us/op 1.7069 ms/op 0.54
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.0576 ms/op 1.5301 ms/op 0.69
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.9520 ms/op 2.5898 ms/op 1.14
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.8626 ms/op 1.8075 ms/op 1.03
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.1422 ms/op 3.8817 ms/op 1.07
Tree 40 250000 create 262.55 ms/op 229.83 ms/op 1.14
Tree 40 250000 get(125000) 205.91 ns/op 151.30 ns/op 1.36
Tree 40 250000 set(125000) 734.35 ns/op 733.96 ns/op 1.00
Tree 40 250000 toArray() 19.500 ms/op 18.387 ms/op 1.06
Tree 40 250000 iterate all - toArray() + loop 19.830 ms/op 23.077 ms/op 0.86
Tree 40 250000 iterate all - get(i) 58.278 ms/op 55.242 ms/op 1.05
MutableVector 250000 create 12.010 ms/op 11.259 ms/op 1.07
MutableVector 250000 get(125000) 11.143 ns/op 6.3360 ns/op 1.76
MutableVector 250000 set(125000) 219.30 ns/op 193.34 ns/op 1.13
MutableVector 250000 toArray() 4.5717 ms/op 3.7833 ms/op 1.21
MutableVector 250000 iterate all - toArray() + loop 4.4785 ms/op 3.6151 ms/op 1.24
MutableVector 250000 iterate all - get(i) 1.8825 ms/op 1.6807 ms/op 1.12
Array 250000 create 3.7689 ms/op 3.4317 ms/op 1.10
Array 250000 clone - spread 1.5980 ms/op 1.4500 ms/op 1.10
Array 250000 get(125000) 0.47100 ns/op 0.42100 ns/op 1.12
Array 250000 set(125000) 0.49600 ns/op 0.44100 ns/op 1.12
Array 250000 iterate all - loop 119.59 us/op 93.124 us/op 1.28
effectiveBalanceIncrements clone Uint8Array 300000 36.131 us/op 31.535 us/op 1.15
effectiveBalanceIncrements clone MutableVector 300000 148.00 ns/op 128.00 ns/op 1.16
effectiveBalanceIncrements rw all Uint8Array 300000 180.97 us/op 198.29 us/op 0.91
effectiveBalanceIncrements rw all MutableVector 300000 73.344 ms/op 69.274 ms/op 1.06
phase0 afterProcessEpoch - 250000 vs - 7PWei 90.836 ms/op 89.871 ms/op 1.01
Array.fill - length 1000000 4.2229 ms/op 3.5923 ms/op 1.18
Array push - length 1000000 20.591 ms/op 17.200 ms/op 1.20
Array.get 0.29038 ns/op 0.29002 ns/op 1.00
Uint8Array.get 0.45065 ns/op 0.44924 ns/op 1.00
phase0 beforeProcessEpoch - 250000 vs - 7PWei 17.122 ms/op 17.872 ms/op 0.96
altair processEpoch - mainnet_e81889 354.90 ms/op 346.12 ms/op 1.03
mainnet_e81889 - altair beforeProcessEpoch 18.955 ms/op 17.186 ms/op 1.10
mainnet_e81889 - altair processJustificationAndFinalization 13.247 us/op 18.523 us/op 0.72
mainnet_e81889 - altair processInactivityUpdates 6.0096 ms/op 4.9391 ms/op 1.22
mainnet_e81889 - altair processRewardsAndPenalties 46.585 ms/op 60.481 ms/op 0.77
mainnet_e81889 - altair processRegistryUpdates 1.8530 us/op 2.7600 us/op 0.67
mainnet_e81889 - altair processSlashings 563.00 ns/op 563.00 ns/op 1.00
mainnet_e81889 - altair processEth1DataReset 435.00 ns/op 546.00 ns/op 0.80
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.1812 ms/op 3.2122 ms/op 0.37
mainnet_e81889 - altair processSlashingsReset 2.5390 us/op 3.8050 us/op 0.67
mainnet_e81889 - altair processRandaoMixesReset 4.7920 us/op 9.0650 us/op 0.53
mainnet_e81889 - altair processHistoricalRootsUpdate 600.00 ns/op 808.00 ns/op 0.74
mainnet_e81889 - altair processParticipationFlagUpdates 2.8530 us/op 3.2050 us/op 0.89
mainnet_e81889 - altair processSyncCommitteeUpdates 651.00 ns/op 465.00 ns/op 1.40
mainnet_e81889 - altair afterProcessEpoch 94.130 ms/op 94.000 ms/op 1.00
capella processEpoch - mainnet_e217614 1.2163 s/op 1.2873 s/op 0.94
mainnet_e217614 - capella beforeProcessEpoch 70.808 ms/op 80.660 ms/op 0.88
mainnet_e217614 - capella processJustificationAndFinalization 19.799 us/op 16.000 us/op 1.24
mainnet_e217614 - capella processInactivityUpdates 18.457 ms/op 19.882 ms/op 0.93
mainnet_e217614 - capella processRewardsAndPenalties 230.68 ms/op 258.65 ms/op 0.89
mainnet_e217614 - capella processRegistryUpdates 12.627 us/op 17.680 us/op 0.71
mainnet_e217614 - capella processSlashings 388.00 ns/op 627.00 ns/op 0.62
mainnet_e217614 - capella processEth1DataReset 295.00 ns/op 329.00 ns/op 0.90
mainnet_e217614 - capella processEffectiveBalanceUpdates 11.806 ms/op 14.189 ms/op 0.83
mainnet_e217614 - capella processSlashingsReset 3.2150 us/op 3.0300 us/op 1.06
mainnet_e217614 - capella processRandaoMixesReset 3.7600 us/op 4.1400 us/op 0.91
mainnet_e217614 - capella processHistoricalRootsUpdate 604.00 ns/op 965.00 ns/op 0.63
mainnet_e217614 - capella processParticipationFlagUpdates 2.0850 us/op 1.8390 us/op 1.13
mainnet_e217614 - capella afterProcessEpoch 240.65 ms/op 237.71 ms/op 1.01
phase0 processEpoch - mainnet_e58758 404.47 ms/op 450.52 ms/op 0.90
mainnet_e58758 - phase0 beforeProcessEpoch 78.994 ms/op 80.920 ms/op 0.98
mainnet_e58758 - phase0 processJustificationAndFinalization 18.246 us/op 21.346 us/op 0.85
mainnet_e58758 - phase0 processRewardsAndPenalties 35.494 ms/op 26.241 ms/op 1.35
mainnet_e58758 - phase0 processRegistryUpdates 7.3130 us/op 7.8360 us/op 0.93
mainnet_e58758 - phase0 processSlashings 319.00 ns/op 435.00 ns/op 0.73
mainnet_e58758 - phase0 processEth1DataReset 361.00 ns/op 358.00 ns/op 1.01
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.1075 ms/op 1.1592 ms/op 0.96
mainnet_e58758 - phase0 processSlashingsReset 3.5920 us/op 4.6200 us/op 0.78
mainnet_e58758 - phase0 processRandaoMixesReset 4.2450 us/op 6.2170 us/op 0.68
mainnet_e58758 - phase0 processHistoricalRootsUpdate 328.00 ns/op 484.00 ns/op 0.68
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.8860 us/op 4.0770 us/op 0.95
mainnet_e58758 - phase0 afterProcessEpoch 78.485 ms/op 83.954 ms/op 0.93
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2289 ms/op 1.5922 ms/op 0.77
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.9508 ms/op 2.4097 ms/op 0.81
altair processInactivityUpdates - 250000 normalcase 16.078 ms/op 25.321 ms/op 0.63
altair processInactivityUpdates - 250000 worstcase 15.062 ms/op 25.423 ms/op 0.59
phase0 processRegistryUpdates - 250000 normalcase 6.9390 us/op 15.717 us/op 0.44
phase0 processRegistryUpdates - 250000 badcase_full_deposits 259.07 us/op 453.98 us/op 0.57
phase0 processRegistryUpdates - 250000 worstcase 0.5 114.76 ms/op 161.89 ms/op 0.71
altair processRewardsAndPenalties - 250000 normalcase 38.976 ms/op 55.740 ms/op 0.70
altair processRewardsAndPenalties - 250000 worstcase 39.134 ms/op 57.105 ms/op 0.69
phase0 getAttestationDeltas - 250000 normalcase 7.4632 ms/op 12.480 ms/op 0.60
phase0 getAttestationDeltas - 250000 worstcase 7.7720 ms/op 13.127 ms/op 0.59
phase0 processSlashings - 250000 worstcase 78.155 us/op 143.98 us/op 0.54
altair processSyncCommitteeUpdates - 250000 120.27 ms/op 165.80 ms/op 0.73
BeaconState.hashTreeRoot - No change 282.00 ns/op 558.00 ns/op 0.51
BeaconState.hashTreeRoot - 1 full validator 113.27 us/op 111.06 us/op 1.02
BeaconState.hashTreeRoot - 32 full validator 1.5433 ms/op 929.94 us/op 1.66
BeaconState.hashTreeRoot - 512 full validator 10.607 ms/op 9.7081 ms/op 1.09
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 114.58 us/op 119.61 us/op 0.96
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.5566 ms/op 1.9002 ms/op 0.82
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 19.628 ms/op 21.511 ms/op 0.91
BeaconState.hashTreeRoot - 1 balances 86.123 us/op 90.729 us/op 0.95
BeaconState.hashTreeRoot - 32 balances 816.25 us/op 1.3878 ms/op 0.59
BeaconState.hashTreeRoot - 512 balances 11.143 ms/op 11.625 ms/op 0.96
BeaconState.hashTreeRoot - 250000 balances 169.97 ms/op 220.70 ms/op 0.77
aggregationBits - 2048 els - zipIndexesInBitList 24.235 us/op 37.371 us/op 0.65
byteArrayEquals 32 54.077 ns/op 58.457 ns/op 0.93
Buffer.compare 32 17.277 ns/op 20.950 ns/op 0.82
byteArrayEquals 1024 1.5846 us/op 1.7507 us/op 0.91
Buffer.compare 1024 25.783 ns/op 27.108 ns/op 0.95
byteArrayEquals 16384 25.249 us/op 26.255 us/op 0.96
Buffer.compare 16384 204.11 ns/op 210.77 ns/op 0.97
byteArrayEquals 123687377 191.90 ms/op 200.82 ms/op 0.96
Buffer.compare 123687377 7.0466 ms/op 7.2944 ms/op 0.97
byteArrayEquals 32 - diff last byte 52.336 ns/op 54.439 ns/op 0.96
Buffer.compare 32 - diff last byte 17.130 ns/op 18.215 ns/op 0.94
byteArrayEquals 1024 - diff last byte 1.5774 us/op 1.6465 us/op 0.96
Buffer.compare 1024 - diff last byte 24.909 ns/op 27.384 ns/op 0.91
byteArrayEquals 16384 - diff last byte 25.136 us/op 26.013 us/op 0.97
Buffer.compare 16384 - diff last byte 198.39 ns/op 213.11 ns/op 0.93
byteArrayEquals 123687377 - diff last byte 189.94 ms/op 196.35 ms/op 0.97
Buffer.compare 123687377 - diff last byte 6.7205 ms/op 7.4064 ms/op 0.91
byteArrayEquals 32 - random bytes 5.3780 ns/op 5.4380 ns/op 0.99
Buffer.compare 32 - random bytes 17.355 ns/op 17.582 ns/op 0.99
byteArrayEquals 1024 - random bytes 5.2920 ns/op 5.5020 ns/op 0.96
Buffer.compare 1024 - random bytes 17.220 ns/op 17.607 ns/op 0.98
byteArrayEquals 16384 - random bytes 5.2450 ns/op 5.2210 ns/op 1.00
Buffer.compare 16384 - random bytes 17.387 ns/op 17.543 ns/op 0.99
byteArrayEquals 123687377 - random bytes 6.6200 ns/op 6.5300 ns/op 1.01
Buffer.compare 123687377 - random bytes 18.530 ns/op 18.930 ns/op 0.98
regular array get 100000 times 39.674 us/op 32.975 us/op 1.20
wrappedArray get 100000 times 33.370 us/op 32.756 us/op 1.02
arrayWithProxy get 100000 times 13.718 ms/op 13.784 ms/op 1.00
ssz.Root.equals 46.832 ns/op 45.952 ns/op 1.02
byteArrayEquals 46.222 ns/op 45.794 ns/op 1.01
Buffer.compare 10.658 ns/op 10.624 ns/op 1.00
shuffle list - 16384 els 6.4229 ms/op 6.6869 ms/op 0.96
shuffle list - 250000 els 97.614 ms/op 98.577 ms/op 0.99
processSlot - 1 slots 14.387 us/op 17.155 us/op 0.84
processSlot - 32 slots 3.6831 ms/op 3.0575 ms/op 1.20
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 35.654 ms/op 38.304 ms/op 0.93
getCommitteeAssignments - req 1 vs - 250000 vc 2.1694 ms/op 2.2258 ms/op 0.97
getCommitteeAssignments - req 100 vs - 250000 vc 4.1376 ms/op 4.3877 ms/op 0.94
getCommitteeAssignments - req 1000 vs - 250000 vc 4.4395 ms/op 4.7652 ms/op 0.93
findModifiedValidators - 10000 modified validators 250.16 ms/op 303.24 ms/op 0.82
findModifiedValidators - 1000 modified validators 189.65 ms/op 228.13 ms/op 0.83
findModifiedValidators - 100 modified validators 199.75 ms/op 181.95 ms/op 1.10
findModifiedValidators - 10 modified validators 217.49 ms/op 184.47 ms/op 1.18
findModifiedValidators - 1 modified validators 201.71 ms/op 218.30 ms/op 0.92
findModifiedValidators - no difference 189.85 ms/op 247.89 ms/op 0.77
compare ViewDUs 3.2535 s/op 3.7347 s/op 0.87
compare each validator Uint8Array 1.4881 s/op 1.7799 s/op 0.84
compare ViewDU to Uint8Array 1.0163 s/op 1.5443 s/op 0.66
migrate state 1000000 validators, 24 modified, 0 new 617.21 ms/op 831.61 ms/op 0.74
migrate state 1000000 validators, 1700 modified, 1000 new 961.52 ms/op 1.0680 s/op 0.90
migrate state 1000000 validators, 3400 modified, 2000 new 1.0365 s/op 1.2938 s/op 0.80
migrate state 1500000 validators, 24 modified, 0 new 596.23 ms/op 699.75 ms/op 0.85
migrate state 1500000 validators, 1700 modified, 1000 new 885.72 ms/op 909.45 ms/op 0.97
migrate state 1500000 validators, 3400 modified, 2000 new 1.0696 s/op 1.1606 s/op 0.92
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.6400 ns/op 5.2000 ns/op 0.89
state getBlockRootAtSlot - 250000 vs - 7PWei 682.16 ns/op 795.44 ns/op 0.86
computeProposers - vc 250000 7.7659 ms/op 11.623 ms/op 0.67
computeEpochShuffling - vc 250000 94.515 ms/op 107.51 ms/op 0.88
getNextSyncCommittee - vc 250000 137.64 ms/op 159.63 ms/op 0.86
computeSigningRoot for AttestationData 26.733 us/op 31.276 us/op 0.85
hash AttestationData serialized data then Buffer.toString(base64) 1.6529 us/op 1.8995 us/op 0.87
toHexString serialized data 901.19 ns/op 1.1483 us/op 0.78
Buffer.toString(base64) 192.87 ns/op 235.24 ns/op 0.82
block root to RootHex using toHex 154.94 ns/op 175.77 ns/op 0.88
block root to RootHex using toRootHex 97.200 ns/op 104.98 ns/op 0.93

by benchmarkbot/action

@wemeetagain wemeetagain merged commit cbc00c7 into unstable Sep 9, 2024
20 checks passed
@wemeetagain wemeetagain deleted the mkeil/diff-util branch September 9, 2024 21:37
philknows pushed a commit that referenced this pull request Sep 11, 2024
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.22.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.

2 participants