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: correct subscribedToCoreTopics flag #5715

Merged
merged 1 commit into from
Jun 27, 2023

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Jun 27, 2023

Motivation

See #5709

Description

Set the flag to false after the unsubscription

Closes #5709

@twoeths twoeths requested a review from a team as a code owner June 27, 2023 09:05
@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: f5f3f62 Previous: 00877ee Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 595.64 us/op 879.30 us/op 0.68
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 58.686 us/op 49.170 us/op 1.19
BLS verify - blst-native 1.2327 ms/op 1.2939 ms/op 0.95
BLS verifyMultipleSignatures 3 - blst-native 2.5234 ms/op 2.6465 ms/op 0.95
BLS verifyMultipleSignatures 8 - blst-native 5.4349 ms/op 5.7218 ms/op 0.95
BLS verifyMultipleSignatures 32 - blst-native 19.731 ms/op 20.510 ms/op 0.96
BLS aggregatePubkeys 32 - blst-native 26.270 us/op 27.357 us/op 0.96
BLS aggregatePubkeys 128 - blst-native 101.63 us/op 106.22 us/op 0.96
getAttestationsForBlock 62.560 ms/op 65.826 ms/op 0.95
isKnown best case - 1 super set check 270.00 ns/op 271.00 ns/op 1.00
isKnown normal case - 2 super set checks 272.00 ns/op 262.00 ns/op 1.04
isKnown worse case - 16 super set checks 259.00 ns/op 259.00 ns/op 1.00
CheckpointStateCache - add get delete 5.7930 us/op 5.6960 us/op 1.02
validate gossip signedAggregateAndProof - struct 2.8024 ms/op 2.9246 ms/op 0.96
validate gossip attestation - struct 1.3357 ms/op 1.3874 ms/op 0.96
pickEth1Vote - no votes 1.4790 ms/op 1.3520 ms/op 1.09
pickEth1Vote - max votes 12.386 ms/op 11.524 ms/op 1.07
pickEth1Vote - Eth1Data hashTreeRoot value x2048 10.013 ms/op 9.1975 ms/op 1.09
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 17.348 ms/op 17.913 ms/op 0.97
pickEth1Vote - Eth1Data fastSerialize value x2048 845.87 us/op 698.90 us/op 1.21
pickEth1Vote - Eth1Data fastSerialize tree x2048 7.4803 ms/op 4.8236 ms/op 1.55
bytes32 toHexString 729.00 ns/op 515.00 ns/op 1.42
bytes32 Buffer.toString(hex) 418.00 ns/op 386.00 ns/op 1.08
bytes32 Buffer.toString(hex) from Uint8Array 596.00 ns/op 577.00 ns/op 1.03
bytes32 Buffer.toString(hex) + 0x 407.00 ns/op 369.00 ns/op 1.10
Object access 1 prop 0.20800 ns/op 0.17700 ns/op 1.18
Map access 1 prop 0.16700 ns/op 0.17000 ns/op 0.98
Object get x1000 7.0860 ns/op 6.7890 ns/op 1.04
Map get x1000 0.63200 ns/op 0.65700 ns/op 0.96
Object set x1000 75.096 ns/op 55.773 ns/op 1.35
Map set x1000 58.720 ns/op 45.140 ns/op 1.30
Return object 10000 times 0.27340 ns/op 0.24750 ns/op 1.10
Throw Error 10000 times 4.4023 us/op 4.4315 us/op 0.99
fastMsgIdFn sha256 / 200 bytes 3.7800 us/op 3.6520 us/op 1.04
fastMsgIdFn h32 xxhash / 200 bytes 339.00 ns/op 298.00 ns/op 1.14
fastMsgIdFn h64 xxhash / 200 bytes 480.00 ns/op 440.00 ns/op 1.09
fastMsgIdFn sha256 / 1000 bytes 12.071 us/op 12.109 us/op 1.00
fastMsgIdFn h32 xxhash / 1000 bytes 467.00 ns/op 437.00 ns/op 1.07
fastMsgIdFn h64 xxhash / 1000 bytes 608.00 ns/op 495.00 ns/op 1.23
fastMsgIdFn sha256 / 10000 bytes 107.50 us/op 108.16 us/op 0.99
fastMsgIdFn h32 xxhash / 10000 bytes 2.0830 us/op 2.0080 us/op 1.04
fastMsgIdFn h64 xxhash / 10000 bytes 1.4860 us/op 1.4520 us/op 1.02
enrSubnets - fastDeserialize 64 bits 1.8710 us/op 1.3810 us/op 1.35
enrSubnets - ssz BitVector 64 bits 661.00 ns/op 529.00 ns/op 1.25
enrSubnets - fastDeserialize 4 bits 215.00 ns/op 186.00 ns/op 1.16
enrSubnets - ssz BitVector 4 bits 633.00 ns/op 541.00 ns/op 1.17
prioritizePeers score -10:0 att 32-0.1 sync 2-0 116.15 us/op 97.275 us/op 1.19
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 162.41 us/op 148.71 us/op 1.09
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 199.40 us/op 191.34 us/op 1.04
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 386.12 us/op 339.30 us/op 1.14
prioritizePeers score 0:0 att 64-1 sync 4-1 448.05 us/op 413.11 us/op 1.08
array of 16000 items push then shift 1.7092 us/op 1.6968 us/op 1.01
LinkedList of 16000 items push then shift 9.2680 ns/op 9.6110 ns/op 0.96
array of 16000 items push then pop 119.14 ns/op 97.315 ns/op 1.22
LinkedList of 16000 items push then pop 8.8340 ns/op 8.9260 ns/op 0.99
array of 24000 items push then shift 2.3967 us/op 2.5020 us/op 0.96
LinkedList of 24000 items push then shift 9.0550 ns/op 10.922 ns/op 0.83
array of 24000 items push then pop 85.708 ns/op 92.037 ns/op 0.93
LinkedList of 24000 items push then pop 8.9830 ns/op 9.6220 ns/op 0.93
intersect bitArray bitLen 8 13.496 ns/op 13.754 ns/op 0.98
intersect array and set length 8 85.395 ns/op 78.756 ns/op 1.08
intersect bitArray bitLen 128 44.899 ns/op 44.660 ns/op 1.01
intersect array and set length 128 1.2211 us/op 1.1958 us/op 1.02
Buffer.concat 32 items 3.0140 us/op 2.8370 us/op 1.06
Uint8Array.set 32 items 2.2170 us/op 2.4730 us/op 0.90
transfer serialized Status (84 B) 2.0440 us/op 2.2390 us/op 0.91
copy serialized Status (84 B) 1.7160 us/op 1.8380 us/op 0.93
transfer serialized SignedVoluntaryExit (112 B) 2.1430 us/op 2.2270 us/op 0.96
copy serialized SignedVoluntaryExit (112 B) 1.7690 us/op 1.7550 us/op 1.01
transfer serialized ProposerSlashing (416 B) 2.4390 us/op 2.9600 us/op 0.82
copy serialized ProposerSlashing (416 B) 2.6500 us/op 2.9630 us/op 0.89
transfer serialized Attestation (485 B) 3.1530 us/op 2.9640 us/op 1.06
copy serialized Attestation (485 B) 2.5880 us/op 3.0870 us/op 0.84
transfer serialized AttesterSlashing (33232 B) 2.5420 us/op 3.1390 us/op 0.81
copy serialized AttesterSlashing (33232 B) 7.2210 us/op 5.9630 us/op 1.21
transfer serialized Small SignedBeaconBlock (128000 B) 2.7660 us/op 3.0470 us/op 0.91
copy serialized Small SignedBeaconBlock (128000 B) 22.164 us/op 15.478 us/op 1.43
transfer serialized Avg SignedBeaconBlock (200000 B) 3.2480 us/op 3.3050 us/op 0.98
copy serialized Avg SignedBeaconBlock (200000 B) 32.655 us/op 21.197 us/op 1.54
transfer serialized BlobsSidecar (524380 B) 3.5820 us/op 3.2370 us/op 1.11
copy serialized BlobsSidecar (524380 B) 206.18 us/op 182.34 us/op 1.13
transfer serialized Big SignedBeaconBlock (1000000 B) 4.0110 us/op 3.3660 us/op 1.19
copy serialized Big SignedBeaconBlock (1000000 B) 330.03 us/op 245.68 us/op 1.34
pass gossip attestations to forkchoice per slot 2.8936 ms/op 2.7988 ms/op 1.03
forkChoice updateHead vc 100000 bc 64 eq 0 2.0626 ms/op 2.1837 ms/op 0.94
forkChoice updateHead vc 600000 bc 64 eq 0 11.607 ms/op 11.552 ms/op 1.00
forkChoice updateHead vc 1000000 bc 64 eq 0 21.953 ms/op 21.423 ms/op 1.02
forkChoice updateHead vc 600000 bc 320 eq 0 16.550 ms/op 17.271 ms/op 0.96
forkChoice updateHead vc 600000 bc 1200 eq 0 79.875 ms/op 83.833 ms/op 0.95
forkChoice updateHead vc 600000 bc 64 eq 1000 20.713 ms/op 21.593 ms/op 0.96
forkChoice updateHead vc 600000 bc 64 eq 10000 22.986 ms/op 23.108 ms/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 300000 31.841 ms/op 31.933 ms/op 1.00
computeDeltas 3.1082 ms/op 4.1604 ms/op 0.75
computeProposerBoostScoreFromBalances 1.7982 ms/op 1.8376 ms/op 0.98
altair processAttestation - 250000 vs - 7PWei normalcase 2.8408 ms/op 2.3838 ms/op 1.19
altair processAttestation - 250000 vs - 7PWei worstcase 4.4816 ms/op 3.4827 ms/op 1.29
altair processAttestation - setStatus - 1/6 committees join 143.20 us/op 146.03 us/op 0.98
altair processAttestation - setStatus - 1/3 committees join 287.51 us/op 289.31 us/op 0.99
altair processAttestation - setStatus - 1/2 committees join 380.94 us/op 386.03 us/op 0.99
altair processAttestation - setStatus - 2/3 committees join 490.51 us/op 483.77 us/op 1.01
altair processAttestation - setStatus - 4/5 committees join 691.94 us/op 695.56 us/op 0.99
altair processAttestation - setStatus - 100% committees join 806.58 us/op 805.61 us/op 1.00
altair processBlock - 250000 vs - 7PWei normalcase 17.333 ms/op 18.211 ms/op 0.95
altair processBlock - 250000 vs - 7PWei normalcase hashState 26.006 ms/op 30.284 ms/op 0.86
altair processBlock - 250000 vs - 7PWei worstcase 55.137 ms/op 55.140 ms/op 1.00
altair processBlock - 250000 vs - 7PWei worstcase hashState 70.045 ms/op 87.302 ms/op 0.80
phase0 processBlock - 250000 vs - 7PWei normalcase 2.3634 ms/op 2.0565 ms/op 1.15
phase0 processBlock - 250000 vs - 7PWei worstcase 31.349 ms/op 29.755 ms/op 1.05
altair processEth1Data - 250000 vs - 7PWei normalcase 570.91 us/op 477.44 us/op 1.20
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 8.0060 us/op 9.1170 us/op 0.88
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 24.888 us/op 33.962 us/op 0.73
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 10.129 us/op 8.4770 us/op 1.19
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 12.871 us/op 6.4360 us/op 2.00
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 96.418 us/op 78.008 us/op 1.24
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 683.97 us/op 1.1617 ms/op 0.59
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 903.78 us/op 904.41 us/op 1.00
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 864.84 us/op 1.5993 ms/op 0.54
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.3863 ms/op 2.3633 ms/op 1.01
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.7580 ms/op 1.7824 ms/op 0.99
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.4111 ms/op 4.0175 ms/op 1.10
Tree 40 250000 create 331.06 ms/op 331.74 ms/op 1.00
Tree 40 250000 get(125000) 194.18 ns/op 196.93 ns/op 0.99
Tree 40 250000 set(125000) 967.77 ns/op 1.0196 us/op 0.95
Tree 40 250000 toArray() 19.350 ms/op 21.082 ms/op 0.92
Tree 40 250000 iterate all - toArray() + loop 23.571 ms/op 21.474 ms/op 1.10
Tree 40 250000 iterate all - get(i) 73.914 ms/op 74.856 ms/op 0.99
MutableVector 250000 create 11.235 ms/op 13.914 ms/op 0.81
MutableVector 250000 get(125000) 6.5570 ns/op 6.7870 ns/op 0.97
MutableVector 250000 set(125000) 283.32 ns/op 262.35 ns/op 1.08
MutableVector 250000 toArray() 3.6901 ms/op 3.0607 ms/op 1.21
MutableVector 250000 iterate all - toArray() + loop 4.2874 ms/op 3.4133 ms/op 1.26
MutableVector 250000 iterate all - get(i) 1.5433 ms/op 1.6087 ms/op 0.96
Array 250000 create 3.1015 ms/op 2.9831 ms/op 1.04
Array 250000 clone - spread 1.1564 ms/op 1.1706 ms/op 0.99
Array 250000 get(125000) 0.55800 ns/op 0.59300 ns/op 0.94
Array 250000 set(125000) 0.62700 ns/op 0.63400 ns/op 0.99
Array 250000 iterate all - loop 85.093 us/op 108.35 us/op 0.79
effectiveBalanceIncrements clone Uint8Array 300000 40.980 us/op 28.340 us/op 1.45
effectiveBalanceIncrements clone MutableVector 300000 339.00 ns/op 353.00 ns/op 0.96
effectiveBalanceIncrements rw all Uint8Array 300000 171.94 us/op 172.77 us/op 1.00
effectiveBalanceIncrements rw all MutableVector 300000 83.676 ms/op 82.069 ms/op 1.02
phase0 afterProcessEpoch - 250000 vs - 7PWei 115.39 ms/op 118.83 ms/op 0.97
phase0 beforeProcessEpoch - 250000 vs - 7PWei 42.688 ms/op 44.518 ms/op 0.96
altair processEpoch - mainnet_e81889 315.97 ms/op 370.02 ms/op 0.85
mainnet_e81889 - altair beforeProcessEpoch 55.642 ms/op 71.608 ms/op 0.78
mainnet_e81889 - altair processJustificationAndFinalization 16.972 us/op 21.745 us/op 0.78
mainnet_e81889 - altair processInactivityUpdates 5.9579 ms/op 8.0515 ms/op 0.74
mainnet_e81889 - altair processRewardsAndPenalties 71.841 ms/op 75.748 ms/op 0.95
mainnet_e81889 - altair processRegistryUpdates 2.4730 us/op 3.7600 us/op 0.66
mainnet_e81889 - altair processSlashings 680.00 ns/op 901.00 ns/op 0.75
mainnet_e81889 - altair processEth1DataReset 615.00 ns/op 883.00 ns/op 0.70
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2557 ms/op 1.5486 ms/op 0.81
mainnet_e81889 - altair processSlashingsReset 6.2340 us/op 5.5940 us/op 1.11
mainnet_e81889 - altair processRandaoMixesReset 4.8230 us/op 8.7260 us/op 0.55
mainnet_e81889 - altair processHistoricalRootsUpdate 772.00 ns/op 2.3300 us/op 0.33
mainnet_e81889 - altair processParticipationFlagUpdates 2.6090 us/op 4.2150 us/op 0.62
mainnet_e81889 - altair processSyncCommitteeUpdates 3.0020 us/op 1.2550 us/op 2.39
mainnet_e81889 - altair afterProcessEpoch 129.88 ms/op 132.50 ms/op 0.98
phase0 processEpoch - mainnet_e58758 377.71 ms/op 388.80 ms/op 0.97
mainnet_e58758 - phase0 beforeProcessEpoch 147.28 ms/op 160.07 ms/op 0.92
mainnet_e58758 - phase0 processJustificationAndFinalization 26.010 us/op 28.274 us/op 0.92
mainnet_e58758 - phase0 processRewardsAndPenalties 65.444 ms/op 75.436 ms/op 0.87
mainnet_e58758 - phase0 processRegistryUpdates 9.2000 us/op 14.593 us/op 0.63
mainnet_e58758 - phase0 processSlashings 557.00 ns/op 894.00 ns/op 0.62
mainnet_e58758 - phase0 processEth1DataReset 620.00 ns/op 791.00 ns/op 0.78
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.0428 ms/op 1.9336 ms/op 0.54
mainnet_e58758 - phase0 processSlashingsReset 4.4600 us/op 7.1190 us/op 0.63
mainnet_e58758 - phase0 processRandaoMixesReset 4.4090 us/op 8.1190 us/op 0.54
mainnet_e58758 - phase0 processHistoricalRootsUpdate 674.00 ns/op 1.2050 us/op 0.56
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.7050 us/op 6.8700 us/op 0.68
mainnet_e58758 - phase0 afterProcessEpoch 100.86 ms/op 102.45 ms/op 0.98
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2772 ms/op 1.6489 ms/op 0.77
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.5575 ms/op 1.9258 ms/op 0.81
altair processInactivityUpdates - 250000 normalcase 25.947 ms/op 26.027 ms/op 1.00
altair processInactivityUpdates - 250000 worstcase 27.871 ms/op 29.828 ms/op 0.93
phase0 processRegistryUpdates - 250000 normalcase 7.5730 us/op 12.295 us/op 0.62
phase0 processRegistryUpdates - 250000 badcase_full_deposits 264.95 us/op 311.49 us/op 0.85
phase0 processRegistryUpdates - 250000 worstcase 0.5 106.19 ms/op 154.77 ms/op 0.69
altair processRewardsAndPenalties - 250000 normalcase 65.513 ms/op 76.495 ms/op 0.86
altair processRewardsAndPenalties - 250000 worstcase 68.932 ms/op 75.510 ms/op 0.91
phase0 getAttestationDeltas - 250000 normalcase 6.4952 ms/op 7.3389 ms/op 0.89
phase0 getAttestationDeltas - 250000 worstcase 6.4469 ms/op 9.1034 ms/op 0.71
phase0 processSlashings - 250000 worstcase 3.5217 ms/op 3.7339 ms/op 0.94
altair processSyncCommitteeUpdates - 250000 167.18 ms/op 194.41 ms/op 0.86
BeaconState.hashTreeRoot - No change 246.00 ns/op 353.00 ns/op 0.70
BeaconState.hashTreeRoot - 1 full validator 51.577 us/op 59.429 us/op 0.87
BeaconState.hashTreeRoot - 32 full validator 531.56 us/op 568.38 us/op 0.94
BeaconState.hashTreeRoot - 512 full validator 5.0702 ms/op 6.5437 ms/op 0.77
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 62.546 us/op 70.565 us/op 0.89
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 854.00 us/op 1.0065 ms/op 0.85
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 10.912 ms/op 12.726 ms/op 0.86
BeaconState.hashTreeRoot - 1 balances 47.763 us/op 58.342 us/op 0.82
BeaconState.hashTreeRoot - 32 balances 437.48 us/op 537.03 us/op 0.81
BeaconState.hashTreeRoot - 512 balances 4.1584 ms/op 5.3667 ms/op 0.77
BeaconState.hashTreeRoot - 250000 balances 80.223 ms/op 87.226 ms/op 0.92
aggregationBits - 2048 els - zipIndexesInBitList 15.110 us/op 24.273 us/op 0.62
regular array get 100000 times 32.241 us/op 36.964 us/op 0.87
wrappedArray get 100000 times 32.229 us/op 46.048 us/op 0.70
arrayWithProxy get 100000 times 16.020 ms/op 16.631 ms/op 0.96
ssz.Root.equals 547.00 ns/op 624.00 ns/op 0.88
byteArrayEquals 534.00 ns/op 621.00 ns/op 0.86
shuffle list - 16384 els 6.6813 ms/op 7.7135 ms/op 0.87
shuffle list - 250000 els 98.055 ms/op 109.68 ms/op 0.89
processSlot - 1 slots 8.5950 us/op 10.776 us/op 0.80
processSlot - 32 slots 1.2605 ms/op 1.7822 ms/op 0.71
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 36.150 ms/op 45.000 ms/op 0.80
getCommitteeAssignments - req 1 vs - 250000 vc 2.8695 ms/op 3.1966 ms/op 0.90
getCommitteeAssignments - req 100 vs - 250000 vc 4.2147 ms/op 4.6284 ms/op 0.91
getCommitteeAssignments - req 1000 vs - 250000 vc 4.5478 ms/op 5.1554 ms/op 0.88
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.8800 ns/op 5.5400 ns/op 0.88
state getBlockRootAtSlot - 250000 vs - 7PWei 576.02 ns/op 859.08 ns/op 0.67
computeProposers - vc 250000 10.726 ms/op 12.549 ms/op 0.85
computeEpochShuffling - vc 250000 110.35 ms/op 122.97 ms/op 0.90
getNextSyncCommittee - vc 250000 183.42 ms/op 210.34 ms/op 0.87
computeSigningRoot for AttestationData 13.520 us/op 16.493 us/op 0.82
hash AttestationData serialized data then Buffer.toString(base64) 2.5989 us/op 2.8748 us/op 0.90
toHexString serialized data 1.1788 us/op 1.7098 us/op 0.69
Buffer.toString(base64) 354.04 ns/op 402.06 ns/op 0.88

by benchmarkbot/action

@wemeetagain wemeetagain merged commit 158d8d9 into unstable Jun 27, 2023
@wemeetagain wemeetagain deleted the tuyen/subscribedToCoreTopics_flag branch June 27, 2023 12:22
@philknows philknows added this to the v1.9.1 milestone Jun 28, 2023
@philknows philknows mentioned this pull request Jun 28, 2023
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.9.1 🎉

@wemeetagain
Copy link
Member

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

[v1.9.0] Lodestar unsubscribe gossip core topics multiple times
3 participants