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: toPubkeyHex #7065

Merged
merged 4 commits into from
Sep 4, 2024
Merged

fix: toPubkeyHex #7065

merged 4 commits into from
Sep 4, 2024

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Sep 2, 2024

Motivation

Description

  • implement toPubkeyHex() for browser and nodejs in @lodestar/utils
    • for browser, refactor common code in new bytesIntoCharCodes() function
  • consume it when applicable

part of #7036

Copy link

codecov bot commented Sep 2, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 32 lines in your changes missing coverage. Please review.

Project coverage is 49.36%. Comparing base (19ac678) to head (2513033).
Report is 1 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #7065      +/-   ##
============================================
+ Coverage     49.35%   49.36%   +0.01%     
============================================
  Files           592      592              
  Lines         39293    39324      +31     
  Branches       2248     2247       -1     
============================================
+ Hits          19392    19414      +22     
- Misses        19860    19869       +9     
  Partials         41       41              

Copy link
Contributor

github-actions bot commented Sep 2, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: e038029 Previous: 19ac678 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.8020 ms/op 2.8321 ms/op 0.64
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 38.116 us/op 67.494 us/op 0.56
BLS verify - blst 886.33 us/op 848.04 us/op 1.05
BLS verifyMultipleSignatures 3 - blst 1.3190 ms/op 1.3035 ms/op 1.01
BLS verifyMultipleSignatures 8 - blst 2.0932 ms/op 1.8701 ms/op 1.12
BLS verifyMultipleSignatures 32 - blst 4.4784 ms/op 5.3396 ms/op 0.84
BLS verifyMultipleSignatures 64 - blst 8.4605 ms/op 9.8476 ms/op 0.86
BLS verifyMultipleSignatures 128 - blst 16.023 ms/op 17.476 ms/op 0.92
BLS deserializing 10000 signatures 613.95 ms/op 637.59 ms/op 0.96
BLS deserializing 100000 signatures 6.1389 s/op 6.3941 s/op 0.96
BLS verifyMultipleSignatures - same message - 3 - blst 938.39 us/op 967.98 us/op 0.97
BLS verifyMultipleSignatures - same message - 8 - blst 1.0777 ms/op 1.0840 ms/op 0.99
BLS verifyMultipleSignatures - same message - 32 - blst 1.6446 ms/op 1.6580 ms/op 0.99
BLS verifyMultipleSignatures - same message - 64 - blst 2.3764 ms/op 2.4772 ms/op 0.96
BLS verifyMultipleSignatures - same message - 128 - blst 3.9473 ms/op 4.0416 ms/op 0.98
BLS aggregatePubkeys 32 - blst 17.802 us/op 18.894 us/op 0.94
BLS aggregatePubkeys 128 - blst 64.091 us/op 64.499 us/op 0.99
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 61.737 ms/op 61.472 ms/op 1.00
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 45.002 ms/op 57.203 ms/op 0.79
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 29.665 ms/op 31.743 ms/op 0.93
getSlashingsAndExits - default max 70.927 us/op 86.169 us/op 0.82
getSlashingsAndExits - 2k 251.01 us/op 304.34 us/op 0.82
proposeBlockBody type=full, size=empty 4.9355 ms/op 5.0533 ms/op 0.98
isKnown best case - 1 super set check 486.00 ns/op 511.00 ns/op 0.95
isKnown normal case - 2 super set checks 472.00 ns/op 500.00 ns/op 0.94
isKnown worse case - 16 super set checks 471.00 ns/op 507.00 ns/op 0.93
InMemoryCheckpointStateCache - add get delete 3.0630 us/op 3.1310 us/op 0.98
updateUnfinalizedPubkeys - updating 10 pubkeys 537.29 us/op 448.06 us/op 1.20
updateUnfinalizedPubkeys - updating 100 pubkeys 2.1045 ms/op 2.2140 ms/op 0.95
updateUnfinalizedPubkeys - updating 1000 pubkeys 38.443 ms/op 40.379 ms/op 0.95
validate api signedAggregateAndProof - struct 1.6630 ms/op 1.6546 ms/op 1.01
validate gossip signedAggregateAndProof - struct 1.4837 ms/op 1.5846 ms/op 0.94
validate gossip attestation - vc 640000 1.0009 ms/op 986.09 us/op 1.02
batch validate gossip attestation - vc 640000 - chunk 32 123.21 us/op 136.31 us/op 0.90
batch validate gossip attestation - vc 640000 - chunk 64 103.69 us/op 124.58 us/op 0.83
batch validate gossip attestation - vc 640000 - chunk 128 95.868 us/op 105.41 us/op 0.91
batch validate gossip attestation - vc 640000 - chunk 256 92.563 us/op 99.958 us/op 0.93
pickEth1Vote - no votes 784.72 us/op 861.83 us/op 0.91
pickEth1Vote - max votes 5.6621 ms/op 4.3587 ms/op 1.30
pickEth1Vote - Eth1Data hashTreeRoot value x2048 13.206 ms/op 10.193 ms/op 1.30
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 19.987 ms/op 13.310 ms/op 1.50
pickEth1Vote - Eth1Data fastSerialize value x2048 333.62 us/op 363.20 us/op 0.92
pickEth1Vote - Eth1Data fastSerialize tree x2048 3.9034 ms/op 2.0327 ms/op 1.92
bytes32 toHexString 558.00 ns/op 592.00 ns/op 0.94
bytes32 Buffer.toString(hex) 405.00 ns/op 446.00 ns/op 0.91
bytes32 Buffer.toString(hex) from Uint8Array 548.00 ns/op 538.00 ns/op 1.02
bytes32 Buffer.toString(hex) + 0x 413.00 ns/op 453.00 ns/op 0.91
Object access 1 prop 0.33500 ns/op 0.33000 ns/op 1.02
Map access 1 prop 0.31800 ns/op 0.33100 ns/op 0.96
Object get x1000 4.7870 ns/op 5.1880 ns/op 0.92
Map get x1000 5.3990 ns/op 6.1030 ns/op 0.88
Object set x1000 24.571 ns/op 22.634 ns/op 1.09
Map set x1000 18.917 ns/op 19.357 ns/op 0.98
Return object 10000 times 0.28220 ns/op 0.30150 ns/op 0.94
Throw Error 10000 times 2.5398 us/op 2.6919 us/op 0.94
toHex 110.53 ns/op 109.48 ns/op 1.01
Buffer.from 103.02 ns/op 104.16 ns/op 0.99
shared Buffer 71.763 ns/op 69.938 ns/op 1.03
fastMsgIdFn sha256 / 200 bytes 1.9730 us/op 2.0060 us/op 0.98
fastMsgIdFn h32 xxhash / 200 bytes 409.00 ns/op 419.00 ns/op 0.98
fastMsgIdFn h64 xxhash / 200 bytes 442.00 ns/op 449.00 ns/op 0.98
fastMsgIdFn sha256 / 1000 bytes 5.8370 us/op 5.8630 us/op 1.00
fastMsgIdFn h32 xxhash / 1000 bytes 527.00 ns/op 538.00 ns/op 0.98
fastMsgIdFn h64 xxhash / 1000 bytes 512.00 ns/op 514.00 ns/op 1.00
fastMsgIdFn sha256 / 10000 bytes 49.333 us/op 49.293 us/op 1.00
fastMsgIdFn h32 xxhash / 10000 bytes 1.8730 us/op 1.8950 us/op 0.99
fastMsgIdFn h64 xxhash / 10000 bytes 1.3070 us/op 1.3280 us/op 0.98
send data - 1000 256B messages 9.9230 ms/op 9.6281 ms/op 1.03
send data - 1000 512B messages 13.551 ms/op 13.622 ms/op 0.99
send data - 1000 1024B messages 21.611 ms/op 20.433 ms/op 1.06
send data - 1000 1200B messages 22.924 ms/op 23.685 ms/op 0.97
send data - 1000 2048B messages 29.932 ms/op 30.508 ms/op 0.98
send data - 1000 4096B messages 25.703 ms/op 27.505 ms/op 0.93
send data - 1000 16384B messages 66.443 ms/op 72.192 ms/op 0.92
send data - 1000 65536B messages 247.71 ms/op 246.77 ms/op 1.00
enrSubnets - fastDeserialize 64 bits 1.1240 us/op 1.1560 us/op 0.97
enrSubnets - ssz BitVector 64 bits 513.00 ns/op 521.00 ns/op 0.98
enrSubnets - fastDeserialize 4 bits 331.00 ns/op 342.00 ns/op 0.97
enrSubnets - ssz BitVector 4 bits 515.00 ns/op 527.00 ns/op 0.98
prioritizePeers score -10:0 att 32-0.1 sync 2-0 119.48 us/op 108.45 us/op 1.10
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 158.36 us/op 133.26 us/op 1.19
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 169.57 us/op 187.65 us/op 0.90
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 441.45 us/op 330.36 us/op 1.34
prioritizePeers score 0:0 att 64-1 sync 4-1 607.15 us/op 400.94 us/op 1.51
array of 16000 items push then shift 1.2486 us/op 1.2120 us/op 1.03
LinkedList of 16000 items push then shift 7.1330 ns/op 7.1240 ns/op 1.00
array of 16000 items push then pop 83.417 ns/op 79.404 ns/op 1.05
LinkedList of 16000 items push then pop 6.0990 ns/op 6.0520 ns/op 1.01
array of 24000 items push then shift 1.9172 us/op 1.7675 us/op 1.08
LinkedList of 24000 items push then shift 6.4020 ns/op 6.7080 ns/op 0.95
array of 24000 items push then pop 107.00 ns/op 102.47 ns/op 1.04
LinkedList of 24000 items push then pop 5.9620 ns/op 6.0500 ns/op 0.99
intersect bitArray bitLen 8 5.2320 ns/op 5.1640 ns/op 1.01
intersect array and set length 8 38.165 ns/op 35.474 ns/op 1.08
intersect bitArray bitLen 128 26.790 ns/op 25.498 ns/op 1.05
intersect array and set length 128 576.09 ns/op 573.44 ns/op 1.00
bitArray.getTrueBitIndexes() bitLen 128 2.2970 us/op 1.3960 us/op 1.65
bitArray.getTrueBitIndexes() bitLen 248 3.3020 us/op 2.0690 us/op 1.60
bitArray.getTrueBitIndexes() bitLen 512 7.3300 us/op 3.7920 us/op 1.93
Buffer.concat 32 items 970.00 ns/op 1.0110 us/op 0.96
Uint8Array.set 32 items 1.7390 us/op 2.0080 us/op 0.87
Buffer.copy 2.0270 us/op 1.8130 us/op 1.12
Uint8Array.set - with subarray 2.6230 us/op 1.8720 us/op 1.40
Uint8Array.set - without subarray 1.8890 us/op 1.4190 us/op 1.33
getUint32 - dataview 433.00 ns/op 406.00 ns/op 1.07
getUint32 - manual 339.00 ns/op 332.00 ns/op 1.02
Set add up to 64 items then delete first 1.8084 us/op 1.7552 us/op 1.03
OrderedSet add up to 64 items then delete first 2.7980 us/op 2.7300 us/op 1.02
Set add up to 64 items then delete last 2.0689 us/op 2.0480 us/op 1.01
OrderedSet add up to 64 items then delete last 3.1178 us/op 3.1501 us/op 0.99
Set add up to 64 items then delete middle 2.0492 us/op 2.0454 us/op 1.00
OrderedSet add up to 64 items then delete middle 4.4555 us/op 4.5576 us/op 0.98
Set add up to 128 items then delete first 4.0162 us/op 3.9423 us/op 1.02
OrderedSet add up to 128 items then delete first 6.2841 us/op 5.8989 us/op 1.07
Set add up to 128 items then delete last 3.8772 us/op 3.9290 us/op 0.99
OrderedSet add up to 128 items then delete last 5.8830 us/op 6.1054 us/op 0.96
Set add up to 128 items then delete middle 3.8782 us/op 3.9268 us/op 0.99
OrderedSet add up to 128 items then delete middle 11.691 us/op 11.927 us/op 0.98
Set add up to 256 items then delete first 7.8395 us/op 7.2082 us/op 1.09
OrderedSet add up to 256 items then delete first 12.418 us/op 11.164 us/op 1.11
Set add up to 256 items then delete last 7.7468 us/op 7.2220 us/op 1.07
OrderedSet add up to 256 items then delete last 11.896 us/op 11.530 us/op 1.03
Set add up to 256 items then delete middle 7.7431 us/op 7.1636 us/op 1.08
OrderedSet add up to 256 items then delete middle 35.630 us/op 32.853 us/op 1.08
transfer serialized Status (84 B) 1.5540 us/op 1.5540 us/op 1.00
copy serialized Status (84 B) 1.3120 us/op 1.3360 us/op 0.98
transfer serialized SignedVoluntaryExit (112 B) 1.7540 us/op 1.6770 us/op 1.05
copy serialized SignedVoluntaryExit (112 B) 1.3860 us/op 1.4590 us/op 0.95
transfer serialized ProposerSlashing (416 B) 2.6270 us/op 2.5100 us/op 1.05
copy serialized ProposerSlashing (416 B) 1.6610 us/op 2.5390 us/op 0.65
transfer serialized Attestation (485 B) 2.4570 us/op 2.3670 us/op 1.04
copy serialized Attestation (485 B) 2.2050 us/op 2.4590 us/op 0.90
transfer serialized AttesterSlashing (33232 B) 2.3390 us/op 2.7370 us/op 0.85
copy serialized AttesterSlashing (33232 B) 5.5710 us/op 5.0920 us/op 1.09
transfer serialized Small SignedBeaconBlock (128000 B) 2.2540 us/op 2.7930 us/op 0.81
copy serialized Small SignedBeaconBlock (128000 B) 14.435 us/op 14.499 us/op 1.00
transfer serialized Avg SignedBeaconBlock (200000 B) 2.3250 us/op 2.5670 us/op 0.91
copy serialized Avg SignedBeaconBlock (200000 B) 21.418 us/op 12.072 us/op 1.77
transfer serialized BlobsSidecar (524380 B) 2.7500 us/op 2.5980 us/op 1.06
copy serialized BlobsSidecar (524380 B) 70.857 us/op 102.70 us/op 0.69
transfer serialized Big SignedBeaconBlock (1000000 B) 2.8870 us/op 3.3070 us/op 0.87
copy serialized Big SignedBeaconBlock (1000000 B) 135.13 us/op 137.54 us/op 0.98
pass gossip attestations to forkchoice per slot 2.3940 ms/op 2.4148 ms/op 0.99
forkChoice updateHead vc 100000 bc 64 eq 0 530.98 us/op 406.49 us/op 1.31
forkChoice updateHead vc 600000 bc 64 eq 0 2.3972 ms/op 2.4888 ms/op 0.96
forkChoice updateHead vc 1000000 bc 64 eq 0 4.1547 ms/op 4.0793 ms/op 1.02
forkChoice updateHead vc 600000 bc 320 eq 0 2.5484 ms/op 2.3563 ms/op 1.08
forkChoice updateHead vc 600000 bc 1200 eq 0 2.5323 ms/op 2.3778 ms/op 1.07
forkChoice updateHead vc 600000 bc 7200 eq 0 3.3630 ms/op 2.8583 ms/op 1.18
forkChoice updateHead vc 600000 bc 64 eq 1000 9.8220 ms/op 9.1681 ms/op 1.07
forkChoice updateHead vc 600000 bc 64 eq 10000 9.6111 ms/op 9.0124 ms/op 1.07
forkChoice updateHead vc 600000 bc 64 eq 300000 11.167 ms/op 10.988 ms/op 1.02
computeDeltas 500000 validators 300 proto nodes 2.9413 ms/op 2.9131 ms/op 1.01
computeDeltas 500000 validators 1200 proto nodes 3.0509 ms/op 2.9822 ms/op 1.02
computeDeltas 500000 validators 7200 proto nodes 3.0470 ms/op 3.0487 ms/op 1.00
computeDeltas 750000 validators 300 proto nodes 4.6908 ms/op 4.6492 ms/op 1.01
computeDeltas 750000 validators 1200 proto nodes 4.5511 ms/op 4.5435 ms/op 1.00
computeDeltas 750000 validators 7200 proto nodes 4.6327 ms/op 4.6144 ms/op 1.00
computeDeltas 1400000 validators 300 proto nodes 8.4343 ms/op 8.7679 ms/op 0.96
computeDeltas 1400000 validators 1200 proto nodes 8.5901 ms/op 8.8281 ms/op 0.97
computeDeltas 1400000 validators 7200 proto nodes 8.4198 ms/op 8.7140 ms/op 0.97
computeDeltas 2100000 validators 300 proto nodes 12.806 ms/op 13.373 ms/op 0.96
computeDeltas 2100000 validators 1200 proto nodes 12.477 ms/op 13.379 ms/op 0.93
computeDeltas 2100000 validators 7200 proto nodes 12.317 ms/op 13.010 ms/op 0.95
altair processAttestation - 250000 vs - 7PWei normalcase 1.4107 ms/op 1.4445 ms/op 0.98
altair processAttestation - 250000 vs - 7PWei worstcase 2.1592 ms/op 2.1422 ms/op 1.01
altair processAttestation - setStatus - 1/6 committees join 69.092 us/op 79.887 us/op 0.86
altair processAttestation - setStatus - 1/3 committees join 136.16 us/op 144.41 us/op 0.94
altair processAttestation - setStatus - 1/2 committees join 195.54 us/op 211.25 us/op 0.93
altair processAttestation - setStatus - 2/3 committees join 269.07 us/op 277.98 us/op 0.97
altair processAttestation - setStatus - 4/5 committees join 378.58 us/op 389.94 us/op 0.97
altair processAttestation - setStatus - 100% committees join 461.75 us/op 468.08 us/op 0.99
altair processBlock - 250000 vs - 7PWei normalcase 4.1883 ms/op 3.7004 ms/op 1.13
altair processBlock - 250000 vs - 7PWei normalcase hashState 26.036 ms/op 24.910 ms/op 1.05
altair processBlock - 250000 vs - 7PWei worstcase 38.290 ms/op 35.160 ms/op 1.09
altair processBlock - 250000 vs - 7PWei worstcase hashState 70.204 ms/op 67.930 ms/op 1.03
phase0 processBlock - 250000 vs - 7PWei normalcase 1.9988 ms/op 1.8277 ms/op 1.09
phase0 processBlock - 250000 vs - 7PWei worstcase 23.278 ms/op 21.938 ms/op 1.06
altair processEth1Data - 250000 vs - 7PWei normalcase 241.33 us/op 243.91 us/op 0.99
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 6.9980 us/op 6.7210 us/op 1.04
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 32.471 us/op 38.024 us/op 0.85
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 5.5840 us/op 12.144 us/op 0.46
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 5.7000 us/op 6.7360 us/op 0.85
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 139.76 us/op 149.58 us/op 0.93
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 963.42 us/op 953.99 us/op 1.01
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.3963 ms/op 1.3125 ms/op 1.06
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.4226 ms/op 1.3012 ms/op 1.09
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.9333 ms/op 3.0356 ms/op 0.97
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.2435 ms/op 1.3580 ms/op 0.92
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 2.9229 ms/op 3.0768 ms/op 0.95
Tree 40 250000 create 177.06 ms/op 183.32 ms/op 0.97
Tree 40 250000 get(125000) 103.94 ns/op 105.83 ns/op 0.98
Tree 40 250000 set(125000) 506.95 ns/op 584.64 ns/op 0.87
Tree 40 250000 toArray() 12.189 ms/op 12.865 ms/op 0.95
Tree 40 250000 iterate all - toArray() + loop 12.277 ms/op 9.6578 ms/op 1.27
Tree 40 250000 iterate all - get(i) 40.235 ms/op 43.002 ms/op 0.94
Array 250000 create 2.4021 ms/op 2.4141 ms/op 1.00
Array 250000 clone - spread 1.1662 ms/op 1.2351 ms/op 0.94
Array 250000 get(125000) 0.55900 ns/op 0.62200 ns/op 0.90
Array 250000 set(125000) 0.56200 ns/op 0.61400 ns/op 0.92
Array 250000 iterate all - loop 73.263 us/op 75.278 us/op 0.97
phase0 afterProcessEpoch - 250000 vs - 7PWei 75.962 ms/op 82.033 ms/op 0.93
Array.fill - length 1000000 2.4782 ms/op 2.5026 ms/op 0.99
Array push - length 1000000 15.149 ms/op 14.611 ms/op 1.04
Array.get 0.25308 ns/op 0.25809 ns/op 0.98
Uint8Array.get 0.32531 ns/op 0.32784 ns/op 0.99
phase0 beforeProcessEpoch - 250000 vs - 7PWei 13.864 ms/op 14.794 ms/op 0.94
altair processEpoch - mainnet_e81889 313.31 ms/op 276.46 ms/op 1.13
mainnet_e81889 - altair beforeProcessEpoch 18.059 ms/op 18.737 ms/op 0.96
mainnet_e81889 - altair processJustificationAndFinalization 9.6910 us/op 9.3150 us/op 1.04
mainnet_e81889 - altair processInactivityUpdates 4.2721 ms/op 4.7977 ms/op 0.89
mainnet_e81889 - altair processRewardsAndPenalties 57.647 ms/op 54.563 ms/op 1.06
mainnet_e81889 - altair processRegistryUpdates 2.0160 us/op 1.9330 us/op 1.04
mainnet_e81889 - altair processSlashings 805.00 ns/op 760.00 ns/op 1.06
mainnet_e81889 - altair processEth1DataReset 734.00 ns/op 771.00 ns/op 0.95
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.0689 ms/op 1.7678 ms/op 0.60
mainnet_e81889 - altair processSlashingsReset 1.3810 us/op 3.3310 us/op 0.41
mainnet_e81889 - altair processRandaoMixesReset 1.6460 us/op 4.1960 us/op 0.39
mainnet_e81889 - altair processHistoricalRootsUpdate 403.00 ns/op 575.00 ns/op 0.70
mainnet_e81889 - altair processParticipationFlagUpdates 1.2090 us/op 2.0970 us/op 0.58
mainnet_e81889 - altair processSyncCommitteeUpdates 654.00 ns/op 729.00 ns/op 0.90
mainnet_e81889 - altair afterProcessEpoch 76.480 ms/op 82.792 ms/op 0.92
capella processEpoch - mainnet_e217614 1.0675 s/op 1.2556 s/op 0.85
mainnet_e217614 - capella beforeProcessEpoch 60.297 ms/op 78.466 ms/op 0.77
mainnet_e217614 - capella processJustificationAndFinalization 6.1890 us/op 18.625 us/op 0.33
mainnet_e217614 - capella processInactivityUpdates 12.573 ms/op 12.605 ms/op 1.00
mainnet_e217614 - capella processRewardsAndPenalties 252.78 ms/op 254.58 ms/op 0.99
mainnet_e217614 - capella processRegistryUpdates 12.157 us/op 14.403 us/op 0.84
mainnet_e217614 - capella processSlashings 794.00 ns/op 944.00 ns/op 0.84
mainnet_e217614 - capella processEth1DataReset 765.00 ns/op 879.00 ns/op 0.87
mainnet_e217614 - capella processEffectiveBalanceUpdates 11.262 ms/op 14.825 ms/op 0.76
mainnet_e217614 - capella processSlashingsReset 2.5220 us/op 3.4900 us/op 0.72
mainnet_e217614 - capella processRandaoMixesReset 3.1570 us/op 8.5700 us/op 0.37
mainnet_e217614 - capella processHistoricalRootsUpdate 703.00 ns/op 786.00 ns/op 0.89
mainnet_e217614 - capella processParticipationFlagUpdates 1.3580 us/op 2.0430 us/op 0.66
mainnet_e217614 - capella afterProcessEpoch 198.89 ms/op 208.76 ms/op 0.95
phase0 processEpoch - mainnet_e58758 367.73 ms/op 325.79 ms/op 1.13
mainnet_e58758 - phase0 beforeProcessEpoch 76.843 ms/op 91.970 ms/op 0.84
mainnet_e58758 - phase0 processJustificationAndFinalization 11.503 us/op 22.940 us/op 0.50
mainnet_e58758 - phase0 processRewardsAndPenalties 38.168 ms/op 33.206 ms/op 1.15
mainnet_e58758 - phase0 processRegistryUpdates 6.5130 us/op 8.2160 us/op 0.79
mainnet_e58758 - phase0 processSlashings 799.00 ns/op 982.00 ns/op 0.81
mainnet_e58758 - phase0 processEth1DataReset 683.00 ns/op 749.00 ns/op 0.91
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.3741 ms/op 904.00 us/op 1.52
mainnet_e58758 - phase0 processSlashingsReset 2.1220 us/op 5.0950 us/op 0.42
mainnet_e58758 - phase0 processRandaoMixesReset 3.2830 us/op 6.9090 us/op 0.48
mainnet_e58758 - phase0 processHistoricalRootsUpdate 698.00 ns/op 1.0630 us/op 0.66
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.5820 us/op 6.3480 us/op 0.25
mainnet_e58758 - phase0 afterProcessEpoch 65.475 ms/op 75.695 ms/op 0.86
phase0 processEffectiveBalanceUpdates - 250000 normalcase 974.99 us/op 1.0299 ms/op 0.95
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.6784 ms/op 1.8412 ms/op 0.91
altair processInactivityUpdates - 250000 normalcase 16.334 ms/op 16.875 ms/op 0.97
altair processInactivityUpdates - 250000 worstcase 19.354 ms/op 17.897 ms/op 1.08
phase0 processRegistryUpdates - 250000 normalcase 3.3600 us/op 6.2260 us/op 0.54
phase0 processRegistryUpdates - 250000 badcase_full_deposits 338.19 us/op 204.89 us/op 1.65
phase0 processRegistryUpdates - 250000 worstcase 0.5 105.32 ms/op 124.66 ms/op 0.84
altair processRewardsAndPenalties - 250000 normalcase 46.664 ms/op 41.047 ms/op 1.14
altair processRewardsAndPenalties - 250000 worstcase 38.805 ms/op 40.325 ms/op 0.96
phase0 getAttestationDeltas - 250000 normalcase 5.6671 ms/op 7.8367 ms/op 0.72
phase0 getAttestationDeltas - 250000 worstcase 7.3720 ms/op 8.3045 ms/op 0.89
phase0 processSlashings - 250000 worstcase 81.853 us/op 96.218 us/op 0.85
altair processSyncCommitteeUpdates - 250000 96.448 ms/op 112.40 ms/op 0.86
BeaconState.hashTreeRoot - No change 486.00 ns/op 485.00 ns/op 1.00
BeaconState.hashTreeRoot - 1 full validator 145.35 us/op 102.89 us/op 1.41
BeaconState.hashTreeRoot - 32 full validator 1.5194 ms/op 1.2056 ms/op 1.26
BeaconState.hashTreeRoot - 512 full validator 15.638 ms/op 12.707 ms/op 1.23
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 138.96 us/op 163.61 us/op 0.85
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.7545 ms/op 1.9054 ms/op 0.92
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 23.375 ms/op 22.771 ms/op 1.03
BeaconState.hashTreeRoot - 1 balances 87.385 us/op 101.71 us/op 0.86
BeaconState.hashTreeRoot - 32 balances 904.65 us/op 1.0436 ms/op 0.87
BeaconState.hashTreeRoot - 512 balances 9.8633 ms/op 9.1315 ms/op 1.08
BeaconState.hashTreeRoot - 250000 balances 177.48 ms/op 154.59 ms/op 1.15
aggregationBits - 2048 els - zipIndexesInBitList 19.495 us/op 21.989 us/op 0.89
byteArrayEquals 32 46.918 ns/op 49.146 ns/op 0.95
Buffer.compare 32 15.661 ns/op 15.658 ns/op 1.00
byteArrayEquals 1024 1.2549 us/op 1.2916 us/op 0.97
Buffer.compare 1024 24.632 ns/op 23.384 ns/op 1.05
byteArrayEquals 16384 20.004 us/op 20.478 us/op 0.98
Buffer.compare 16384 181.84 ns/op 206.85 ns/op 0.88
byteArrayEquals 123687377 144.43 ms/op 153.71 ms/op 0.94
Buffer.compare 123687377 3.9174 ms/op 6.2576 ms/op 0.63
byteArrayEquals 32 - diff last byte 45.973 ns/op 47.822 ns/op 0.96
Buffer.compare 32 - diff last byte 15.183 ns/op 15.783 ns/op 0.96
byteArrayEquals 1024 - diff last byte 1.2106 us/op 1.2695 us/op 0.95
Buffer.compare 1024 - diff last byte 23.203 ns/op 23.918 ns/op 0.97
byteArrayEquals 16384 - diff last byte 19.254 us/op 20.394 us/op 0.94
Buffer.compare 16384 - diff last byte 169.35 ns/op 181.71 ns/op 0.93
byteArrayEquals 123687377 - diff last byte 145.33 ms/op 153.32 ms/op 0.95
Buffer.compare 123687377 - diff last byte 5.3459 ms/op 5.0693 ms/op 1.05
byteArrayEquals 32 - random bytes 4.7290 ns/op 5.0750 ns/op 0.93
Buffer.compare 32 - random bytes 15.073 ns/op 15.975 ns/op 0.94
byteArrayEquals 1024 - random bytes 4.7940 ns/op 5.0320 ns/op 0.95
Buffer.compare 1024 - random bytes 14.894 ns/op 15.847 ns/op 0.94
byteArrayEquals 16384 - random bytes 4.7700 ns/op 5.0220 ns/op 0.95
Buffer.compare 16384 - random bytes 14.870 ns/op 15.735 ns/op 0.95
byteArrayEquals 123687377 - random bytes 7.7100 ns/op 7.9400 ns/op 0.97
Buffer.compare 123687377 - random bytes 17.870 ns/op 18.810 ns/op 0.95
regular array get 100000 times 29.709 us/op 31.163 us/op 0.95
wrappedArray get 100000 times 29.706 us/op 31.342 us/op 0.95
arrayWithProxy get 100000 times 10.940 ms/op 10.485 ms/op 1.04
ssz.Root.equals 40.155 ns/op 44.735 ns/op 0.90
byteArrayEquals 39.590 ns/op 42.979 ns/op 0.92
Buffer.compare 9.1590 ns/op 9.1590 ns/op 1.00
shuffle list - 16384 els 5.4798 ms/op 5.5541 ms/op 0.99
shuffle list - 250000 els 80.231 ms/op 82.730 ms/op 0.97
processSlot - 1 slots 10.765 us/op 12.760 us/op 0.84
processSlot - 32 slots 2.6121 ms/op 3.5015 ms/op 0.75
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 42.241 ms/op 37.301 ms/op 1.13
getCommitteeAssignments - req 1 vs - 250000 vc 1.7795 ms/op 1.8823 ms/op 0.95
getCommitteeAssignments - req 100 vs - 250000 vc 3.4085 ms/op 3.6017 ms/op 0.95
getCommitteeAssignments - req 1000 vs - 250000 vc 3.6594 ms/op 3.9432 ms/op 0.93
findModifiedValidators - 10000 modified validators 227.72 ms/op 267.56 ms/op 0.85
findModifiedValidators - 1000 modified validators 143.01 ms/op 182.76 ms/op 0.78
findModifiedValidators - 100 modified validators 153.83 ms/op 201.29 ms/op 0.76
findModifiedValidators - 10 modified validators 133.04 ms/op 172.95 ms/op 0.77
findModifiedValidators - 1 modified validators 118.08 ms/op 190.95 ms/op 0.62
findModifiedValidators - no difference 143.60 ms/op 187.88 ms/op 0.76
compare ViewDUs 3.1688 s/op 3.2009 s/op 0.99
compare each validator Uint8Array 1.5711 s/op 1.4094 s/op 1.11
compare ViewDU to Uint8Array 701.26 ms/op 1.1720 s/op 0.60
migrate state 1000000 validators, 24 modified, 0 new 573.01 ms/op 713.04 ms/op 0.80
migrate state 1000000 validators, 1700 modified, 1000 new 834.01 ms/op 932.08 ms/op 0.89
migrate state 1000000 validators, 3400 modified, 2000 new 1.0395 s/op 1.0690 s/op 0.97
migrate state 1500000 validators, 24 modified, 0 new 540.13 ms/op 628.50 ms/op 0.86
migrate state 1500000 validators, 1700 modified, 1000 new 801.80 ms/op 832.72 ms/op 0.96
migrate state 1500000 validators, 3400 modified, 2000 new 1.0357 s/op 938.73 ms/op 1.10
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 6.4000 ns/op 6.4400 ns/op 0.99
state getBlockRootAtSlot - 250000 vs - 7PWei 1.0031 us/op 774.91 ns/op 1.29
computeProposers - vc 250000 6.7512 ms/op 6.9285 ms/op 0.97
computeEpochShuffling - vc 250000 81.224 ms/op 79.670 ms/op 1.02
getNextSyncCommittee - vc 250000 107.21 ms/op 105.94 ms/op 1.01
computeSigningRoot for AttestationData 22.985 us/op 20.197 us/op 1.14
hash AttestationData serialized data then Buffer.toString(base64) 1.1867 us/op 1.1852 us/op 1.00
toHexString serialized data 815.55 ns/op 759.79 ns/op 1.07
Buffer.toString(base64) 148.65 ns/op 145.27 ns/op 1.02
nodejs block root to RootHex using toHex 125.71 ns/op 109.66 ns/op 1.15
nodejs block root to RootHex using toRootHex 79.913 ns/op 71.774 ns/op 1.11
browser block root to RootHex using the deprecated toHexString 219.34 ns/op 204.17 ns/op 1.07
browser block root to RootHex using toHex 173.03 ns/op 161.10 ns/op 1.07
browser block root to RootHex using toRootHex 147.80 ns/op 148.93 ns/op 0.99

by benchmarkbot/action

@twoeths twoeths marked this pull request as ready for review September 2, 2024 04:20
@twoeths twoeths requested a review from a team as a code owner September 2, 2024 04:20
@philknows philknows added this to the v1.22.0 milestone Sep 3, 2024
@twoeths twoeths merged commit ef99ed7 into unstable Sep 4, 2024
20 of 21 checks passed
@twoeths twoeths deleted the te/to_pubkey_hex branch September 4, 2024 01:20
philknows pushed a commit that referenced this pull request Sep 11, 2024
* feat: add toPubkeyHex util

* feat: consume toPubkeyHex

* fix: use toPubkeyHex instead of toHex

* chore: remove redundant comments
@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.

3 participants