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: transfer cache in prepareNextSlot epoch transition #6068

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Oct 26, 2023

Motivation

While investigating #6063 I found we only transfer cache when verifying block

const preState0 = await this.regen
as part of transition

However at epoch boundary when getPreState() we get the checkpoint state instead of state of previous epoch to save us an epoch transition

const checkpointState = this.checkpointStateCache.getLatest(parentRoot, blockEpoch);

Description

  • Also transfer cache at prepareNextSlot() when we cache Previous Root Checkpoint State

related to #6063

Test Result
Epoch transition of this branch vs unstable group

type of node feature branch unstable
mainnet. 0.96s 1.1s.
64 0.73s 0.81s
16. 3.3s 4s
sm1v 2.15s 3.25s
novc 4.6s. 1.6s

on all types of node I see lower epoch transition time except for novc where unstable is significantly faster, not sure why it is like that but epoch transition on novc is inconsistent between groups so I'd not trust it

@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 3adfb5b Previous: 421fd1a Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 618.68 us/op 582.58 us/op 1.06
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 56.951 us/op 101.73 us/op 0.56
BLS verify - blst-native 1.1475 ms/op 1.3686 ms/op 0.84
BLS verifyMultipleSignatures 3 - blst-native 2.4500 ms/op 2.8786 ms/op 0.85
BLS verifyMultipleSignatures 8 - blst-native 5.4095 ms/op 7.1131 ms/op 0.76
BLS verifyMultipleSignatures 32 - blst-native 22.042 ms/op 26.635 ms/op 0.83
BLS verifyMultipleSignatures 64 - blst-native 39.420 ms/op 49.207 ms/op 0.80
BLS verifyMultipleSignatures 128 - blst-native 84.347 ms/op 96.214 ms/op 0.88
BLS deserializing 10000 signatures 808.62 ms/op 984.53 ms/op 0.82
BLS deserializing 100000 signatures 8.1163 s/op 9.8197 s/op 0.83
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.1452 ms/op 1.3725 ms/op 0.83
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.3011 ms/op 1.5470 ms/op 0.84
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.2660 ms/op 2.3914 ms/op 0.95
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.0314 ms/op 3.4977 ms/op 0.87
BLS verifyMultipleSignatures - same message - 128 - blst-native 5.0131 ms/op 5.7403 ms/op 0.87
BLS aggregatePubkeys 32 - blst-native 24.051 us/op 26.221 us/op 0.92
BLS aggregatePubkeys 128 - blst-native 89.972 us/op 103.21 us/op 0.87
getAttestationsForBlock 34.697 ms/op 43.616 ms/op 0.80
isKnown best case - 1 super set check 338.00 ns/op 379.00 ns/op 0.89
isKnown normal case - 2 super set checks 377.00 ns/op 359.00 ns/op 1.05
isKnown worse case - 16 super set checks 314.00 ns/op 365.00 ns/op 0.86
CheckpointStateCache - add get delete 4.6690 us/op 5.8210 us/op 0.80
validate api signedAggregateAndProof - struct 2.4888 ms/op 2.8320 ms/op 0.88
validate gossip signedAggregateAndProof - struct 2.4787 ms/op 2.9498 ms/op 0.84
validate gossip attestation - vc 640000 1.1760 ms/op 1.4193 ms/op 0.83
batch validate gossip attestation - vc 640000 - chunk 32 148.63 us/op 184.83 us/op 0.80
batch validate gossip attestation - vc 640000 - chunk 64 128.65 us/op 165.63 us/op 0.78
batch validate gossip attestation - vc 640000 - chunk 128 121.49 us/op 147.23 us/op 0.83
batch validate gossip attestation - vc 640000 - chunk 256 112.69 us/op 146.58 us/op 0.77
pickEth1Vote - no votes 936.33 us/op 1.2560 ms/op 0.75
pickEth1Vote - max votes 7.2863 ms/op 11.121 ms/op 0.66
pickEth1Vote - Eth1Data hashTreeRoot value x2048 15.704 ms/op 18.062 ms/op 0.87
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 14.222 ms/op 34.244 ms/op 0.42
pickEth1Vote - Eth1Data fastSerialize value x2048 419.55 us/op 662.36 us/op 0.63
pickEth1Vote - Eth1Data fastSerialize tree x2048 3.1119 ms/op 8.5028 ms/op 0.37
bytes32 toHexString 346.00 ns/op 636.00 ns/op 0.54
bytes32 Buffer.toString(hex) 199.00 ns/op 312.00 ns/op 0.64
bytes32 Buffer.toString(hex) from Uint8Array 300.00 ns/op 522.00 ns/op 0.57
bytes32 Buffer.toString(hex) + 0x 207.00 ns/op 315.00 ns/op 0.66
Object access 1 prop 0.10700 ns/op 0.18800 ns/op 0.57
Map access 1 prop 0.10200 ns/op 0.14900 ns/op 0.68
Object get x1000 5.3340 ns/op 7.4650 ns/op 0.71
Map get x1000 0.45000 ns/op 0.69500 ns/op 0.65
Object set x1000 28.491 ns/op 59.845 ns/op 0.48
Map set x1000 17.373 ns/op 45.873 ns/op 0.38
Return object 10000 times 0.22510 ns/op 0.25640 ns/op 0.88
Throw Error 10000 times 2.8845 us/op 4.1581 us/op 0.69
fastMsgIdFn sha256 / 200 bytes 1.9640 us/op 3.4440 us/op 0.57
fastMsgIdFn h32 xxhash / 200 bytes 201.00 ns/op 318.00 ns/op 0.63
fastMsgIdFn h64 xxhash / 200 bytes 242.00 ns/op 399.00 ns/op 0.61
fastMsgIdFn sha256 / 1000 bytes 6.4120 us/op 11.994 us/op 0.53
fastMsgIdFn h32 xxhash / 1000 bytes 323.00 ns/op 457.00 ns/op 0.71
fastMsgIdFn h64 xxhash / 1000 bytes 312.00 ns/op 472.00 ns/op 0.66
fastMsgIdFn sha256 / 10000 bytes 53.951 us/op 108.64 us/op 0.50
fastMsgIdFn h32 xxhash / 10000 bytes 1.7340 us/op 2.0550 us/op 0.84
fastMsgIdFn h64 xxhash / 10000 bytes 1.1440 us/op 1.4340 us/op 0.80
send data - 1000 256B messages 11.342 ms/op 21.648 ms/op 0.52
send data - 1000 512B messages 15.185 ms/op 29.430 ms/op 0.52
send data - 1000 1024B messages 22.648 ms/op 43.970 ms/op 0.52
send data - 1000 1200B messages 21.673 ms/op 29.495 ms/op 0.73
send data - 1000 2048B messages 27.107 ms/op 37.603 ms/op 0.72
send data - 1000 4096B messages 23.127 ms/op 40.705 ms/op 0.57
send data - 1000 16384B messages 55.636 ms/op 86.396 ms/op 0.64
send data - 1000 65536B messages 278.35 ms/op 359.57 ms/op 0.77
enrSubnets - fastDeserialize 64 bits 814.00 ns/op 1.5980 us/op 0.51
enrSubnets - ssz BitVector 64 bits 326.00 ns/op 515.00 ns/op 0.63
enrSubnets - fastDeserialize 4 bits 126.00 ns/op 213.00 ns/op 0.59
enrSubnets - ssz BitVector 4 bits 339.00 ns/op 510.00 ns/op 0.66
prioritizePeers score -10:0 att 32-0.1 sync 2-0 67.079 us/op 126.18 us/op 0.53
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 92.464 us/op 160.24 us/op 0.58
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 117.25 us/op 184.85 us/op 0.63
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 193.64 us/op 333.54 us/op 0.58
prioritizePeers score 0:0 att 64-1 sync 4-1 206.34 us/op 376.91 us/op 0.55
array of 16000 items push then shift 1.3343 us/op 1.7327 us/op 0.77
LinkedList of 16000 items push then shift 6.1020 ns/op 10.458 ns/op 0.58
array of 16000 items push then pop 82.959 ns/op 105.53 ns/op 0.79
LinkedList of 16000 items push then pop 5.8170 ns/op 9.4030 ns/op 0.62
array of 24000 items push then shift 2.0117 us/op 2.6860 us/op 0.75
LinkedList of 24000 items push then shift 6.1830 ns/op 10.137 ns/op 0.61
array of 24000 items push then pop 119.26 ns/op 157.36 ns/op 0.76
LinkedList of 24000 items push then pop 6.1650 ns/op 10.187 ns/op 0.61
intersect bitArray bitLen 8 5.9500 ns/op 7.6270 ns/op 0.78
intersect array and set length 8 51.065 ns/op 70.591 ns/op 0.72
intersect bitArray bitLen 128 27.017 ns/op 35.078 ns/op 0.77
intersect array and set length 128 600.93 ns/op 970.79 ns/op 0.62
bitArray.getTrueBitIndexes() bitLen 128 1.3190 us/op 1.6930 us/op 0.78
bitArray.getTrueBitIndexes() bitLen 248 2.4410 us/op 3.0680 us/op 0.80
bitArray.getTrueBitIndexes() bitLen 512 4.6510 us/op 6.5140 us/op 0.71
Buffer.concat 32 items 904.00 ns/op 1.0700 us/op 0.84
Uint8Array.set 32 items 2.1740 us/op 2.0900 us/op 1.04
Set add up to 64 items then delete first 1.7259 us/op 5.0029 us/op 0.34
OrderedSet add up to 64 items then delete first 2.6349 us/op 6.3522 us/op 0.41
Set add up to 64 items then delete last 2.0292 us/op 5.2631 us/op 0.39
OrderedSet add up to 64 items then delete last 2.9073 us/op 7.0448 us/op 0.41
Set add up to 64 items then delete middle 2.0201 us/op 5.3221 us/op 0.38
OrderedSet add up to 64 items then delete middle 4.1397 us/op 8.8844 us/op 0.47
Set add up to 128 items then delete first 3.8376 us/op 10.760 us/op 0.36
OrderedSet add up to 128 items then delete first 5.9852 us/op 15.518 us/op 0.39
Set add up to 128 items then delete last 3.7083 us/op 10.211 us/op 0.36
OrderedSet add up to 128 items then delete last 5.5705 us/op 14.897 us/op 0.37
Set add up to 128 items then delete middle 3.7034 us/op 10.540 us/op 0.35
OrderedSet add up to 128 items then delete middle 10.626 us/op 19.498 us/op 0.55
Set add up to 256 items then delete first 6.9866 us/op 20.817 us/op 0.34
OrderedSet add up to 256 items then delete first 11.109 us/op 29.034 us/op 0.38
Set add up to 256 items then delete last 6.9253 us/op 20.434 us/op 0.34
OrderedSet add up to 256 items then delete last 10.562 us/op 27.117 us/op 0.39
Set add up to 256 items then delete middle 7.2757 us/op 20.690 us/op 0.35
OrderedSet add up to 256 items then delete middle 30.490 us/op 51.729 us/op 0.59
transfer serialized Status (84 B) 1.4840 us/op 2.1750 us/op 0.68
copy serialized Status (84 B) 1.0900 us/op 1.9060 us/op 0.57
transfer serialized SignedVoluntaryExit (112 B) 1.4540 us/op 2.5100 us/op 0.58
copy serialized SignedVoluntaryExit (112 B) 1.2350 us/op 1.9330 us/op 0.64
transfer serialized ProposerSlashing (416 B) 1.5580 us/op 3.2240 us/op 0.48
copy serialized ProposerSlashing (416 B) 1.4000 us/op 2.7060 us/op 0.52
transfer serialized Attestation (485 B) 1.4380 us/op 2.3440 us/op 0.61
copy serialized Attestation (485 B) 1.3800 us/op 2.2900 us/op 0.60
transfer serialized AttesterSlashing (33232 B) 1.5170 us/op 2.3160 us/op 0.66
copy serialized AttesterSlashing (33232 B) 2.8560 us/op 6.6690 us/op 0.43
transfer serialized Small SignedBeaconBlock (128000 B) 1.6070 us/op 2.7600 us/op 0.58
copy serialized Small SignedBeaconBlock (128000 B) 6.7910 us/op 23.124 us/op 0.29
transfer serialized Avg SignedBeaconBlock (200000 B) 1.7170 us/op 3.7840 us/op 0.45
copy serialized Avg SignedBeaconBlock (200000 B) 9.5950 us/op 42.165 us/op 0.23
transfer serialized BlobsSidecar (524380 B) 2.3250 us/op 4.4610 us/op 0.52
copy serialized BlobsSidecar (524380 B) 67.209 us/op 124.05 us/op 0.54
transfer serialized Big SignedBeaconBlock (1000000 B) 2.6950 us/op 4.6980 us/op 0.57
copy serialized Big SignedBeaconBlock (1000000 B) 127.53 us/op 196.74 us/op 0.65
pass gossip attestations to forkchoice per slot 2.6791 ms/op 3.9986 ms/op 0.67
forkChoice updateHead vc 100000 bc 64 eq 0 441.28 us/op 716.25 us/op 0.62
forkChoice updateHead vc 600000 bc 64 eq 0 2.8101 ms/op 5.0472 ms/op 0.56
forkChoice updateHead vc 1000000 bc 64 eq 0 4.5212 ms/op 8.0091 ms/op 0.56
forkChoice updateHead vc 600000 bc 320 eq 0 2.6434 ms/op 4.5799 ms/op 0.58
forkChoice updateHead vc 600000 bc 1200 eq 0 2.8447 ms/op 4.7017 ms/op 0.61
forkChoice updateHead vc 600000 bc 7200 eq 0 3.4746 ms/op 5.7295 ms/op 0.61
forkChoice updateHead vc 600000 bc 64 eq 1000 10.389 ms/op 11.975 ms/op 0.87
forkChoice updateHead vc 600000 bc 64 eq 10000 10.330 ms/op 13.029 ms/op 0.79
forkChoice updateHead vc 600000 bc 64 eq 300000 12.166 ms/op 28.185 ms/op 0.43
computeDeltas 500000 validators 300 proto nodes 3.0282 ms/op 6.7868 ms/op 0.45
computeDeltas 500000 validators 1200 proto nodes 3.3894 ms/op 6.7647 ms/op 0.50
computeDeltas 500000 validators 7200 proto nodes 3.3344 ms/op 6.6708 ms/op 0.50
computeDeltas 750000 validators 300 proto nodes 4.7836 ms/op 10.128 ms/op 0.47
computeDeltas 750000 validators 1200 proto nodes 4.8239 ms/op 9.8172 ms/op 0.49
computeDeltas 750000 validators 7200 proto nodes 4.6217 ms/op 9.8566 ms/op 0.47
computeDeltas 1400000 validators 300 proto nodes 8.5445 ms/op 18.323 ms/op 0.47
computeDeltas 1400000 validators 1200 proto nodes 8.2656 ms/op 18.174 ms/op 0.45
computeDeltas 1400000 validators 7200 proto nodes 8.6544 ms/op 18.275 ms/op 0.47
computeDeltas 2100000 validators 300 proto nodes 13.347 ms/op 27.265 ms/op 0.49
computeDeltas 2100000 validators 1200 proto nodes 13.259 ms/op 27.422 ms/op 0.48
computeDeltas 2100000 validators 7200 proto nodes 12.744 ms/op 26.894 ms/op 0.47
computeProposerBoostScoreFromBalances 500000 validators 2.8073 ms/op 3.3125 ms/op 0.85
computeProposerBoostScoreFromBalances 750000 validators 2.7965 ms/op 3.3089 ms/op 0.85
computeProposerBoostScoreFromBalances 1400000 validators 2.7674 ms/op 3.3058 ms/op 0.84
computeProposerBoostScoreFromBalances 2100000 validators 2.7860 ms/op 3.2870 ms/op 0.85
altair processAttestation - 250000 vs - 7PWei normalcase 1.8842 ms/op 2.2814 ms/op 0.83
altair processAttestation - 250000 vs - 7PWei worstcase 2.1617 ms/op 3.3135 ms/op 0.65
altair processAttestation - setStatus - 1/6 committees join 111.93 us/op 193.85 us/op 0.58
altair processAttestation - setStatus - 1/3 committees join 213.34 us/op 355.31 us/op 0.60
altair processAttestation - setStatus - 1/2 committees join 297.51 us/op 478.22 us/op 0.62
altair processAttestation - setStatus - 2/3 committees join 383.99 us/op 618.27 us/op 0.62
altair processAttestation - setStatus - 4/5 committees join 504.92 us/op 860.99 us/op 0.59
altair processAttestation - setStatus - 100% committees join 597.47 us/op 986.77 us/op 0.61
altair processBlock - 250000 vs - 7PWei normalcase 9.0161 ms/op 10.137 ms/op 0.89
altair processBlock - 250000 vs - 7PWei normalcase hashState 24.736 ms/op 33.817 ms/op 0.73
altair processBlock - 250000 vs - 7PWei worstcase 30.481 ms/op 40.697 ms/op 0.75
altair processBlock - 250000 vs - 7PWei worstcase hashState 73.005 ms/op 86.359 ms/op 0.85
phase0 processBlock - 250000 vs - 7PWei normalcase 1.9543 ms/op 2.7840 ms/op 0.70
phase0 processBlock - 250000 vs - 7PWei worstcase 24.077 ms/op 35.762 ms/op 0.67
altair processEth1Data - 250000 vs - 7PWei normalcase 299.13 us/op 556.20 us/op 0.54
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 8.0620 us/op 12.300 us/op 0.66
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 45.249 us/op 63.167 us/op 0.72
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 8.9970 us/op 16.272 us/op 0.55
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 10.125 us/op 14.942 us/op 0.68
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 108.29 us/op 168.72 us/op 0.64
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 668.18 us/op 1.2311 ms/op 0.54
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.1366 ms/op 1.6375 ms/op 0.69
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.0995 ms/op 1.6875 ms/op 0.65
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.5827 ms/op 3.7420 ms/op 0.69
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.3897 ms/op 3.0503 ms/op 0.46
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.8093 ms/op 5.2191 ms/op 0.73
Tree 40 250000 create 255.45 ms/op 318.13 ms/op 0.80
Tree 40 250000 get(125000) 110.87 ns/op 202.63 ns/op 0.55
Tree 40 250000 set(125000) 618.06 ns/op 914.08 ns/op 0.68
Tree 40 250000 toArray() 9.4951 ms/op 22.193 ms/op 0.43
Tree 40 250000 iterate all - toArray() + loop 9.4987 ms/op 22.602 ms/op 0.42
Tree 40 250000 iterate all - get(i) 41.631 ms/op 73.378 ms/op 0.57
MutableVector 250000 create 8.4336 ms/op 11.400 ms/op 0.74
MutableVector 250000 get(125000) 5.5780 ns/op 6.5500 ns/op 0.85
MutableVector 250000 set(125000) 189.77 ns/op 263.28 ns/op 0.72
MutableVector 250000 toArray() 2.8896 ms/op 3.0634 ms/op 0.94
MutableVector 250000 iterate all - toArray() + loop 2.9599 ms/op 3.6857 ms/op 0.80
MutableVector 250000 iterate all - get(i) 1.4018 ms/op 1.5470 ms/op 0.91
Array 250000 create 2.2375 ms/op 3.4465 ms/op 0.65
Array 250000 clone - spread 900.11 us/op 1.2946 ms/op 0.70
Array 250000 get(125000) 0.46400 ns/op 0.61700 ns/op 0.75
Array 250000 set(125000) 0.54200 ns/op 0.68700 ns/op 0.79
Array 250000 iterate all - loop 77.686 us/op 84.162 us/op 0.92
effectiveBalanceIncrements clone Uint8Array 300000 11.489 us/op 31.969 us/op 0.36
effectiveBalanceIncrements clone MutableVector 300000 249.00 ns/op 359.00 ns/op 0.69
effectiveBalanceIncrements rw all Uint8Array 300000 171.09 us/op 178.87 us/op 0.96
effectiveBalanceIncrements rw all MutableVector 300000 59.322 ms/op 85.779 ms/op 0.69
phase0 afterProcessEpoch - 250000 vs - 7PWei 78.713 ms/op 114.33 ms/op 0.69
phase0 beforeProcessEpoch - 250000 vs - 7PWei 26.737 ms/op 35.678 ms/op 0.75
altair processEpoch - mainnet_e81889 361.82 ms/op 456.69 ms/op 0.79
mainnet_e81889 - altair beforeProcessEpoch 55.784 ms/op 63.796 ms/op 0.87
mainnet_e81889 - altair processJustificationAndFinalization 10.610 us/op 19.899 us/op 0.53
mainnet_e81889 - altair processInactivityUpdates 4.0470 ms/op 6.3718 ms/op 0.64
mainnet_e81889 - altair processRewardsAndPenalties 53.818 ms/op 63.297 ms/op 0.85
mainnet_e81889 - altair processRegistryUpdates 1.2940 us/op 2.6060 us/op 0.50
mainnet_e81889 - altair processSlashings 316.00 ns/op 653.00 ns/op 0.48
mainnet_e81889 - altair processEth1DataReset 545.00 ns/op 621.00 ns/op 0.88
mainnet_e81889 - altair processEffectiveBalanceUpdates 958.76 us/op 1.2902 ms/op 0.74
mainnet_e81889 - altair processSlashingsReset 1.8420 us/op 5.2340 us/op 0.35
mainnet_e81889 - altair processRandaoMixesReset 3.0290 us/op 5.4320 us/op 0.56
mainnet_e81889 - altair processHistoricalRootsUpdate 408.00 ns/op 1.1220 us/op 0.36
mainnet_e81889 - altair processParticipationFlagUpdates 978.00 ns/op 2.5680 us/op 0.38
mainnet_e81889 - altair processSyncCommitteeUpdates 626.00 ns/op 585.00 ns/op 1.07
mainnet_e81889 - altair afterProcessEpoch 88.224 ms/op 127.65 ms/op 0.69
capella processEpoch - mainnet_e217614 1.4358 s/op 1.4271 s/op 1.01
mainnet_e217614 - capella beforeProcessEpoch 310.86 ms/op 240.27 ms/op 1.29
mainnet_e217614 - capella processJustificationAndFinalization 23.333 us/op 12.596 us/op 1.85
mainnet_e217614 - capella processInactivityUpdates 24.659 ms/op 16.813 ms/op 1.47
mainnet_e217614 - capella processRewardsAndPenalties 351.05 ms/op 290.84 ms/op 1.21
mainnet_e217614 - capella processRegistryUpdates 32.647 us/op 26.703 us/op 1.22
mainnet_e217614 - capella processSlashings 758.00 ns/op 489.00 ns/op 1.55
mainnet_e217614 - capella processEth1DataReset 830.00 ns/op 665.00 ns/op 1.25
mainnet_e217614 - capella processEffectiveBalanceUpdates 3.6068 ms/op 4.3555 ms/op 0.83
mainnet_e217614 - capella processSlashingsReset 4.6020 us/op 2.6770 us/op 1.72
mainnet_e217614 - capella processRandaoMixesReset 9.7080 us/op 5.8410 us/op 1.66
mainnet_e217614 - capella processHistoricalRootsUpdate 1.1980 us/op 1.0820 us/op 1.11
mainnet_e217614 - capella processParticipationFlagUpdates 4.6760 us/op 2.6020 us/op 1.80
mainnet_e217614 - capella afterProcessEpoch 224.97 ms/op 324.12 ms/op 0.69
phase0 processEpoch - mainnet_e58758 350.97 ms/op 448.98 ms/op 0.78
mainnet_e58758 - phase0 beforeProcessEpoch 109.46 ms/op 118.04 ms/op 0.93
mainnet_e58758 - phase0 processJustificationAndFinalization 8.3200 us/op 15.487 us/op 0.54
mainnet_e58758 - phase0 processRewardsAndPenalties 50.600 ms/op 52.938 ms/op 0.96
mainnet_e58758 - phase0 processRegistryUpdates 4.2500 us/op 12.886 us/op 0.33
mainnet_e58758 - phase0 processSlashings 227.00 ns/op 787.00 ns/op 0.29
mainnet_e58758 - phase0 processEth1DataReset 222.00 ns/op 620.00 ns/op 0.36
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 735.75 us/op 1.1083 ms/op 0.66
mainnet_e58758 - phase0 processSlashingsReset 1.3140 us/op 3.5410 us/op 0.37
mainnet_e58758 - phase0 processRandaoMixesReset 5.9850 us/op 6.3610 us/op 0.94
mainnet_e58758 - phase0 processHistoricalRootsUpdate 686.00 ns/op 564.00 ns/op 1.22
mainnet_e58758 - phase0 processParticipationRecordUpdates 2.9700 us/op 4.7830 us/op 0.62
mainnet_e58758 - phase0 afterProcessEpoch 69.881 ms/op 106.15 ms/op 0.66
phase0 processEffectiveBalanceUpdates - 250000 normalcase 944.44 us/op 1.2672 ms/op 0.75
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.1195 ms/op 1.9392 ms/op 0.58
altair processInactivityUpdates - 250000 normalcase 16.338 ms/op 26.026 ms/op 0.63
altair processInactivityUpdates - 250000 worstcase 16.560 ms/op 27.570 ms/op 0.60
phase0 processRegistryUpdates - 250000 normalcase 5.2080 us/op 10.823 us/op 0.48
phase0 processRegistryUpdates - 250000 badcase_full_deposits 237.63 us/op 333.63 us/op 0.71
phase0 processRegistryUpdates - 250000 worstcase 0.5 105.43 ms/op 146.92 ms/op 0.72
altair processRewardsAndPenalties - 250000 normalcase 47.178 ms/op 71.653 ms/op 0.66
altair processRewardsAndPenalties - 250000 worstcase 38.835 ms/op 68.972 ms/op 0.56
phase0 getAttestationDeltas - 250000 normalcase 5.4860 ms/op 8.4737 ms/op 0.65
phase0 getAttestationDeltas - 250000 worstcase 5.5696 ms/op 11.025 ms/op 0.51
phase0 processSlashings - 250000 worstcase 1.6782 ms/op 2.8614 ms/op 0.59
altair processSyncCommitteeUpdates - 250000 112.71 ms/op 165.70 ms/op 0.68
BeaconState.hashTreeRoot - No change 185.00 ns/op 276.00 ns/op 0.67
BeaconState.hashTreeRoot - 1 full validator 141.97 us/op 134.28 us/op 1.06
BeaconState.hashTreeRoot - 32 full validator 1.2514 ms/op 1.4506 ms/op 0.86
BeaconState.hashTreeRoot - 512 full validator 13.354 ms/op 14.132 ms/op 0.94
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 147.29 us/op 145.54 us/op 1.01
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.9128 ms/op 2.3799 ms/op 0.80
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 26.034 ms/op 31.203 ms/op 0.83
BeaconState.hashTreeRoot - 1 balances 129.07 us/op 150.88 us/op 0.86
BeaconState.hashTreeRoot - 32 balances 1.0192 ms/op 1.2115 ms/op 0.84
BeaconState.hashTreeRoot - 512 balances 10.497 ms/op 14.621 ms/op 0.72
BeaconState.hashTreeRoot - 250000 balances 228.23 ms/op 210.41 ms/op 1.08
aggregationBits - 2048 els - zipIndexesInBitList 22.321 us/op 18.010 us/op 1.24
regular array get 100000 times 30.983 us/op 36.846 us/op 0.84
wrappedArray get 100000 times 31.283 us/op 36.615 us/op 0.85
arrayWithProxy get 100000 times 10.067 ms/op 15.515 ms/op 0.65
ssz.Root.equals 249.00 ns/op 248.00 ns/op 1.00
byteArrayEquals 219.00 ns/op 255.00 ns/op 0.86
shuffle list - 16384 els 4.8557 ms/op 7.8216 ms/op 0.62
shuffle list - 250000 els 70.659 ms/op 112.01 ms/op 0.63
processSlot - 1 slots 18.962 us/op 15.524 us/op 1.22
processSlot - 32 slots 3.5288 ms/op 4.0894 ms/op 0.86
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 39.829 ms/op 55.910 ms/op 0.71
getCommitteeAssignments - req 1 vs - 250000 vc 2.2766 ms/op 2.5652 ms/op 0.89
getCommitteeAssignments - req 100 vs - 250000 vc 3.4088 ms/op 3.7866 ms/op 0.90
getCommitteeAssignments - req 1000 vs - 250000 vc 3.7507 ms/op 4.1588 ms/op 0.90
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 3.8700 ns/op 4.8500 ns/op 0.80
state getBlockRootAtSlot - 250000 vs - 7PWei 365.74 ns/op 513.33 ns/op 0.71
computeProposers - vc 250000 6.0536 ms/op 8.7726 ms/op 0.69
computeEpochShuffling - vc 250000 71.537 ms/op 105.40 ms/op 0.68
getNextSyncCommittee - vc 250000 100.55 ms/op 149.72 ms/op 0.67
computeSigningRoot for AttestationData 25.804 us/op 21.627 us/op 1.19
hash AttestationData serialized data then Buffer.toString(base64) 1.2838 us/op 2.3509 us/op 0.55
toHexString serialized data 841.65 ns/op 1.1390 us/op 0.74
Buffer.toString(base64) 150.65 ns/op 245.62 ns/op 0.61

by benchmarkbot/action

@twoeths twoeths marked this pull request as ready for review October 26, 2023 12:06
@twoeths twoeths requested a review from a team as a code owner October 26, 2023 12:06
@twoeths
Copy link
Contributor Author

twoeths commented Oct 30, 2023

after testing for 4 more days, the difference on epoch transition time is quite random (mainnet node is better but others are worse) so we can't count on that metric. @dapplion do you know what other metrics should I look into?

@dapplion
Copy link
Contributor

@tuyennhv there are metrics to check how often the validator and balance caches are populated in the state used in state transitions. If the rate of cache hits is higher, then the PR should be merged.

preStateBalancesNodesPopulatedMiss: Gauge<"source">;
preStateBalancesNodesPopulatedHit: Gauge<"source">;
preStateValidatorsNodesPopulatedMiss: Gauge<"source">;
preStateValidatorsNodesPopulatedHit: Gauge<"source">;

@twoeths
Copy link
Contributor Author

twoeths commented Oct 31, 2023

it really shows that mainnet node has less missed validators node on this branch, that's why I see better epoch transition time on this node

Screenshot 2023-10-31 at 17 08 14

for other goerli nodes, the ratio is just the same

@wemeetagain wemeetagain merged commit c8e6b67 into unstable Nov 8, 2023
14 checks passed
@wemeetagain wemeetagain deleted the tuyen/dont_transfer_cache branch November 8, 2023 12:05
@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.

3 participants