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

chore: update persistent-merkle-tree 0.6.1 #5969

Merged
merged 6 commits into from
Oct 13, 2023
Merged

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Sep 19, 2023

Motivation

Description

  • Use setHasher() at the beginning to enforce as-sha256 in lodestar

@github-actions
Copy link
Contributor

github-actions bot commented Sep 19, 2023

Performance Report

✔️ no performance regression detected

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: 9d975e3 Previous: 1aa6561 Ratio
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 10.975 us/op 33.810 us/op 0.32
Full benchmark results
Benchmark suite Current: 9d975e3 Previous: 1aa6561 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 527.36 us/op 714.36 us/op 0.74
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 95.600 us/op 88.192 us/op 1.08
BLS verify - blst-native 1.3504 ms/op 1.3477 ms/op 1.00
BLS verifyMultipleSignatures 3 - blst-native 2.8286 ms/op 2.8464 ms/op 0.99
BLS verifyMultipleSignatures 8 - blst-native 6.1375 ms/op 6.2056 ms/op 0.99
BLS verifyMultipleSignatures 32 - blst-native 22.510 ms/op 23.126 ms/op 0.97
BLS verifyMultipleSignatures 64 - blst-native 44.077 ms/op 45.174 ms/op 0.98
BLS verifyMultipleSignatures 128 - blst-native 89.925 ms/op 89.280 ms/op 1.01
BLS deserializing 10000 signatures 920.83 ms/op 913.10 ms/op 1.01
BLS deserializing 100000 signatures 9.7679 s/op 9.3535 s/op 1.04
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.5405 ms/op 1.3807 ms/op 1.12
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.8845 ms/op 1.5972 ms/op 1.18
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.6540 ms/op 2.7197 ms/op 0.98
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.8778 ms/op 4.5061 ms/op 0.86
BLS verifyMultipleSignatures - same message - 128 - blst-native 6.2383 ms/op 6.8206 ms/op 0.91
BLS aggregatePubkeys 32 - blst-native 29.980 us/op 27.031 us/op 1.11
BLS aggregatePubkeys 128 - blst-native 113.74 us/op 104.21 us/op 1.09
getAttestationsForBlock 58.709 ms/op 56.920 ms/op 1.03
isKnown best case - 1 super set check 581.00 ns/op 469.00 ns/op 1.24
isKnown normal case - 2 super set checks 643.00 ns/op 459.00 ns/op 1.40
isKnown worse case - 16 super set checks 622.00 ns/op 537.00 ns/op 1.16
CheckpointStateCache - add get delete 7.1690 us/op 6.3910 us/op 1.12
validate api signedAggregateAndProof - struct 3.7952 ms/op 3.0603 ms/op 1.24
validate gossip signedAggregateAndProof - struct 3.1439 ms/op 2.9941 ms/op 1.05
validate gossip attestation - vc 640000 1.4988 ms/op 1.5056 ms/op 1.00
batch validate gossip attestation - vc 640000 - chunk 32 192.08 us/op 179.83 us/op 1.07
batch validate gossip attestation - vc 640000 - chunk 64 158.18 us/op 175.27 us/op 0.90
batch validate gossip attestation - vc 640000 - chunk 128 149.69 us/op 176.23 us/op 0.85
batch validate gossip attestation - vc 640000 - chunk 256 146.94 us/op 153.22 us/op 0.96
pickEth1Vote - no votes 1.3521 ms/op 1.4832 ms/op 0.91
pickEth1Vote - max votes 14.743 ms/op 14.304 ms/op 1.03
pickEth1Vote - Eth1Data hashTreeRoot value x2048 21.661 ms/op 21.561 ms/op 1.00
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 32.320 ms/op 34.248 ms/op 0.94
pickEth1Vote - Eth1Data fastSerialize value x2048 784.13 us/op 656.42 us/op 1.19
pickEth1Vote - Eth1Data fastSerialize tree x2048 7.9779 ms/op 6.6833 ms/op 1.19
bytes32 toHexString 752.00 ns/op 707.00 ns/op 1.06
bytes32 Buffer.toString(hex) 352.00 ns/op 321.00 ns/op 1.10
bytes32 Buffer.toString(hex) from Uint8Array 563.00 ns/op 578.00 ns/op 0.97
bytes32 Buffer.toString(hex) + 0x 344.00 ns/op 349.00 ns/op 0.99
Object access 1 prop 0.21600 ns/op 0.20600 ns/op 1.05
Map access 1 prop 0.16900 ns/op 0.16600 ns/op 1.02
Object get x1000 7.6830 ns/op 8.8510 ns/op 0.87
Map get x1000 0.69800 ns/op 0.85800 ns/op 0.81
Object set x1000 68.415 ns/op 80.276 ns/op 0.85
Map set x1000 53.288 ns/op 57.346 ns/op 0.93
Return object 10000 times 0.26650 ns/op 0.34780 ns/op 0.77
Throw Error 10000 times 4.0775 us/op 4.7681 us/op 0.86
fastMsgIdFn sha256 / 200 bytes 3.4770 us/op 3.9220 us/op 0.89
fastMsgIdFn h32 xxhash / 200 bytes 336.00 ns/op 355.00 ns/op 0.95
fastMsgIdFn h64 xxhash / 200 bytes 408.00 ns/op 396.00 ns/op 1.03
fastMsgIdFn sha256 / 1000 bytes 12.225 us/op 12.690 us/op 0.96
fastMsgIdFn h32 xxhash / 1000 bytes 481.00 ns/op 497.00 ns/op 0.97
fastMsgIdFn h64 xxhash / 1000 bytes 473.00 ns/op 472.00 ns/op 1.00
fastMsgIdFn sha256 / 10000 bytes 108.47 us/op 114.88 us/op 0.94
fastMsgIdFn h32 xxhash / 10000 bytes 2.0470 us/op 2.0720 us/op 0.99
fastMsgIdFn h64 xxhash / 10000 bytes 1.4010 us/op 1.4680 us/op 0.95
send data - 1000 256B messages 21.096 ms/op 24.115 ms/op 0.87
send data - 1000 512B messages 28.543 ms/op 34.112 ms/op 0.84
send data - 1000 1024B messages 43.553 ms/op 45.501 ms/op 0.96
send data - 1000 1200B messages 36.383 ms/op 34.828 ms/op 1.04
send data - 1000 2048B messages 45.628 ms/op 41.150 ms/op 1.11
send data - 1000 4096B messages 38.110 ms/op 34.417 ms/op 1.11
send data - 1000 16384B messages 103.00 ms/op 95.662 ms/op 1.08
send data - 1000 65536B messages 466.11 ms/op 500.19 ms/op 0.93
enrSubnets - fastDeserialize 64 bits 1.8600 us/op 1.7210 us/op 1.08
enrSubnets - ssz BitVector 64 bits 554.00 ns/op 568.00 ns/op 0.98
enrSubnets - fastDeserialize 4 bits 240.00 ns/op 239.00 ns/op 1.00
enrSubnets - ssz BitVector 4 bits 1.0530 us/op 584.00 ns/op 1.80
prioritizePeers score -10:0 att 32-0.1 sync 2-0 179.40 us/op 128.25 us/op 1.40
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 253.90 us/op 183.02 us/op 1.39
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 315.56 us/op 253.99 us/op 1.24
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 587.11 us/op 401.58 us/op 1.46
prioritizePeers score 0:0 att 64-1 sync 4-1 633.01 us/op 454.68 us/op 1.39
array of 16000 items push then shift 2.8387 us/op 1.7843 us/op 1.59
LinkedList of 16000 items push then shift 18.892 ns/op 12.945 ns/op 1.46
array of 16000 items push then pop 140.59 ns/op 121.21 ns/op 1.16
LinkedList of 16000 items push then pop 13.409 ns/op 10.290 ns/op 1.30
array of 24000 items push then shift 4.2594 us/op 2.7081 us/op 1.57
LinkedList of 24000 items push then shift 14.118 ns/op 11.959 ns/op 1.18
array of 24000 items push then pop 175.16 ns/op 171.17 ns/op 1.02
LinkedList of 24000 items push then pop 12.808 ns/op 10.182 ns/op 1.26
intersect bitArray bitLen 8 9.0700 ns/op 7.1830 ns/op 1.26
intersect array and set length 8 91.975 ns/op 65.670 ns/op 1.40
intersect bitArray bitLen 128 47.988 ns/op 34.785 ns/op 1.38
intersect array and set length 128 1.1591 us/op 938.38 ns/op 1.24
bitArray.getTrueBitIndexes() bitLen 128 2.5730 us/op 1.8060 us/op 1.42
bitArray.getTrueBitIndexes() bitLen 248 3.6050 us/op 3.0090 us/op 1.20
bitArray.getTrueBitIndexes() bitLen 512 7.0140 us/op 6.6920 us/op 1.05
Buffer.concat 32 items 1.2710 us/op 1.1040 us/op 1.15
Uint8Array.set 32 items 2.4860 us/op 2.1800 us/op 1.14
Set add up to 64 items then delete first 5.0909 us/op 4.9253 us/op 1.03
OrderedSet add up to 64 items then delete first 6.8337 us/op 6.3959 us/op 1.07
Set add up to 64 items then delete last 5.6572 us/op 5.6163 us/op 1.01
OrderedSet add up to 64 items then delete last 7.4719 us/op 7.5228 us/op 0.99
Set add up to 64 items then delete middle 7.1461 us/op 5.3409 us/op 1.34
OrderedSet add up to 64 items then delete middle 9.4199 us/op 8.3779 us/op 1.12
Set add up to 128 items then delete first 12.133 us/op 10.697 us/op 1.13
OrderedSet add up to 128 items then delete first 15.763 us/op 14.302 us/op 1.10
Set add up to 128 items then delete last 11.245 us/op 10.375 us/op 1.08
OrderedSet add up to 128 items then delete last 16.556 us/op 13.961 us/op 1.19
Set add up to 128 items then delete middle 11.236 us/op 10.701 us/op 1.05
OrderedSet add up to 128 items then delete middle 21.817 us/op 19.100 us/op 1.14
Set add up to 256 items then delete first 25.732 us/op 20.721 us/op 1.24
OrderedSet add up to 256 items then delete first 35.866 us/op 29.602 us/op 1.21
Set add up to 256 items then delete last 24.046 us/op 21.718 us/op 1.11
OrderedSet add up to 256 items then delete last 34.882 us/op 28.646 us/op 1.22
Set add up to 256 items then delete middle 24.946 us/op 21.535 us/op 1.16
OrderedSet add up to 256 items then delete middle 65.899 us/op 55.187 us/op 1.19
transfer serialized Status (84 B) 3.8490 us/op 2.5480 us/op 1.51
copy serialized Status (84 B) 3.7940 us/op 2.1990 us/op 1.73
transfer serialized SignedVoluntaryExit (112 B) 4.3130 us/op 2.3210 us/op 1.86
copy serialized SignedVoluntaryExit (112 B) 2.6800 us/op 1.9930 us/op 1.34
transfer serialized ProposerSlashing (416 B) 4.4950 us/op 2.8900 us/op 1.56
copy serialized ProposerSlashing (416 B) 4.0210 us/op 2.9990 us/op 1.34
transfer serialized Attestation (485 B) 3.4220 us/op 2.9710 us/op 1.15
copy serialized Attestation (485 B) 3.7910 us/op 2.9590 us/op 1.28
transfer serialized AttesterSlashing (33232 B) 3.3620 us/op 2.8090 us/op 1.20
copy serialized AttesterSlashing (33232 B) 11.105 us/op 11.071 us/op 1.00
transfer serialized Small SignedBeaconBlock (128000 B) 3.7990 us/op 4.0300 us/op 0.94
copy serialized Small SignedBeaconBlock (128000 B) 36.988 us/op 43.183 us/op 0.86
transfer serialized Avg SignedBeaconBlock (200000 B) 6.0340 us/op 4.8940 us/op 1.23
copy serialized Avg SignedBeaconBlock (200000 B) 46.830 us/op 50.015 us/op 0.94
transfer serialized BlobsSidecar (524380 B) 4.6560 us/op 6.4640 us/op 0.72
copy serialized BlobsSidecar (524380 B) 338.00 us/op 196.66 us/op 1.72
transfer serialized Big SignedBeaconBlock (1000000 B) 4.1150 us/op 9.3580 us/op 0.44
copy serialized Big SignedBeaconBlock (1000000 B) 214.77 us/op 336.19 us/op 0.64
pass gossip attestations to forkchoice per slot 4.1764 ms/op 5.4530 ms/op 0.77
forkChoice updateHead vc 100000 bc 64 eq 0 716.50 us/op 710.91 us/op 1.01
forkChoice updateHead vc 600000 bc 64 eq 0 7.5855 ms/op 8.1950 ms/op 0.93
forkChoice updateHead vc 1000000 bc 64 eq 0 8.5895 ms/op 9.2631 ms/op 0.93
forkChoice updateHead vc 600000 bc 320 eq 0 4.7099 ms/op 5.0442 ms/op 0.93
forkChoice updateHead vc 600000 bc 1200 eq 0 4.7577 ms/op 5.7430 ms/op 0.83
forkChoice updateHead vc 600000 bc 7200 eq 0 6.2432 ms/op 6.7940 ms/op 0.92
forkChoice updateHead vc 600000 bc 64 eq 1000 12.295 ms/op 13.998 ms/op 0.88
forkChoice updateHead vc 600000 bc 64 eq 10000 13.082 ms/op 15.769 ms/op 0.83
forkChoice updateHead vc 600000 bc 64 eq 300000 22.060 ms/op 63.321 ms/op 0.35
computeDeltas 500000 validators 300 proto nodes 6.7392 ms/op 7.7764 ms/op 0.87
computeDeltas 500000 validators 1200 proto nodes 6.6619 ms/op 7.4626 ms/op 0.89
computeDeltas 500000 validators 7200 proto nodes 6.5050 ms/op 7.0544 ms/op 0.92
computeDeltas 750000 validators 300 proto nodes 9.8972 ms/op 10.417 ms/op 0.95
computeDeltas 750000 validators 1200 proto nodes 9.4530 ms/op 10.575 ms/op 0.89
computeDeltas 750000 validators 7200 proto nodes 9.5200 ms/op 10.382 ms/op 0.92
computeDeltas 1400000 validators 300 proto nodes 17.733 ms/op 19.317 ms/op 0.92
computeDeltas 1400000 validators 1200 proto nodes 17.352 ms/op 19.463 ms/op 0.89
computeDeltas 1400000 validators 7200 proto nodes 17.460 ms/op 19.085 ms/op 0.91
computeDeltas 2100000 validators 300 proto nodes 25.865 ms/op 28.160 ms/op 0.92
computeDeltas 2100000 validators 1200 proto nodes 25.843 ms/op 28.340 ms/op 0.91
computeDeltas 2100000 validators 7200 proto nodes 25.909 ms/op 32.182 ms/op 0.81
computeProposerBoostScoreFromBalances 500000 validators 3.1899 ms/op 4.2463 ms/op 0.75
computeProposerBoostScoreFromBalances 750000 validators 3.2040 ms/op 4.0646 ms/op 0.79
computeProposerBoostScoreFromBalances 1400000 validators 3.4014 ms/op 4.0478 ms/op 0.84
computeProposerBoostScoreFromBalances 2100000 validators 3.4857 ms/op 4.1755 ms/op 0.83
altair processAttestation - 250000 vs - 7PWei normalcase 5.3375 ms/op 4.4791 ms/op 1.19
altair processAttestation - 250000 vs - 7PWei worstcase 7.0798 ms/op 5.8387 ms/op 1.21
altair processAttestation - setStatus - 1/6 committees join 218.88 us/op 280.88 us/op 0.78
altair processAttestation - setStatus - 1/3 committees join 390.22 us/op 471.42 us/op 0.83
altair processAttestation - setStatus - 1/2 committees join 577.94 us/op 627.59 us/op 0.92
altair processAttestation - setStatus - 2/3 committees join 573.82 us/op 729.25 us/op 0.79
altair processAttestation - setStatus - 4/5 committees join 916.55 us/op 1.0848 ms/op 0.84
altair processAttestation - setStatus - 100% committees join 830.60 us/op 1.3829 ms/op 0.60
altair processBlock - 250000 vs - 7PWei normalcase 9.1933 ms/op 13.623 ms/op 0.67
altair processBlock - 250000 vs - 7PWei normalcase hashState 36.276 ms/op 45.015 ms/op 0.81
altair processBlock - 250000 vs - 7PWei worstcase 40.472 ms/op 53.893 ms/op 0.75
altair processBlock - 250000 vs - 7PWei worstcase hashState 88.470 ms/op 143.26 ms/op 0.62
phase0 processBlock - 250000 vs - 7PWei normalcase 2.8110 ms/op 5.5778 ms/op 0.50
phase0 processBlock - 250000 vs - 7PWei worstcase 28.976 ms/op 43.929 ms/op 0.66
altair processEth1Data - 250000 vs - 7PWei normalcase 470.77 us/op 784.86 us/op 0.60
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 10.872 us/op 30.016 us/op 0.36
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 57.196 us/op 118.90 us/op 0.48
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 16.240 us/op 32.712 us/op 0.50
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 10.975 us/op 33.810 us/op 0.32
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 116.15 us/op 264.34 us/op 0.44
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.2943 ms/op 2.3591 ms/op 0.55
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.8224 ms/op 2.6897 ms/op 0.68
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.4470 ms/op 2.6884 ms/op 0.54
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.1766 ms/op 7.0213 ms/op 0.45
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.4756 ms/op 3.5215 ms/op 0.70
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.8476 ms/op 8.2806 ms/op 0.59
Tree 40 250000 create 298.45 ms/op 571.47 ms/op 0.52
Tree 40 250000 get(125000) 190.19 ns/op 253.12 ns/op 0.75
Tree 40 250000 set(125000) 827.78 ns/op 2.6365 us/op 0.31
Tree 40 250000 toArray() 17.906 ms/op 39.932 ms/op 0.45
Tree 40 250000 iterate all - toArray() + loop 18.688 ms/op 36.043 ms/op 0.52
Tree 40 250000 iterate all - get(i) 65.092 ms/op 93.942 ms/op 0.69
MutableVector 250000 create 11.290 ms/op 18.903 ms/op 0.60
MutableVector 250000 get(125000) 6.4950 ns/op 8.3910 ns/op 0.77
MutableVector 250000 set(125000) 243.50 ns/op 674.67 ns/op 0.36
MutableVector 250000 toArray() 2.9036 ms/op 5.6759 ms/op 0.51
MutableVector 250000 iterate all - toArray() + loop 3.0199 ms/op 5.3933 ms/op 0.56
MutableVector 250000 iterate all - get(i) 1.4918 ms/op 1.7909 ms/op 0.83
Array 250000 create 2.7261 ms/op 5.8248 ms/op 0.47
Array 250000 clone - spread 1.2165 ms/op 1.4296 ms/op 0.85
Array 250000 get(125000) 0.58100 ns/op 0.83400 ns/op 0.70
Array 250000 set(125000) 0.65100 ns/op 1.2470 ns/op 0.52
Array 250000 iterate all - loop 80.162 us/op 89.878 us/op 0.89
effectiveBalanceIncrements clone Uint8Array 300000 26.432 us/op 91.443 us/op 0.29
effectiveBalanceIncrements clone MutableVector 300000 369.00 ns/op 349.00 ns/op 1.06
effectiveBalanceIncrements rw all Uint8Array 300000 173.26 us/op 202.06 us/op 0.86
effectiveBalanceIncrements rw all MutableVector 300000 80.149 ms/op 185.35 ms/op 0.43
phase0 afterProcessEpoch - 250000 vs - 7PWei 107.82 ms/op 126.82 ms/op 0.85
phase0 beforeProcessEpoch - 250000 vs - 7PWei 35.543 ms/op 69.973 ms/op 0.51
altair processEpoch - mainnet_e81889 432.89 ms/op 536.05 ms/op 0.81
mainnet_e81889 - altair beforeProcessEpoch 61.762 ms/op 81.447 ms/op 0.76
mainnet_e81889 - altair processJustificationAndFinalization 16.717 us/op 30.166 us/op 0.55
mainnet_e81889 - altair processInactivityUpdates 5.1805 ms/op 10.650 ms/op 0.49
mainnet_e81889 - altair processRewardsAndPenalties 46.084 ms/op 88.119 ms/op 0.52
mainnet_e81889 - altair processRegistryUpdates 2.4660 us/op 5.2090 us/op 0.47
mainnet_e81889 - altair processSlashings 456.00 ns/op 1.3710 us/op 0.33
mainnet_e81889 - altair processEth1DataReset 539.00 ns/op 1.1870 us/op 0.45
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2573 ms/op 1.3170 ms/op 0.95
mainnet_e81889 - altair processSlashingsReset 2.5610 us/op 5.1340 us/op 0.50
mainnet_e81889 - altair processRandaoMixesReset 6.0710 us/op 8.7760 us/op 0.69
mainnet_e81889 - altair processHistoricalRootsUpdate 670.00 ns/op 710.00 ns/op 0.94
mainnet_e81889 - altair processParticipationFlagUpdates 1.8810 us/op 3.6310 us/op 0.52
mainnet_e81889 - altair processSyncCommitteeUpdates 661.00 ns/op 876.00 ns/op 0.75
mainnet_e81889 - altair afterProcessEpoch 122.85 ms/op 131.16 ms/op 0.94
capella processEpoch - mainnet_e217614 1.4351 s/op 1.8423 s/op 0.78
mainnet_e217614 - capella beforeProcessEpoch 242.48 ms/op 314.52 ms/op 0.77
mainnet_e217614 - capella processJustificationAndFinalization 12.695 us/op 25.122 us/op 0.51
mainnet_e217614 - capella processInactivityUpdates 16.683 ms/op 25.520 ms/op 0.65
mainnet_e217614 - capella processRewardsAndPenalties 288.70 ms/op 335.12 ms/op 0.86
mainnet_e217614 - capella processRegistryUpdates 20.520 us/op 34.203 us/op 0.60
mainnet_e217614 - capella processSlashings 546.00 ns/op 1.4200 us/op 0.38
mainnet_e217614 - capella processEth1DataReset 450.00 ns/op 1.5190 us/op 0.30
mainnet_e217614 - capella processEffectiveBalanceUpdates 3.9446 ms/op 8.0649 ms/op 0.49
mainnet_e217614 - capella processSlashingsReset 2.2710 us/op 7.6600 us/op 0.30
mainnet_e217614 - capella processRandaoMixesReset 3.8000 us/op 9.9600 us/op 0.38
mainnet_e217614 - capella processHistoricalRootsUpdate 548.00 ns/op 1.0310 us/op 0.53
mainnet_e217614 - capella processParticipationFlagUpdates 1.8590 us/op 4.5300 us/op 0.41
mainnet_e217614 - capella afterProcessEpoch 308.08 ms/op 327.21 ms/op 0.94
phase0 processEpoch - mainnet_e58758 385.67 ms/op 546.03 ms/op 0.71
mainnet_e58758 - phase0 beforeProcessEpoch 103.50 ms/op 186.78 ms/op 0.55
mainnet_e58758 - phase0 processJustificationAndFinalization 14.132 us/op 25.948 us/op 0.54
mainnet_e58758 - phase0 processRewardsAndPenalties 56.370 ms/op 61.931 ms/op 0.91
mainnet_e58758 - phase0 processRegistryUpdates 11.208 us/op 18.204 us/op 0.62
mainnet_e58758 - phase0 processSlashings 517.00 ns/op 1.1160 us/op 0.46
mainnet_e58758 - phase0 processEth1DataReset 457.00 ns/op 1.2460 us/op 0.37
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.0130 ms/op 3.8441 ms/op 0.26
mainnet_e58758 - phase0 processSlashingsReset 2.0950 us/op 4.1600 us/op 0.50
mainnet_e58758 - phase0 processRandaoMixesReset 3.6300 us/op 7.1030 us/op 0.51
mainnet_e58758 - phase0 processHistoricalRootsUpdate 498.00 ns/op 1.5110 us/op 0.33
mainnet_e58758 - phase0 processParticipationRecordUpdates 6.2650 us/op 14.612 us/op 0.43
mainnet_e58758 - phase0 afterProcessEpoch 107.63 ms/op 117.37 ms/op 0.92
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.3325 ms/op 2.5391 ms/op 0.52
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4442 ms/op 1.5595 ms/op 0.93
altair processInactivityUpdates - 250000 normalcase 17.825 ms/op 32.271 ms/op 0.55
altair processInactivityUpdates - 250000 worstcase 19.369 ms/op 30.210 ms/op 0.64
phase0 processRegistryUpdates - 250000 normalcase 9.5290 us/op 15.405 us/op 0.62
phase0 processRegistryUpdates - 250000 badcase_full_deposits 375.11 us/op 405.34 us/op 0.93
phase0 processRegistryUpdates - 250000 worstcase 0.5 129.51 ms/op 158.14 ms/op 0.82
altair processRewardsAndPenalties - 250000 normalcase 46.316 ms/op 72.373 ms/op 0.64
altair processRewardsAndPenalties - 250000 worstcase 46.157 ms/op 76.935 ms/op 0.60
phase0 getAttestationDeltas - 250000 normalcase 7.9014 ms/op 11.734 ms/op 0.67
phase0 getAttestationDeltas - 250000 worstcase 8.2389 ms/op 13.231 ms/op 0.62
phase0 processSlashings - 250000 worstcase 2.3730 ms/op 3.3191 ms/op 0.71
altair processSyncCommitteeUpdates - 250000 152.94 ms/op 173.69 ms/op 0.88
BeaconState.hashTreeRoot - No change 263.00 ns/op 448.00 ns/op 0.59
BeaconState.hashTreeRoot - 1 full validator 115.98 us/op 180.95 us/op 0.64
BeaconState.hashTreeRoot - 32 full validator 1.1298 ms/op 2.1819 ms/op 0.52
BeaconState.hashTreeRoot - 512 full validator 15.763 ms/op 22.483 ms/op 0.70
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 181.69 us/op 189.96 us/op 0.96
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.0338 ms/op 2.6305 ms/op 0.77
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 24.615 ms/op 36.150 ms/op 0.68
BeaconState.hashTreeRoot - 1 balances 118.22 us/op 145.15 us/op 0.81
BeaconState.hashTreeRoot - 32 balances 1.0985 ms/op 1.3299 ms/op 0.83
BeaconState.hashTreeRoot - 512 balances 8.9821 ms/op 14.497 ms/op 0.62
BeaconState.hashTreeRoot - 250000 balances 171.43 ms/op 246.58 ms/op 0.70
aggregationBits - 2048 els - zipIndexesInBitList 15.660 us/op 22.680 us/op 0.69
regular array get 100000 times 33.924 us/op 46.653 us/op 0.73
wrappedArray get 100000 times 33.653 us/op 34.334 us/op 0.98
arrayWithProxy get 100000 times 14.407 ms/op 15.777 ms/op 0.91
ssz.Root.equals 215.00 ns/op 276.00 ns/op 0.78
byteArrayEquals 213.00 ns/op 250.00 ns/op 0.85
shuffle list - 16384 els 6.9233 ms/op 7.3162 ms/op 0.95
shuffle list - 250000 els 102.11 ms/op 104.38 ms/op 0.98
processSlot - 1 slots 16.877 us/op 17.462 us/op 0.97
processSlot - 32 slots 2.7279 ms/op 4.1741 ms/op 0.65
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 48.435 ms/op 59.783 ms/op 0.81
getCommitteeAssignments - req 1 vs - 250000 vc 2.5783 ms/op 2.6488 ms/op 0.97
getCommitteeAssignments - req 100 vs - 250000 vc 3.8609 ms/op 4.1590 ms/op 0.93
getCommitteeAssignments - req 1000 vs - 250000 vc 4.1704 ms/op 4.6536 ms/op 0.90
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.2300 ns/op 6.2500 ns/op 0.84
state getBlockRootAtSlot - 250000 vs - 7PWei 851.63 ns/op 684.02 ns/op 1.25
computeProposers - vc 250000 10.050 ms/op 9.9774 ms/op 1.01
computeEpochShuffling - vc 250000 106.36 ms/op 108.94 ms/op 0.98
getNextSyncCommittee - vc 250000 158.87 ms/op 172.79 ms/op 0.92
computeSigningRoot for AttestationData 28.576 us/op 30.558 us/op 0.94
hash AttestationData serialized data then Buffer.toString(base64) 2.3700 us/op 2.4419 us/op 0.97
toHexString serialized data 1.1245 us/op 1.4676 us/op 0.77
Buffer.toString(base64) 218.34 ns/op 307.97 ns/op 0.71

by benchmarkbot/action

@wemeetagain wemeetagain marked this pull request as ready for review October 2, 2023 15:09
@wemeetagain wemeetagain requested a review from a team as a code owner October 2, 2023 15:09
@philknows philknows added this to the v1.12.0 milestone Oct 3, 2023
@twoeths
Copy link
Contributor Author

twoeths commented Oct 11, 2023

Screenshot 2023-10-11 at 17 48 15

I deployed to feat1 mainnet node, it does not work as expected (stable mainnet node takes < 58ms consistently). Could that be an issue of setHasher() itself @wemeetagain ?

@twoeths
Copy link
Contributor Author

twoeths commented Oct 12, 2023

within lodestar, I think there are 2 persistent-merkle-tree:

find node_modules/ -type d -name "persistent-merkle-tree"
node_modules/@chainsafe/persistent-merkle-tree
node_modules/@chainsafe/ssz/node_modules/@chainsafe/persistent-merkle-tree

we may need to set our hasher for both of them

@twoeths
Copy link
Contributor Author

twoeths commented Oct 12, 2023

this is due to node_modules/@chainsafe/ssz/node_modules/@chainsafe/persistent-merkle-tree being cached in the deployment. This branch works fine after removing node_modules

Screenshot 2023-10-12 at 16 58 37

wemeetagain
wemeetagain previously approved these changes Oct 12, 2023
@wemeetagain wemeetagain enabled auto-merge (squash) October 12, 2023 19:15
@wemeetagain wemeetagain merged commit c6291ad into unstable Oct 13, 2023
15 checks passed
@wemeetagain wemeetagain deleted the tuyen/set_hasher branch October 13, 2023 02:28
import {setHasher} from "@chainsafe/persistent-merkle-tree/lib/hasher/index.js";

// without setting this first, persistent-merkle-tree will use noble instead
setHasher(hasher);
Copy link
Member

Choose a reason for hiding this comment

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

Does it make sense to set as-sha256 as default in the library? Consumers still have the option to use noble but it is then their responsibility and we don't have to make sure it is set correctly in Lodestar.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's decided to use noble as default implementation, see ChainSafe/ssz#313

@wemeetagain
Copy link
Member

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

None yet

4 participants