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

test: move syncing logic to helper functions #6638

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

nazarhussain
Copy link
Contributor

Motivation

Reuse the code where possible.

Description

  • Move the syncing assertions logic to helper functions
  • Reuse those helpers in different tests.

Steps to test or reproduce

Run all tests

@nazarhussain nazarhussain requested a review from a team as a code owner April 5, 2024 13:13
@nazarhussain nazarhussain self-assigned this Apr 5, 2024
@nazarhussain nazarhussain changed the title test: move syncing logic to helper functions refactor: move syncing logic to helper functions Apr 5, 2024
Copy link

codecov bot commented Apr 5, 2024

Codecov Report

Merging #6638 (7127bf1) into unstable (898cd90) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #6638   +/-   ##
=========================================
  Coverage     61.69%   61.69%           
=========================================
  Files           556      556           
  Lines         58820    58820           
  Branches       1887     1887           
=========================================
  Hits          36287    36287           
  Misses        22492    22492           
  Partials         41       41           

Copy link
Contributor

github-actions bot commented Apr 5, 2024

Performance Report

✔️ no performance regression detected

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: 21ae754 Previous: e202592 Ratio
getSlashingsAndExits - default max 147.15 us/op 452.97 us/op 0.32
Full benchmark results
Benchmark suite Current: 21ae754 Previous: e202592 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 476.99 us/op 580.47 us/op 0.82
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 106.69 us/op 106.08 us/op 1.01
BLS verify - blst-native 1.1598 ms/op 1.3251 ms/op 0.88
BLS verifyMultipleSignatures 3 - blst-native 2.4699 ms/op 2.7329 ms/op 0.90
BLS verifyMultipleSignatures 8 - blst-native 5.3635 ms/op 6.2065 ms/op 0.86
BLS verifyMultipleSignatures 32 - blst-native 19.926 ms/op 22.360 ms/op 0.89
BLS verifyMultipleSignatures 64 - blst-native 38.830 ms/op 43.503 ms/op 0.89
BLS verifyMultipleSignatures 128 - blst-native 87.913 ms/op 85.514 ms/op 1.03
BLS deserializing 10000 signatures 874.72 ms/op 908.72 ms/op 0.96
BLS deserializing 100000 signatures 8.4072 s/op 9.5040 s/op 0.88
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.1453 ms/op 1.3670 ms/op 0.84
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.2751 ms/op 1.7009 ms/op 0.75
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.6234 ms/op 2.8853 ms/op 0.91
BLS verifyMultipleSignatures - same message - 64 - blst-native 4.0921 ms/op 4.7312 ms/op 0.86
BLS verifyMultipleSignatures - same message - 128 - blst-native 5.0696 ms/op 5.6790 ms/op 0.89
BLS aggregatePubkeys 32 - blst-native 22.835 us/op 25.955 us/op 0.88
BLS aggregatePubkeys 128 - blst-native 85.458 us/op 102.09 us/op 0.84
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 43.366 ms/op 59.524 ms/op 0.73
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 51.828 ms/op 61.654 ms/op 0.84
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 29.518 ms/op 49.807 ms/op 0.59
getSlashingsAndExits - default max 147.15 us/op 452.97 us/op 0.32
getSlashingsAndExits - 2k 315.71 us/op 874.70 us/op 0.36
proposeBlockBody type=full, size=empty 4.2632 ms/op 7.5664 ms/op 0.56
isKnown best case - 1 super set check 331.00 ns/op 715.00 ns/op 0.46
isKnown normal case - 2 super set checks 318.00 ns/op 768.00 ns/op 0.41
isKnown worse case - 16 super set checks 313.00 ns/op 749.00 ns/op 0.42
InMemoryCheckpointStateCache - add get delete 7.2520 us/op 8.7650 us/op 0.83
validate api signedAggregateAndProof - struct 2.4593 ms/op 3.5039 ms/op 0.70
validate gossip signedAggregateAndProof - struct 2.5344 ms/op 3.2698 ms/op 0.78
validate gossip attestation - vc 640000 1.1649 ms/op 1.6311 ms/op 0.71
batch validate gossip attestation - vc 640000 - chunk 32 145.54 us/op 178.50 us/op 0.82
batch validate gossip attestation - vc 640000 - chunk 64 127.67 us/op 148.23 us/op 0.86
batch validate gossip attestation - vc 640000 - chunk 128 133.31 us/op 145.10 us/op 0.92
batch validate gossip attestation - vc 640000 - chunk 256 126.81 us/op 135.25 us/op 0.94
pickEth1Vote - no votes 1.0756 ms/op 1.1855 ms/op 0.91
pickEth1Vote - max votes 7.3740 ms/op 11.089 ms/op 0.66
pickEth1Vote - Eth1Data hashTreeRoot value x2048 24.074 ms/op 20.518 ms/op 1.17
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 30.648 ms/op 26.096 ms/op 1.17
pickEth1Vote - Eth1Data fastSerialize value x2048 621.36 us/op 695.64 us/op 0.89
pickEth1Vote - Eth1Data fastSerialize tree x2048 5.2331 ms/op 5.1475 ms/op 1.02
bytes32 toHexString 918.00 ns/op 594.00 ns/op 1.55
bytes32 Buffer.toString(hex) 415.00 ns/op 308.00 ns/op 1.35
bytes32 Buffer.toString(hex) from Uint8Array 711.00 ns/op 433.00 ns/op 1.64
bytes32 Buffer.toString(hex) + 0x 421.00 ns/op 312.00 ns/op 1.35
Object access 1 prop 0.27400 ns/op 0.17900 ns/op 1.53
Map access 1 prop 0.24200 ns/op 0.16100 ns/op 1.50
Object get x1000 5.8070 ns/op 7.5710 ns/op 0.77
Map get x1000 0.93200 ns/op 0.81900 ns/op 1.14
Object set x1000 30.822 ns/op 55.818 ns/op 0.55
Map set x1000 21.345 ns/op 43.577 ns/op 0.49
Return object 10000 times 0.25580 ns/op 0.24480 ns/op 1.04
Throw Error 10000 times 3.5117 us/op 3.9267 us/op 0.89
fastMsgIdFn sha256 / 200 bytes 2.3890 us/op 3.3330 us/op 0.72
fastMsgIdFn h32 xxhash / 200 bytes 501.00 ns/op 321.00 ns/op 1.56
fastMsgIdFn h64 xxhash / 200 bytes 521.00 ns/op 375.00 ns/op 1.39
fastMsgIdFn sha256 / 1000 bytes 7.5390 us/op 11.565 us/op 0.65
fastMsgIdFn h32 xxhash / 1000 bytes 641.00 ns/op 464.00 ns/op 1.38
fastMsgIdFn h64 xxhash / 1000 bytes 703.00 ns/op 449.00 ns/op 1.57
fastMsgIdFn sha256 / 10000 bytes 60.470 us/op 104.07 us/op 0.58
fastMsgIdFn h32 xxhash / 10000 bytes 2.0340 us/op 1.9870 us/op 1.02
fastMsgIdFn h64 xxhash / 10000 bytes 1.5160 us/op 1.3880 us/op 1.09
send data - 1000 256B messages 18.781 ms/op 21.571 ms/op 0.87
send data - 1000 512B messages 15.524 ms/op 27.478 ms/op 0.56
send data - 1000 1024B messages 28.450 ms/op 44.634 ms/op 0.64
send data - 1000 1200B messages 38.189 ms/op 37.665 ms/op 1.01
send data - 1000 2048B messages 47.546 ms/op 45.750 ms/op 1.04
send data - 1000 4096B messages 37.337 ms/op 25.463 ms/op 1.47
send data - 1000 16384B messages 88.813 ms/op 105.33 ms/op 0.84
send data - 1000 65536B messages 466.76 ms/op 449.21 ms/op 1.04
enrSubnets - fastDeserialize 64 bits 1.0430 us/op 1.2970 us/op 0.80
enrSubnets - ssz BitVector 64 bits 494.00 ns/op 428.00 ns/op 1.15
enrSubnets - fastDeserialize 4 bits 267.00 ns/op 168.00 ns/op 1.59
enrSubnets - ssz BitVector 4 bits 493.00 ns/op 417.00 ns/op 1.18
prioritizePeers score -10:0 att 32-0.1 sync 2-0 77.752 us/op 100.97 us/op 0.77
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 106.14 us/op 143.78 us/op 0.74
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 154.95 us/op 192.85 us/op 0.80
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 262.95 us/op 338.25 us/op 0.78
prioritizePeers score 0:0 att 64-1 sync 4-1 303.35 us/op 371.42 us/op 0.82
array of 16000 items push then shift 1.3464 us/op 1.6295 us/op 0.83
LinkedList of 16000 items push then shift 8.5750 ns/op 8.9980 ns/op 0.95
array of 16000 items push then pop 101.98 ns/op 96.010 ns/op 1.06
LinkedList of 16000 items push then pop 6.1830 ns/op 8.5290 ns/op 0.72
array of 24000 items push then shift 1.9283 us/op 2.5381 us/op 0.76
LinkedList of 24000 items push then shift 7.8830 ns/op 8.9420 ns/op 0.88
array of 24000 items push then pop 139.26 ns/op 119.62 ns/op 1.16
LinkedList of 24000 items push then pop 6.2030 ns/op 8.5660 ns/op 0.72
intersect bitArray bitLen 8 5.1840 ns/op 5.7410 ns/op 0.90
intersect array and set length 8 55.976 ns/op 60.075 ns/op 0.93
intersect bitArray bitLen 128 31.347 ns/op 34.064 ns/op 0.92
intersect array and set length 128 719.37 ns/op 867.90 ns/op 0.83
bitArray.getTrueBitIndexes() bitLen 128 1.5540 us/op 1.6110 us/op 0.96
bitArray.getTrueBitIndexes() bitLen 248 2.5270 us/op 2.8630 us/op 0.88
bitArray.getTrueBitIndexes() bitLen 512 4.2210 us/op 5.0820 us/op 0.83
Buffer.concat 32 items 1.0030 us/op 1.0030 us/op 1.00
Uint8Array.set 32 items 1.8640 us/op 1.7380 us/op 1.07
Set add up to 64 items then delete first 1.9572 us/op 4.4463 us/op 0.44
OrderedSet add up to 64 items then delete first 2.7215 us/op 5.5699 us/op 0.49
Set add up to 64 items then delete last 2.4491 us/op 4.8303 us/op 0.51
OrderedSet add up to 64 items then delete last 4.2632 us/op 6.2230 us/op 0.69
Set add up to 64 items then delete middle 2.4931 us/op 4.6384 us/op 0.54
OrderedSet add up to 64 items then delete middle 5.2617 us/op 7.2445 us/op 0.73
Set add up to 128 items then delete first 5.3385 us/op 9.8545 us/op 0.54
OrderedSet add up to 128 items then delete first 8.0186 us/op 13.442 us/op 0.60
Set add up to 128 items then delete last 4.2348 us/op 9.6281 us/op 0.44
OrderedSet add up to 128 items then delete last 6.9500 us/op 11.895 us/op 0.58
Set add up to 128 items then delete middle 4.4543 us/op 9.3376 us/op 0.48
OrderedSet add up to 128 items then delete middle 13.069 us/op 17.104 us/op 0.76
Set add up to 256 items then delete first 8.3610 us/op 18.781 us/op 0.45
OrderedSet add up to 256 items then delete first 16.550 us/op 25.978 us/op 0.64
Set add up to 256 items then delete last 7.6126 us/op 19.221 us/op 0.40
OrderedSet add up to 256 items then delete last 12.160 us/op 23.155 us/op 0.53
Set add up to 256 items then delete middle 7.5072 us/op 18.829 us/op 0.40
OrderedSet add up to 256 items then delete middle 35.995 us/op 46.916 us/op 0.77
transfer serialized Status (84 B) 1.6150 us/op 1.6900 us/op 0.96
copy serialized Status (84 B) 1.3270 us/op 1.2790 us/op 1.04
transfer serialized SignedVoluntaryExit (112 B) 2.0430 us/op 1.9240 us/op 1.06
copy serialized SignedVoluntaryExit (112 B) 1.4780 us/op 1.4740 us/op 1.00
transfer serialized ProposerSlashing (416 B) 2.5370 us/op 1.9740 us/op 1.29
copy serialized ProposerSlashing (416 B) 3.4390 us/op 1.9680 us/op 1.75
transfer serialized Attestation (485 B) 3.3520 us/op 2.7810 us/op 1.21
copy serialized Attestation (485 B) 3.1500 us/op 1.9790 us/op 1.59
transfer serialized AttesterSlashing (33232 B) 3.6890 us/op 2.0870 us/op 1.77
copy serialized AttesterSlashing (33232 B) 10.556 us/op 7.2200 us/op 1.46
transfer serialized Small SignedBeaconBlock (128000 B) 3.5550 us/op 3.3580 us/op 1.06
copy serialized Small SignedBeaconBlock (128000 B) 27.539 us/op 19.035 us/op 1.45
transfer serialized Avg SignedBeaconBlock (200000 B) 4.5700 us/op 3.2320 us/op 1.41
copy serialized Avg SignedBeaconBlock (200000 B) 40.706 us/op 24.561 us/op 1.66
transfer serialized BlobsSidecar (524380 B) 4.3460 us/op 3.4530 us/op 1.26
copy serialized BlobsSidecar (524380 B) 161.76 us/op 102.81 us/op 1.57
transfer serialized Big SignedBeaconBlock (1000000 B) 3.9700 us/op 3.8580 us/op 1.03
copy serialized Big SignedBeaconBlock (1000000 B) 276.63 us/op 168.69 us/op 1.64
pass gossip attestations to forkchoice per slot 3.1199 ms/op 4.3173 ms/op 0.72
forkChoice updateHead vc 100000 bc 64 eq 0 499.18 us/op 715.62 us/op 0.70
forkChoice updateHead vc 600000 bc 64 eq 0 4.2812 ms/op 5.0178 ms/op 0.85
forkChoice updateHead vc 1000000 bc 64 eq 0 5.5366 ms/op 7.1896 ms/op 0.77
forkChoice updateHead vc 600000 bc 320 eq 0 3.1567 ms/op 4.3475 ms/op 0.73
forkChoice updateHead vc 600000 bc 1200 eq 0 3.5831 ms/op 4.6396 ms/op 0.77
forkChoice updateHead vc 600000 bc 7200 eq 0 4.3482 ms/op 5.4306 ms/op 0.80
forkChoice updateHead vc 600000 bc 64 eq 1000 11.557 ms/op 11.449 ms/op 1.01
forkChoice updateHead vc 600000 bc 64 eq 10000 10.812 ms/op 12.221 ms/op 0.88
forkChoice updateHead vc 600000 bc 64 eq 300000 21.094 ms/op 16.691 ms/op 1.26
computeDeltas 500000 validators 300 proto nodes 3.5895 ms/op 6.7785 ms/op 0.53
computeDeltas 500000 validators 1200 proto nodes 3.1423 ms/op 6.8662 ms/op 0.46
computeDeltas 500000 validators 7200 proto nodes 3.2233 ms/op 6.5255 ms/op 0.49
computeDeltas 750000 validators 300 proto nodes 4.9694 ms/op 9.8621 ms/op 0.50
computeDeltas 750000 validators 1200 proto nodes 5.0166 ms/op 9.9350 ms/op 0.50
computeDeltas 750000 validators 7200 proto nodes 5.4140 ms/op 10.390 ms/op 0.52
computeDeltas 1400000 validators 300 proto nodes 10.928 ms/op 20.013 ms/op 0.55
computeDeltas 1400000 validators 1200 proto nodes 10.475 ms/op 20.339 ms/op 0.52
computeDeltas 1400000 validators 7200 proto nodes 9.1912 ms/op 20.732 ms/op 0.44
computeDeltas 2100000 validators 300 proto nodes 14.144 ms/op 30.790 ms/op 0.46
computeDeltas 2100000 validators 1200 proto nodes 14.452 ms/op 29.483 ms/op 0.49
computeDeltas 2100000 validators 7200 proto nodes 16.217 ms/op 29.520 ms/op 0.55
altair processAttestation - 250000 vs - 7PWei normalcase 3.3209 ms/op 2.4745 ms/op 1.34
altair processAttestation - 250000 vs - 7PWei worstcase 4.3914 ms/op 3.3977 ms/op 1.29
altair processAttestation - setStatus - 1/6 committees join 112.20 us/op 194.33 us/op 0.58
altair processAttestation - setStatus - 1/3 committees join 199.19 us/op 381.16 us/op 0.52
altair processAttestation - setStatus - 1/2 committees join 302.45 us/op 490.48 us/op 0.62
altair processAttestation - setStatus - 2/3 committees join 392.47 us/op 611.96 us/op 0.64
altair processAttestation - setStatus - 4/5 committees join 516.70 us/op 871.79 us/op 0.59
altair processAttestation - setStatus - 100% committees join 609.01 us/op 978.89 us/op 0.62
altair processBlock - 250000 vs - 7PWei normalcase 7.5162 ms/op 8.7717 ms/op 0.86
altair processBlock - 250000 vs - 7PWei normalcase hashState 25.037 ms/op 35.961 ms/op 0.70
altair processBlock - 250000 vs - 7PWei worstcase 33.384 ms/op 47.877 ms/op 0.70
altair processBlock - 250000 vs - 7PWei worstcase hashState 78.832 ms/op 95.943 ms/op 0.82
phase0 processBlock - 250000 vs - 7PWei normalcase 1.9306 ms/op 2.7448 ms/op 0.70
phase0 processBlock - 250000 vs - 7PWei worstcase 26.547 ms/op 31.784 ms/op 0.84
altair processEth1Data - 250000 vs - 7PWei normalcase 337.38 us/op 494.76 us/op 0.68
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 10.833 us/op 13.911 us/op 0.78
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 53.477 us/op 47.913 us/op 1.12
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 11.431 us/op 18.359 us/op 0.62
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 11.986 us/op 15.890 us/op 0.75
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 199.26 us/op 243.84 us/op 0.82
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 979.37 us/op 1.3522 ms/op 0.72
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.1758 ms/op 1.7781 ms/op 0.66
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 962.20 us/op 1.7730 ms/op 0.54
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.9036 ms/op 3.2835 ms/op 0.88
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.6272 ms/op 2.8917 ms/op 0.56
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.4828 ms/op 5.4212 ms/op 0.83
Tree 40 250000 create 237.27 ms/op 369.11 ms/op 0.64
Tree 40 250000 get(125000) 115.53 ns/op 208.11 ns/op 0.56
Tree 40 250000 set(125000) 718.95 ns/op 1.0653 us/op 0.67
Tree 40 250000 toArray() 12.126 ms/op 24.575 ms/op 0.49
Tree 40 250000 iterate all - toArray() + loop 11.775 ms/op 26.735 ms/op 0.44
Tree 40 250000 iterate all - get(i) 40.635 ms/op 77.973 ms/op 0.52
MutableVector 250000 create 10.449 ms/op 17.607 ms/op 0.59
MutableVector 250000 get(125000) 6.3140 ns/op 6.7400 ns/op 0.94
MutableVector 250000 set(125000) 202.04 ns/op 528.49 ns/op 0.38
MutableVector 250000 toArray() 3.0203 ms/op 4.7756 ms/op 0.63
MutableVector 250000 iterate all - toArray() + loop 3.4522 ms/op 4.2648 ms/op 0.81
MutableVector 250000 iterate all - get(i) 1.3013 ms/op 1.5496 ms/op 0.84
Array 250000 create 2.6701 ms/op 3.8098 ms/op 0.70
Array 250000 clone - spread 1.1417 ms/op 1.4657 ms/op 0.78
Array 250000 get(125000) 1.2440 ns/op 1.8060 ns/op 0.69
Array 250000 set(125000) 1.2860 ns/op 5.7530 ns/op 0.22
Array 250000 iterate all - loop 154.63 us/op 173.65 us/op 0.89
effectiveBalanceIncrements clone Uint8Array 300000 26.568 us/op 56.900 us/op 0.47
effectiveBalanceIncrements clone MutableVector 300000 425.00 ns/op 444.00 ns/op 0.96
effectiveBalanceIncrements rw all Uint8Array 300000 185.29 us/op 209.71 us/op 0.88
effectiveBalanceIncrements rw all MutableVector 300000 72.149 ms/op 117.48 ms/op 0.61
phase0 afterProcessEpoch - 250000 vs - 7PWei 76.536 ms/op 116.87 ms/op 0.65
phase0 beforeProcessEpoch - 250000 vs - 7PWei 48.776 ms/op 51.862 ms/op 0.94
altair processEpoch - mainnet_e81889 487.05 ms/op 525.42 ms/op 0.93
mainnet_e81889 - altair beforeProcessEpoch 74.877 ms/op 97.397 ms/op 0.77
mainnet_e81889 - altair processJustificationAndFinalization 16.727 us/op 17.703 us/op 0.94
mainnet_e81889 - altair processInactivityUpdates 4.3032 ms/op 6.9630 ms/op 0.62
mainnet_e81889 - altair processRewardsAndPenalties 64.984 ms/op 74.450 ms/op 0.87
mainnet_e81889 - altair processRegistryUpdates 2.4810 us/op 4.0050 us/op 0.62
mainnet_e81889 - altair processSlashings 619.00 ns/op 539.00 ns/op 1.15
mainnet_e81889 - altair processEth1DataReset 868.00 ns/op 651.00 ns/op 1.33
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.0288 ms/op 1.4178 ms/op 0.73
mainnet_e81889 - altair processSlashingsReset 4.5720 us/op 3.5190 us/op 1.30
mainnet_e81889 - altair processRandaoMixesReset 4.5800 us/op 5.7510 us/op 0.80
mainnet_e81889 - altair processHistoricalRootsUpdate 954.00 ns/op 1.1230 us/op 0.85
mainnet_e81889 - altair processParticipationFlagUpdates 1.9720 us/op 2.4360 us/op 0.81
mainnet_e81889 - altair processSyncCommitteeUpdates 1.1610 us/op 669.00 ns/op 1.74
mainnet_e81889 - altair afterProcessEpoch 85.428 ms/op 124.20 ms/op 0.69
capella processEpoch - mainnet_e217614 2.0682 s/op 2.2937 s/op 0.90
mainnet_e217614 - capella beforeProcessEpoch 542.91 ms/op 511.93 ms/op 1.06
mainnet_e217614 - capella processJustificationAndFinalization 24.518 us/op 17.357 us/op 1.41
mainnet_e217614 - capella processInactivityUpdates 20.971 ms/op 23.704 ms/op 0.88
mainnet_e217614 - capella processRewardsAndPenalties 509.26 ms/op 602.62 ms/op 0.85
mainnet_e217614 - capella processRegistryUpdates 27.816 us/op 38.558 us/op 0.72
mainnet_e217614 - capella processSlashings 1.3240 us/op 1.1340 us/op 1.17
mainnet_e217614 - capella processEth1DataReset 747.00 ns/op 1.7680 us/op 0.42
mainnet_e217614 - capella processEffectiveBalanceUpdates 3.6094 ms/op 5.0577 ms/op 0.71
mainnet_e217614 - capella processSlashingsReset 5.1540 us/op 5.9320 us/op 0.87
mainnet_e217614 - capella processRandaoMixesReset 7.8670 us/op 5.6510 us/op 1.39
mainnet_e217614 - capella processHistoricalRootsUpdate 1.0740 us/op 1.0050 us/op 1.07
mainnet_e217614 - capella processParticipationFlagUpdates 2.7370 us/op 2.1810 us/op 1.25
mainnet_e217614 - capella afterProcessEpoch 219.17 ms/op 404.11 ms/op 0.54
phase0 processEpoch - mainnet_e58758 448.33 ms/op 549.37 ms/op 0.82
mainnet_e58758 - phase0 beforeProcessEpoch 147.26 ms/op 141.56 ms/op 1.04
mainnet_e58758 - phase0 processJustificationAndFinalization 24.009 us/op 18.539 us/op 1.30
mainnet_e58758 - phase0 processRewardsAndPenalties 56.703 ms/op 48.246 ms/op 1.18
mainnet_e58758 - phase0 processRegistryUpdates 13.281 us/op 12.212 us/op 1.09
mainnet_e58758 - phase0 processSlashings 614.00 ns/op 759.00 ns/op 0.81
mainnet_e58758 - phase0 processEth1DataReset 613.00 ns/op 846.00 ns/op 0.72
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 886.51 us/op 1.2134 ms/op 0.73
mainnet_e58758 - phase0 processSlashingsReset 3.0020 us/op 4.7670 us/op 0.63
mainnet_e58758 - phase0 processRandaoMixesReset 3.5430 us/op 5.9630 us/op 0.59
mainnet_e58758 - phase0 processHistoricalRootsUpdate 859.00 ns/op 703.00 ns/op 1.22
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.6120 us/op 4.3410 us/op 0.83
mainnet_e58758 - phase0 afterProcessEpoch 66.862 ms/op 104.30 ms/op 0.64
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.0916 ms/op 1.3524 ms/op 0.81
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.1256 ms/op 1.5484 ms/op 0.73
altair processInactivityUpdates - 250000 normalcase 25.944 ms/op 33.894 ms/op 0.77
altair processInactivityUpdates - 250000 worstcase 26.838 ms/op 34.717 ms/op 0.77
phase0 processRegistryUpdates - 250000 normalcase 9.1070 us/op 14.222 us/op 0.64
phase0 processRegistryUpdates - 250000 badcase_full_deposits 411.69 us/op 404.40 us/op 1.02
phase0 processRegistryUpdates - 250000 worstcase 0.5 132.92 ms/op 172.60 ms/op 0.77
altair processRewardsAndPenalties - 250000 normalcase 68.437 ms/op 83.652 ms/op 0.82
altair processRewardsAndPenalties - 250000 worstcase 50.667 ms/op 79.911 ms/op 0.63
phase0 getAttestationDeltas - 250000 normalcase 5.6034 ms/op 10.729 ms/op 0.52
phase0 getAttestationDeltas - 250000 worstcase 7.4904 ms/op 12.070 ms/op 0.62
phase0 processSlashings - 250000 worstcase 88.881 us/op 116.04 us/op 0.77
altair processSyncCommitteeUpdates - 250000 119.12 ms/op 169.29 ms/op 0.70
BeaconState.hashTreeRoot - No change 339.00 ns/op 674.00 ns/op 0.50
BeaconState.hashTreeRoot - 1 full validator 146.34 us/op 148.41 us/op 0.99
BeaconState.hashTreeRoot - 32 full validator 1.6282 ms/op 1.7343 ms/op 0.94
BeaconState.hashTreeRoot - 512 full validator 10.406 ms/op 22.923 ms/op 0.45
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 111.02 us/op 240.88 us/op 0.46
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.4442 ms/op 2.5162 ms/op 0.57
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 19.760 ms/op 33.428 ms/op 0.59
BeaconState.hashTreeRoot - 1 balances 89.566 us/op 144.32 us/op 0.62
BeaconState.hashTreeRoot - 32 balances 809.47 us/op 1.5551 ms/op 0.52
BeaconState.hashTreeRoot - 512 balances 6.9133 ms/op 15.880 ms/op 0.44
BeaconState.hashTreeRoot - 250000 balances 162.68 ms/op 220.23 ms/op 0.74
aggregationBits - 2048 els - zipIndexesInBitList 19.391 us/op 30.397 us/op 0.64
byteArrayEquals 32 65.948 ns/op 76.028 ns/op 0.87
Buffer.compare 32 38.607 ns/op 55.889 ns/op 0.69
byteArrayEquals 1024 1.8071 us/op 2.0765 us/op 0.87
Buffer.compare 1024 46.027 ns/op 71.254 ns/op 0.65
byteArrayEquals 16384 28.222 us/op 33.015 us/op 0.85
Buffer.compare 16384 235.84 ns/op 267.61 ns/op 0.88
byteArrayEquals 123687377 224.53 ms/op 250.18 ms/op 0.90
Buffer.compare 123687377 6.9495 ms/op 7.2844 ms/op 0.95
byteArrayEquals 32 - diff last byte 70.975 ns/op 72.920 ns/op 0.97
Buffer.compare 32 - diff last byte 42.934 ns/op 57.348 ns/op 0.75
byteArrayEquals 1024 - diff last byte 1.8150 us/op 2.0793 us/op 0.87
Buffer.compare 1024 - diff last byte 48.077 ns/op 73.793 ns/op 0.65
byteArrayEquals 16384 - diff last byte 28.868 us/op 32.791 us/op 0.88
Buffer.compare 16384 - diff last byte 263.21 ns/op 269.07 ns/op 0.98
byteArrayEquals 123687377 - diff last byte 226.21 ms/op 262.72 ms/op 0.86
Buffer.compare 123687377 - diff last byte 8.5888 ms/op 9.5225 ms/op 0.90
byteArrayEquals 32 - random bytes 6.2780 ns/op 6.5280 ns/op 0.96
Buffer.compare 32 - random bytes 43.511 ns/op 63.029 ns/op 0.69
byteArrayEquals 1024 - random bytes 6.1130 ns/op 6.7140 ns/op 0.91
Buffer.compare 1024 - random bytes 41.658 ns/op 64.714 ns/op 0.64
byteArrayEquals 16384 - random bytes 5.7570 ns/op 6.7560 ns/op 0.85
Buffer.compare 16384 - random bytes 40.357 ns/op 64.585 ns/op 0.62
byteArrayEquals 123687377 - random bytes 16.860 ns/op 12.290 ns/op 1.37
Buffer.compare 123687377 - random bytes 54.250 ns/op 78.280 ns/op 0.69
regular array get 100000 times 47.318 us/op 47.978 us/op 0.99
wrappedArray get 100000 times 44.070 us/op 47.320 us/op 0.93
arrayWithProxy get 100000 times 10.903 ms/op 15.131 ms/op 0.72
ssz.Root.equals 57.237 ns/op 57.365 ns/op 1.00
byteArrayEquals 57.779 ns/op 55.515 ns/op 1.04
Buffer.compare 11.000 ns/op 12.490 ns/op 0.88
shuffle list - 16384 els 6.3293 ms/op 9.3073 ms/op 0.68
shuffle list - 250000 els 93.026 ms/op 136.83 ms/op 0.68
processSlot - 1 slots 19.181 us/op 19.877 us/op 0.96
processSlot - 32 slots 3.7522 ms/op 3.6167 ms/op 1.04
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 65.953 ms/op 63.741 ms/op 1.03
getCommitteeAssignments - req 1 vs - 250000 vc 2.6123 ms/op 2.7890 ms/op 0.94
getCommitteeAssignments - req 100 vs - 250000 vc 3.7610 ms/op 4.0366 ms/op 0.93
getCommitteeAssignments - req 1000 vs - 250000 vc 3.9894 ms/op 4.4190 ms/op 0.90
findModifiedValidators - 10000 modified validators 391.71 ms/op 387.63 ms/op 1.01
findModifiedValidators - 1000 modified validators 197.71 ms/op 233.15 ms/op 0.85
findModifiedValidators - 100 modified validators 176.23 ms/op 210.04 ms/op 0.84
findModifiedValidators - 10 modified validators 199.53 ms/op 232.89 ms/op 0.86
findModifiedValidators - 1 modified validators 171.00 ms/op 215.68 ms/op 0.79
findModifiedValidators - no difference 206.38 ms/op 313.93 ms/op 0.66
compare ViewDUs 4.9471 s/op 4.9613 s/op 1.00
compare each validator Uint8Array 1.5549 s/op 1.8057 s/op 0.86
compare ViewDU to Uint8Array 1.0752 s/op 1.4496 s/op 0.74
migrate state 1000000 validators, 24 modified, 0 new 808.91 ms/op 821.38 ms/op 0.98
migrate state 1000000 validators, 1700 modified, 1000 new 1.0110 s/op 1.1055 s/op 0.91
migrate state 1000000 validators, 3400 modified, 2000 new 1.0910 s/op 1.3048 s/op 0.84
migrate state 1500000 validators, 24 modified, 0 new 674.44 ms/op 752.09 ms/op 0.90
migrate state 1500000 validators, 1700 modified, 1000 new 960.98 ms/op 1.0388 s/op 0.93
migrate state 1500000 validators, 3400 modified, 2000 new 1.1750 s/op 1.2635 s/op 0.93
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.3200 ns/op 4.2900 ns/op 1.01
state getBlockRootAtSlot - 250000 vs - 7PWei 571.74 ns/op 867.42 ns/op 0.66
computeProposers - vc 250000 6.0606 ms/op 9.6279 ms/op 0.63
computeEpochShuffling - vc 250000 84.446 ms/op 127.56 ms/op 0.66
getNextSyncCommittee - vc 250000 126.41 ms/op 164.83 ms/op 0.77
computeSigningRoot for AttestationData 26.784 us/op 24.798 us/op 1.08
hash AttestationData serialized data then Buffer.toString(base64) 1.2530 us/op 2.3016 us/op 0.54
toHexString serialized data 859.98 ns/op 1.0486 us/op 0.82
Buffer.toString(base64) 159.28 ns/op 208.46 ns/op 0.76

by benchmarkbot/action

@nflaig nflaig changed the title refactor: move syncing logic to helper functions test: move syncing logic to helper functions Apr 5, 2024
Copy link
Member

@matthewkeil matthewkeil left a comment

Choose a reason for hiding this comment

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

LGTM!! 🚀

@nazarhussain nazarhussain merged commit 91801fa into unstable Apr 5, 2024
21 of 22 checks passed
@nazarhussain nazarhussain deleted the nh/sim-refactor-1 branch April 5, 2024 14:31
@wemeetagain
Copy link
Member

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