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: track epoch transition steps time in metrics #6143

Merged
merged 7 commits into from
Dec 12, 2023

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Nov 30, 2023

Motivation

We have unstable epoch transitions and we have no idea which steps take the most time

Screenshot 2023-11-30 at 11 42 29

Description

  • Track every step of epoch transition in metrics

part of #6112
part of #6063
part of #5409

Copy link
Contributor

github-actions bot commented Nov 30, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: e37bfda Previous: 959a8af Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 668.54 us/op 911.68 us/op 0.73
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 90.565 us/op 143.52 us/op 0.63
BLS verify - blst-native 1.3568 ms/op 1.4383 ms/op 0.94
BLS verifyMultipleSignatures 3 - blst-native 3.0462 ms/op 2.9960 ms/op 1.02
BLS verifyMultipleSignatures 8 - blst-native 6.2473 ms/op 6.9110 ms/op 0.90
BLS verifyMultipleSignatures 32 - blst-native 22.369 ms/op 25.059 ms/op 0.89
BLS verifyMultipleSignatures 64 - blst-native 43.842 ms/op 46.851 ms/op 0.94
BLS verifyMultipleSignatures 128 - blst-native 86.376 ms/op 96.479 ms/op 0.90
BLS deserializing 10000 signatures 900.11 ms/op 974.85 ms/op 0.92
BLS deserializing 100000 signatures 9.4650 s/op 9.4597 s/op 1.00
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.3908 ms/op 1.4177 ms/op 0.98
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.5431 ms/op 1.6431 ms/op 0.94
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.4389 ms/op 2.4896 ms/op 0.98
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.5562 ms/op 3.8370 ms/op 0.93
BLS verifyMultipleSignatures - same message - 128 - blst-native 5.6539 ms/op 6.5170 ms/op 0.87
BLS aggregatePubkeys 32 - blst-native 27.029 us/op 29.000 us/op 0.93
BLS aggregatePubkeys 128 - blst-native 101.42 us/op 105.46 us/op 0.96
getAttestationsForBlock 53.819 ms/op 70.130 ms/op 0.77
getSlashingsAndExits - default max 195.24 us/op 443.58 us/op 0.44
getSlashingsAndExits - 2k 406.34 us/op 686.14 us/op 0.59
proposeBlockBody type=full, size=empty 6.0913 ms/op 7.0502 ms/op 0.86
isKnown best case - 1 super set check 345.00 ns/op 708.00 ns/op 0.49
isKnown normal case - 2 super set checks 422.00 ns/op 769.00 ns/op 0.55
isKnown worse case - 16 super set checks 392.00 ns/op 768.00 ns/op 0.51
CheckpointStateCache - add get delete 5.2010 us/op 6.9440 us/op 0.75
validate api signedAggregateAndProof - struct 2.7919 ms/op 3.2607 ms/op 0.86
validate gossip signedAggregateAndProof - struct 2.7821 ms/op 3.1945 ms/op 0.87
validate gossip attestation - vc 640000 1.3880 ms/op 1.4856 ms/op 0.93
batch validate gossip attestation - vc 640000 - chunk 32 170.87 us/op 190.39 us/op 0.90
batch validate gossip attestation - vc 640000 - chunk 64 154.31 us/op 169.64 us/op 0.91
batch validate gossip attestation - vc 640000 - chunk 128 158.78 us/op 167.40 us/op 0.95
batch validate gossip attestation - vc 640000 - chunk 256 152.34 us/op 148.47 us/op 1.03
pickEth1Vote - no votes 1.6667 ms/op 1.4465 ms/op 1.15
pickEth1Vote - max votes 9.8095 ms/op 13.807 ms/op 0.71
pickEth1Vote - Eth1Data hashTreeRoot value x2048 21.108 ms/op 22.297 ms/op 0.95
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 32.637 ms/op 32.967 ms/op 0.99
pickEth1Vote - Eth1Data fastSerialize value x2048 842.49 us/op 784.87 us/op 1.07
pickEth1Vote - Eth1Data fastSerialize tree x2048 5.6220 ms/op 6.1774 ms/op 0.91
bytes32 toHexString 770.00 ns/op 882.00 ns/op 0.87
bytes32 Buffer.toString(hex) 359.00 ns/op 311.00 ns/op 1.15
bytes32 Buffer.toString(hex) from Uint8Array 684.00 ns/op 615.00 ns/op 1.11
bytes32 Buffer.toString(hex) + 0x 352.00 ns/op 315.00 ns/op 1.12
Object access 1 prop 0.24200 ns/op 0.25800 ns/op 0.94
Map access 1 prop 0.15900 ns/op 0.16400 ns/op 0.97
Object get x1000 9.7680 ns/op 10.074 ns/op 0.97
Map get x1000 1.0190 ns/op 1.0590 ns/op 0.96
Object set x1000 85.465 ns/op 80.456 ns/op 1.06
Map set x1000 57.677 ns/op 60.552 ns/op 0.95
Return object 10000 times 0.27780 ns/op 0.28160 ns/op 0.99
Throw Error 10000 times 4.4763 us/op 4.2248 us/op 1.06
fastMsgIdFn sha256 / 200 bytes 3.8070 us/op 3.5570 us/op 1.07
fastMsgIdFn h32 xxhash / 200 bytes 402.00 ns/op 375.00 ns/op 1.07
fastMsgIdFn h64 xxhash / 200 bytes 448.00 ns/op 408.00 ns/op 1.10
fastMsgIdFn sha256 / 1000 bytes 12.655 us/op 12.030 us/op 1.05
fastMsgIdFn h32 xxhash / 1000 bytes 544.00 ns/op 520.00 ns/op 1.05
fastMsgIdFn h64 xxhash / 1000 bytes 520.00 ns/op 526.00 ns/op 0.99
fastMsgIdFn sha256 / 10000 bytes 112.09 us/op 113.42 us/op 0.99
fastMsgIdFn h32 xxhash / 10000 bytes 2.1300 us/op 2.3660 us/op 0.90
fastMsgIdFn h64 xxhash / 10000 bytes 1.5140 us/op 1.6670 us/op 0.91
send data - 1000 256B messages 22.812 ms/op 26.837 ms/op 0.85
send data - 1000 512B messages 31.127 ms/op 30.437 ms/op 1.02
send data - 1000 1024B messages 46.848 ms/op 46.990 ms/op 1.00
send data - 1000 1200B messages 44.645 ms/op 57.095 ms/op 0.78
send data - 1000 2048B messages 50.924 ms/op 60.554 ms/op 0.84
send data - 1000 4096B messages 50.112 ms/op 51.938 ms/op 0.96
send data - 1000 16384B messages 127.69 ms/op 120.91 ms/op 1.06
send data - 1000 65536B messages 421.19 ms/op 491.40 ms/op 0.86
enrSubnets - fastDeserialize 64 bits 1.6420 us/op 1.4350 us/op 1.14
enrSubnets - ssz BitVector 64 bits 564.00 ns/op 483.00 ns/op 1.17
enrSubnets - fastDeserialize 4 bits 268.00 ns/op 209.00 ns/op 1.28
enrSubnets - ssz BitVector 4 bits 596.00 ns/op 592.00 ns/op 1.01
prioritizePeers score -10:0 att 32-0.1 sync 2-0 135.39 us/op 112.96 us/op 1.20
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 150.21 us/op 145.84 us/op 1.03
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 193.31 us/op 196.42 us/op 0.98
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 350.53 us/op 333.78 us/op 1.05
prioritizePeers score 0:0 att 64-1 sync 4-1 368.46 us/op 356.96 us/op 1.03
array of 16000 items push then shift 1.6979 us/op 1.7004 us/op 1.00
LinkedList of 16000 items push then shift 9.4700 ns/op 9.1810 ns/op 1.03
array of 16000 items push then pop 102.19 ns/op 105.65 ns/op 0.97
LinkedList of 16000 items push then pop 9.1570 ns/op 9.8020 ns/op 0.93
array of 24000 items push then shift 2.6140 us/op 2.5838 us/op 1.01
LinkedList of 24000 items push then shift 9.3840 ns/op 9.4740 ns/op 0.99
array of 24000 items push then pop 144.08 ns/op 145.46 ns/op 0.99
LinkedList of 24000 items push then pop 9.8880 ns/op 9.1240 ns/op 1.08
intersect bitArray bitLen 8 6.8240 ns/op 6.7060 ns/op 1.02
intersect array and set length 8 81.604 ns/op 70.184 ns/op 1.16
intersect bitArray bitLen 128 36.916 ns/op 35.055 ns/op 1.05
intersect array and set length 128 1.0119 us/op 989.22 ns/op 1.02
bitArray.getTrueBitIndexes() bitLen 128 1.6420 us/op 1.6370 us/op 1.00
bitArray.getTrueBitIndexes() bitLen 248 2.8610 us/op 2.6430 us/op 1.08
bitArray.getTrueBitIndexes() bitLen 512 6.0510 us/op 5.9570 us/op 1.02
Buffer.concat 32 items 1.0750 us/op 1.2460 us/op 0.86
Uint8Array.set 32 items 1.9700 us/op 2.1320 us/op 0.92
Set add up to 64 items then delete first 5.1082 us/op 5.0827 us/op 1.01
OrderedSet add up to 64 items then delete first 6.6289 us/op 5.9899 us/op 1.11
Set add up to 64 items then delete last 5.0368 us/op 5.0841 us/op 0.99
OrderedSet add up to 64 items then delete last 6.5395 us/op 6.0187 us/op 1.09
Set add up to 64 items then delete middle 5.0946 us/op 4.8251 us/op 1.06
OrderedSet add up to 64 items then delete middle 7.8154 us/op 7.1754 us/op 1.09
Set add up to 128 items then delete first 11.244 us/op 9.4938 us/op 1.18
OrderedSet add up to 128 items then delete first 14.938 us/op 12.918 us/op 1.16
Set add up to 128 items then delete last 9.9523 us/op 9.4159 us/op 1.06
OrderedSet add up to 128 items then delete last 13.628 us/op 11.833 us/op 1.15
Set add up to 128 items then delete middle 10.330 us/op 10.407 us/op 0.99
OrderedSet add up to 128 items then delete middle 19.742 us/op 20.301 us/op 0.97
Set add up to 256 items then delete first 21.699 us/op 21.594 us/op 1.00
OrderedSet add up to 256 items then delete first 28.818 us/op 30.389 us/op 0.95
Set add up to 256 items then delete last 21.568 us/op 22.062 us/op 0.98
OrderedSet add up to 256 items then delete last 28.684 us/op 29.063 us/op 0.99
Set add up to 256 items then delete middle 20.750 us/op 20.098 us/op 1.03
OrderedSet add up to 256 items then delete middle 50.719 us/op 49.767 us/op 1.02
transfer serialized Status (84 B) 1.9360 us/op 1.9810 us/op 0.98
copy serialized Status (84 B) 1.6910 us/op 1.6270 us/op 1.04
transfer serialized SignedVoluntaryExit (112 B) 2.2840 us/op 1.8610 us/op 1.23
copy serialized SignedVoluntaryExit (112 B) 1.9490 us/op 1.6450 us/op 1.18
transfer serialized ProposerSlashing (416 B) 2.7590 us/op 2.2020 us/op 1.25
copy serialized ProposerSlashing (416 B) 3.0160 us/op 2.1100 us/op 1.43
transfer serialized Attestation (485 B) 2.5100 us/op 2.5920 us/op 0.97
copy serialized Attestation (485 B) 2.7320 us/op 2.7260 us/op 1.00
transfer serialized AttesterSlashing (33232 B) 2.2860 us/op 3.0050 us/op 0.76
copy serialized AttesterSlashing (33232 B) 6.7140 us/op 6.4330 us/op 1.04
transfer serialized Small SignedBeaconBlock (128000 B) 2.8430 us/op 2.7790 us/op 1.02
copy serialized Small SignedBeaconBlock (128000 B) 14.613 us/op 16.316 us/op 0.90
transfer serialized Avg SignedBeaconBlock (200000 B) 3.1740 us/op 3.1660 us/op 1.00
copy serialized Avg SignedBeaconBlock (200000 B) 21.533 us/op 21.072 us/op 1.02
transfer serialized BlobsSidecar (524380 B) 3.5240 us/op 3.4510 us/op 1.02
copy serialized BlobsSidecar (524380 B) 94.315 us/op 132.64 us/op 0.71
transfer serialized Big SignedBeaconBlock (1000000 B) 4.0140 us/op 3.9930 us/op 1.01
copy serialized Big SignedBeaconBlock (1000000 B) 311.11 us/op 308.69 us/op 1.01
pass gossip attestations to forkchoice per slot 4.6096 ms/op 4.4865 ms/op 1.03
forkChoice updateHead vc 100000 bc 64 eq 0 713.07 us/op 711.90 us/op 1.00
forkChoice updateHead vc 600000 bc 64 eq 0 4.3692 ms/op 4.3284 ms/op 1.01
forkChoice updateHead vc 1000000 bc 64 eq 0 7.2082 ms/op 7.0640 ms/op 1.02
forkChoice updateHead vc 600000 bc 320 eq 0 4.3983 ms/op 4.2164 ms/op 1.04
forkChoice updateHead vc 600000 bc 1200 eq 0 4.6436 ms/op 4.3704 ms/op 1.06
forkChoice updateHead vc 600000 bc 7200 eq 0 5.7772 ms/op 5.3400 ms/op 1.08
forkChoice updateHead vc 600000 bc 64 eq 1000 12.455 ms/op 11.408 ms/op 1.09
forkChoice updateHead vc 600000 bc 64 eq 10000 12.622 ms/op 12.199 ms/op 1.03
forkChoice updateHead vc 600000 bc 64 eq 300000 17.696 ms/op 20.223 ms/op 0.88
computeDeltas 500000 validators 300 proto nodes 6.8214 ms/op 7.0513 ms/op 0.97
computeDeltas 500000 validators 1200 proto nodes 6.9687 ms/op 6.6754 ms/op 1.04
computeDeltas 500000 validators 7200 proto nodes 6.8090 ms/op 6.5907 ms/op 1.03
computeDeltas 750000 validators 300 proto nodes 10.649 ms/op 9.7794 ms/op 1.09
computeDeltas 750000 validators 1200 proto nodes 10.249 ms/op 9.5770 ms/op 1.07
computeDeltas 750000 validators 7200 proto nodes 10.243 ms/op 9.4889 ms/op 1.08
computeDeltas 1400000 validators 300 proto nodes 18.975 ms/op 19.036 ms/op 1.00
computeDeltas 1400000 validators 1200 proto nodes 19.484 ms/op 19.429 ms/op 1.00
computeDeltas 1400000 validators 7200 proto nodes 20.621 ms/op 19.117 ms/op 1.08
computeDeltas 2100000 validators 300 proto nodes 29.932 ms/op 28.997 ms/op 1.03
computeDeltas 2100000 validators 1200 proto nodes 30.300 ms/op 29.171 ms/op 1.04
computeDeltas 2100000 validators 7200 proto nodes 30.891 ms/op 29.902 ms/op 1.03
computeProposerBoostScoreFromBalances 500000 validators 4.2021 ms/op 3.8310 ms/op 1.10
computeProposerBoostScoreFromBalances 750000 validators 4.1959 ms/op 3.8424 ms/op 1.09
computeProposerBoostScoreFromBalances 1400000 validators 4.0696 ms/op 3.8969 ms/op 1.04
computeProposerBoostScoreFromBalances 2100000 validators 4.1754 ms/op 4.0735 ms/op 1.02
altair processAttestation - 250000 vs - 7PWei normalcase 2.9526 ms/op 2.5444 ms/op 1.16
altair processAttestation - 250000 vs - 7PWei worstcase 4.6656 ms/op 4.2966 ms/op 1.09
altair processAttestation - setStatus - 1/6 committees join 201.53 us/op 203.62 us/op 0.99
altair processAttestation - setStatus - 1/3 committees join 410.87 us/op 378.28 us/op 1.09
altair processAttestation - setStatus - 1/2 committees join 518.25 us/op 510.80 us/op 1.01
altair processAttestation - setStatus - 2/3 committees join 673.38 us/op 646.91 us/op 1.04
altair processAttestation - setStatus - 4/5 committees join 957.47 us/op 853.04 us/op 1.12
altair processAttestation - setStatus - 100% committees join 1.1228 ms/op 999.95 us/op 1.12
altair processBlock - 250000 vs - 7PWei normalcase 11.658 ms/op 11.817 ms/op 0.99
altair processBlock - 250000 vs - 7PWei normalcase hashState 42.188 ms/op 41.779 ms/op 1.01
altair processBlock - 250000 vs - 7PWei worstcase 47.190 ms/op 40.790 ms/op 1.16
altair processBlock - 250000 vs - 7PWei worstcase hashState 107.21 ms/op 109.81 ms/op 0.98
phase0 processBlock - 250000 vs - 7PWei normalcase 3.5093 ms/op 3.1684 ms/op 1.11
phase0 processBlock - 250000 vs - 7PWei worstcase 35.028 ms/op 33.832 ms/op 1.04
altair processEth1Data - 250000 vs - 7PWei normalcase 730.21 us/op 791.81 us/op 0.92
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 17.102 us/op 11.257 us/op 1.52
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 79.707 us/op 99.270 us/op 0.80
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 22.803 us/op 32.196 us/op 0.71
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 15.643 us/op 19.570 us/op 0.80
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 223.63 us/op 187.58 us/op 1.19
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.5052 ms/op 1.3045 ms/op 1.15
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.3651 ms/op 2.0607 ms/op 1.15
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.0757 ms/op 2.1386 ms/op 0.97
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.5240 ms/op 4.4531 ms/op 1.02
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.8039 ms/op 2.8024 ms/op 1.00
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 5.7725 ms/op 6.8683 ms/op 0.84
Tree 40 250000 create 595.69 ms/op 420.33 ms/op 1.42
Tree 40 250000 get(125000) 229.30 ns/op 213.91 ns/op 1.07
Tree 40 250000 set(125000) 1.1888 us/op 1.0496 us/op 1.13
Tree 40 250000 toArray() 24.531 ms/op 23.169 ms/op 1.06
Tree 40 250000 iterate all - toArray() + loop 23.428 ms/op 24.215 ms/op 0.97
Tree 40 250000 iterate all - get(i) 74.385 ms/op 77.775 ms/op 0.96
MutableVector 250000 create 16.174 ms/op 17.677 ms/op 0.91
MutableVector 250000 get(125000) 7.0980 ns/op 6.7180 ns/op 1.06
MutableVector 250000 set(125000) 346.11 ns/op 308.13 ns/op 1.12
MutableVector 250000 toArray() 4.8342 ms/op 5.6349 ms/op 0.86
MutableVector 250000 iterate all - toArray() + loop 4.6308 ms/op 4.5221 ms/op 1.02
MutableVector 250000 iterate all - get(i) 1.6259 ms/op 1.5794 ms/op 1.03
Array 250000 create 4.2904 ms/op 3.3311 ms/op 1.29
Array 250000 clone - spread 1.2994 ms/op 1.2541 ms/op 1.04
Array 250000 get(125000) 1.1750 ns/op 1.0820 ns/op 1.09
Array 250000 set(125000) 4.7400 ns/op 4.2110 ns/op 1.13
Array 250000 iterate all - loop 178.86 us/op 170.24 us/op 1.05
effectiveBalanceIncrements clone Uint8Array 300000 40.400 us/op 33.802 us/op 1.20
effectiveBalanceIncrements clone MutableVector 300000 389.00 ns/op 375.00 ns/op 1.04
effectiveBalanceIncrements rw all Uint8Array 300000 216.14 us/op 212.86 us/op 1.02
effectiveBalanceIncrements rw all MutableVector 300000 96.933 ms/op 97.650 ms/op 0.99
phase0 afterProcessEpoch - 250000 vs - 7PWei 119.68 ms/op 120.04 ms/op 1.00
phase0 beforeProcessEpoch - 250000 vs - 7PWei 55.730 ms/op 60.270 ms/op 0.92
altair processEpoch - mainnet_e81889 563.40 ms/op 473.92 ms/op 1.19
mainnet_e81889 - altair beforeProcessEpoch 91.850 ms/op 92.684 ms/op 0.99
mainnet_e81889 - altair processJustificationAndFinalization 24.728 us/op 19.786 us/op 1.25
mainnet_e81889 - altair processInactivityUpdates 6.9508 ms/op 7.3070 ms/op 0.95
mainnet_e81889 - altair processRewardsAndPenalties 75.147 ms/op 82.105 ms/op 0.92
mainnet_e81889 - altair processRegistryUpdates 3.8090 us/op 3.0280 us/op 1.26
mainnet_e81889 - altair processSlashings 654.00 ns/op 877.00 ns/op 0.75
mainnet_e81889 - altair processEth1DataReset 739.00 ns/op 1.4020 us/op 0.53
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.5175 ms/op 2.5082 ms/op 0.61
mainnet_e81889 - altair processSlashingsReset 4.0520 us/op 7.9100 us/op 0.51
mainnet_e81889 - altair processRandaoMixesReset 9.4460 us/op 12.058 us/op 0.78
mainnet_e81889 - altair processHistoricalRootsUpdate 1.0010 us/op 1.0910 us/op 0.92
mainnet_e81889 - altair processParticipationFlagUpdates 2.6860 us/op 3.6550 us/op 0.73
mainnet_e81889 - altair processSyncCommitteeUpdates 808.00 ns/op 1.0870 us/op 0.74
mainnet_e81889 - altair afterProcessEpoch 130.30 ms/op 128.59 ms/op 1.01
capella processEpoch - mainnet_e217614 2.6883 s/op 2.4033 s/op 1.12
mainnet_e217614 - capella beforeProcessEpoch 543.22 ms/op 522.97 ms/op 1.04
mainnet_e217614 - capella processJustificationAndFinalization 20.312 us/op 19.899 us/op 1.02
mainnet_e217614 - capella processInactivityUpdates 28.233 ms/op 25.090 ms/op 1.13
mainnet_e217614 - capella processRewardsAndPenalties 445.98 ms/op 468.37 ms/op 0.95
mainnet_e217614 - capella processRegistryUpdates 24.966 us/op 30.148 us/op 0.83
mainnet_e217614 - capella processSlashings 793.00 ns/op 1.0210 us/op 0.78
mainnet_e217614 - capella processEth1DataReset 1.1040 us/op 694.00 ns/op 1.59
mainnet_e217614 - capella processEffectiveBalanceUpdates 5.9811 ms/op 7.4805 ms/op 0.80
mainnet_e217614 - capella processSlashingsReset 10.204 us/op 6.7600 us/op 1.51
mainnet_e217614 - capella processRandaoMixesReset 10.460 us/op 8.7710 us/op 1.19
mainnet_e217614 - capella processHistoricalRootsUpdate 1.2520 us/op 877.00 ns/op 1.43
mainnet_e217614 - capella processParticipationFlagUpdates 6.0600 us/op 4.3210 us/op 1.40
mainnet_e217614 - capella afterProcessEpoch 453.55 ms/op 333.26 ms/op 1.36
phase0 processEpoch - mainnet_e58758 832.12 ms/op 557.77 ms/op 1.49
mainnet_e58758 - phase0 beforeProcessEpoch 278.30 ms/op 152.40 ms/op 1.83
mainnet_e58758 - phase0 processJustificationAndFinalization 33.312 us/op 20.057 us/op 1.66
mainnet_e58758 - phase0 processRewardsAndPenalties 57.189 ms/op 63.551 ms/op 0.90
mainnet_e58758 - phase0 processRegistryUpdates 24.884 us/op 14.985 us/op 1.66
mainnet_e58758 - phase0 processSlashings 854.00 ns/op 1.1170 us/op 0.76
mainnet_e58758 - phase0 processEth1DataReset 644.00 ns/op 455.00 ns/op 1.42
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.2460 ms/op 1.2157 ms/op 1.02
mainnet_e58758 - phase0 processSlashingsReset 4.6160 us/op 3.2290 us/op 1.43
mainnet_e58758 - phase0 processRandaoMixesReset 5.6180 us/op 5.1990 us/op 1.08
mainnet_e58758 - phase0 processHistoricalRootsUpdate 671.00 ns/op 475.00 ns/op 1.41
mainnet_e58758 - phase0 processParticipationRecordUpdates 6.1760 us/op 12.744 us/op 0.48
mainnet_e58758 - phase0 afterProcessEpoch 106.02 ms/op 107.58 ms/op 0.99
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.5069 ms/op 1.5921 ms/op 0.95
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.6028 ms/op 1.5340 ms/op 1.04
altair processInactivityUpdates - 250000 normalcase 44.749 ms/op 25.137 ms/op 1.78
altair processInactivityUpdates - 250000 worstcase 36.559 ms/op 24.518 ms/op 1.49
phase0 processRegistryUpdates - 250000 normalcase 12.305 us/op 14.164 us/op 0.87
phase0 processRegistryUpdates - 250000 badcase_full_deposits 479.02 us/op 403.33 us/op 1.19
phase0 processRegistryUpdates - 250000 worstcase 0.5 160.63 ms/op 154.05 ms/op 1.04
altair processRewardsAndPenalties - 250000 normalcase 66.151 ms/op 63.865 ms/op 1.04
altair processRewardsAndPenalties - 250000 worstcase 71.296 ms/op 61.609 ms/op 1.16
phase0 getAttestationDeltas - 250000 normalcase 10.920 ms/op 12.050 ms/op 0.91
phase0 getAttestationDeltas - 250000 worstcase 12.290 ms/op 13.109 ms/op 0.94
phase0 processSlashings - 250000 worstcase 118.76 us/op 130.59 us/op 0.91
altair processSyncCommitteeUpdates - 250000 178.93 ms/op 181.12 ms/op 0.99
BeaconState.hashTreeRoot - No change 288.00 ns/op 300.00 ns/op 0.96
BeaconState.hashTreeRoot - 1 full validator 217.13 us/op 161.70 us/op 1.34
BeaconState.hashTreeRoot - 32 full validator 2.2574 ms/op 1.6978 ms/op 1.33
BeaconState.hashTreeRoot - 512 full validator 16.843 ms/op 15.561 ms/op 1.08
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 256.85 us/op 177.36 us/op 1.45
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.5903 ms/op 2.8349 ms/op 0.91
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 42.293 ms/op 33.988 ms/op 1.24
BeaconState.hashTreeRoot - 1 balances 171.64 us/op 156.09 us/op 1.10
BeaconState.hashTreeRoot - 32 balances 1.7285 ms/op 1.4767 ms/op 1.17
BeaconState.hashTreeRoot - 512 balances 16.796 ms/op 14.718 ms/op 1.14
BeaconState.hashTreeRoot - 250000 balances 269.60 ms/op 235.47 ms/op 1.14
aggregationBits - 2048 els - zipIndexesInBitList 28.797 us/op 31.765 us/op 0.91
byteArrayEquals 32 84.170 ns/op 80.944 ns/op 1.04
Buffer.compare 32 61.227 ns/op 58.475 ns/op 1.05
byteArrayEquals 1024 2.2240 us/op 2.1796 us/op 1.02
Buffer.compare 1024 77.858 ns/op 81.957 ns/op 0.95
byteArrayEquals 16384 35.716 us/op 35.250 us/op 1.01
Buffer.compare 16384 284.79 ns/op 296.20 ns/op 0.96
byteArrayEquals 123687377 261.23 ms/op 272.76 ms/op 0.96
Buffer.compare 123687377 10.573 ms/op 11.968 ms/op 0.88
byteArrayEquals 32 - diff last byte 78.970 ns/op 91.374 ns/op 0.86
Buffer.compare 32 - diff last byte 60.747 ns/op 61.239 ns/op 0.99
byteArrayEquals 1024 - diff last byte 2.1891 us/op 2.1731 us/op 1.01
Buffer.compare 1024 - diff last byte 77.715 ns/op 82.834 ns/op 0.94
byteArrayEquals 16384 - diff last byte 36.829 us/op 33.839 us/op 1.09
Buffer.compare 16384 - diff last byte 278.53 ns/op 316.11 ns/op 0.88
byteArrayEquals 123687377 - diff last byte 285.28 ms/op 269.74 ms/op 1.06
Buffer.compare 123687377 - diff last byte 12.961 ms/op 11.755 ms/op 1.10
byteArrayEquals 32 - random bytes 8.2550 ns/op 8.7450 ns/op 0.94
Buffer.compare 32 - random bytes 70.717 ns/op 70.871 ns/op 1.00
byteArrayEquals 1024 - random bytes 8.0900 ns/op 7.1690 ns/op 1.13
Buffer.compare 1024 - random bytes 67.065 ns/op 68.386 ns/op 0.98
byteArrayEquals 16384 - random bytes 7.2950 ns/op 7.3550 ns/op 0.99
Buffer.compare 16384 - random bytes 66.583 ns/op 67.346 ns/op 0.99
byteArrayEquals 123687377 - random bytes 15.910 ns/op 22.840 ns/op 0.70
Buffer.compare 123687377 - random bytes 87.660 ns/op 81.400 ns/op 1.08
regular array get 100000 times 51.859 us/op 55.798 us/op 0.93
wrappedArray get 100000 times 51.415 us/op 47.781 us/op 1.08
arrayWithProxy get 100000 times 15.204 ms/op 15.966 ms/op 0.95
ssz.Root.equals 73.008 ns/op 57.645 ns/op 1.27
byteArrayEquals 58.233 ns/op 57.018 ns/op 1.02
Buffer.compare 13.024 ns/op 13.342 ns/op 0.98
shuffle list - 16384 els 7.7416 ms/op 7.5900 ms/op 1.02
shuffle list - 250000 els 114.49 ms/op 117.16 ms/op 0.98
processSlot - 1 slots 18.575 us/op 20.849 us/op 0.89
processSlot - 32 slots 4.0232 ms/op 4.3583 ms/op 0.92
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 62.779 ms/op 81.681 ms/op 0.77
getCommitteeAssignments - req 1 vs - 250000 vc 2.6181 ms/op 3.0244 ms/op 0.87
getCommitteeAssignments - req 100 vs - 250000 vc 3.8589 ms/op 4.4168 ms/op 0.87
getCommitteeAssignments - req 1000 vs - 250000 vc 4.2225 ms/op 5.1320 ms/op 0.82
findModifiedValidators - 10000 modified validators 572.80 ms/op 801.55 ms/op 0.71
findModifiedValidators - 1000 modified validators 451.73 ms/op 624.77 ms/op 0.72
findModifiedValidators - 100 modified validators 443.19 ms/op 656.57 ms/op 0.68
findModifiedValidators - 10 modified validators 420.18 ms/op 602.26 ms/op 0.70
findModifiedValidators - 1 modified validators 410.45 ms/op 608.15 ms/op 0.67
findModifiedValidators - no difference 391.27 ms/op 550.35 ms/op 0.71
compare ViewDUs 4.5391 s/op 5.2614 s/op 0.86
compare each validator Uint8Array 1.4341 s/op 2.1780 s/op 0.66
compare ViewDU to Uint8Array 1.3591 s/op 1.4644 s/op 0.93
migrate state 1000000 validators, 24 modified, 0 new 863.06 ms/op 858.28 ms/op 1.01
migrate state 1000000 validators, 1700 modified, 1000 new 1.0711 s/op 1.4165 s/op 0.76
migrate state 1000000 validators, 3400 modified, 2000 new 1.4208 s/op 1.8393 s/op 0.77
migrate state 1500000 validators, 24 modified, 0 new 821.73 ms/op 1.3266 s/op 0.62
migrate state 1500000 validators, 1700 modified, 1000 new 1.2750 s/op 1.5583 s/op 0.82
migrate state 1500000 validators, 3400 modified, 2000 new 2.4272 s/op 1.7538 s/op 1.38
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 9.9000 ns/op 6.2300 ns/op 1.59
state getBlockRootAtSlot - 250000 vs - 7PWei 1.3110 us/op 869.22 ns/op 1.51
computeProposers - vc 250000 11.762 ms/op 11.451 ms/op 1.03
computeEpochShuffling - vc 250000 115.17 ms/op 122.61 ms/op 0.94
getNextSyncCommittee - vc 250000 265.88 ms/op 200.71 ms/op 1.32
computeSigningRoot for AttestationData 48.282 us/op 40.465 us/op 1.19
hash AttestationData serialized data then Buffer.toString(base64) 3.1581 us/op 2.7089 us/op 1.17
toHexString serialized data 2.3287 us/op 2.0970 us/op 1.11
Buffer.toString(base64) 488.76 ns/op 321.92 ns/op 1.52

by benchmarkbot/action

@dapplion
Copy link
Contributor

dapplion commented Dec 1, 2023

Definitely not necessary to track every single step. Some functions are extremely cheap to run, just track the ones that do complex expensive logic, look at the benchmarks for reference

@twoeths twoeths force-pushed the tuyen/epoch_transition_step_metrics branch from 5f6333e to bc34818 Compare December 5, 2023 02:35
@twoeths twoeths marked this pull request as ready for review December 5, 2023 03:00
@twoeths twoeths requested a review from a team as a code owner December 5, 2023 03:00
@@ -59,19 +65,31 @@ export function processEpoch(fork: ForkSeq, state: CachedBeaconStateAllForks, ca
throw new Error("Lodestar does not support this network, parameters don't fit number value inside state.slashings");
}

let timer = metrics?.epochTransitionStepTime.startTimer({step: "processJustificationAndFinalization"});
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it's necessary to use a let here, just declare individual variables. You only need to register labels once

Copy link

codecov bot commented Dec 12, 2023

Codecov Report

Merging #6143 (172da6a) into unstable (5201ac4) will increase coverage by 90.35%.
Report is 17 commits behind head on unstable.
The diff coverage is n/a.

Additional details and impacted files
@@              Coverage Diff              @@
##           unstable    #6143       +/-   ##
=============================================
+ Coverage          0   90.35%   +90.35%     
=============================================
  Files             0       78       +78     
  Lines             0     8089     +8089     
  Branches          0      490      +490     
=============================================
+ Hits              0     7309     +7309     
- Misses            0      772      +772     
- Partials          0        8        +8     

@philknows philknows added this to the v1.13.0 milestone Dec 12, 2023
@@ -59,19 +65,53 @@ export function processEpoch(fork: ForkSeq, state: CachedBeaconStateAllForks, ca
throw new Error("Lodestar does not support this network, parameters don't fit number value inside state.slashings");
}

processJustificationAndFinalization(state, cache);
{
const timer = metrics?.epochTransitionStepTime.startTimer({
Copy link
Member

Choose a reason for hiding this comment

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

would it make sense to have a metric utility function withTimer which just does the instrumentation? could refactor in a separate PR

Copy link
Member

Choose a reason for hiding this comment

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

yeah, that would be nice

@wemeetagain wemeetagain merged commit 3a43dcb into unstable Dec 12, 2023
14 of 15 checks passed
@wemeetagain wemeetagain deleted the tuyen/epoch_transition_step_metrics branch December 12, 2023 17:23
@wemeetagain
Copy link
Member

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

5 participants