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: fix max responses that can be received by blobs side car by range #5681

Merged
merged 1 commit into from
Jun 22, 2023

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Jun 22, 2023

After quite a decent amount of debugging where lodestar would stall syncing via beacon blocks may be blobs by range on devnet6 from almost all clients on a particular epoch, it was figured out that the other clients were properly sending the response.

So it became apparent that lodestar was chunking out some of the blob data. This PR fixes the same as count in the blob side cars by range is count of slots for which blob data is requested.

@g11tech g11tech requested a review from a team as a code owner June 22, 2023 12:10
@g11tech g11tech enabled auto-merge (squash) June 22, 2023 12:11
@github-actions
Copy link
Contributor

github-actions bot commented Jun 22, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: c7a4243 Previous: c042a0b Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 527.47 us/op 818.93 us/op 0.64
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 47.562 us/op 43.584 us/op 1.09
BLS verify - blst-native 1.2142 ms/op 1.1977 ms/op 1.01
BLS verifyMultipleSignatures 3 - blst-native 2.4642 ms/op 2.4334 ms/op 1.01
BLS verifyMultipleSignatures 8 - blst-native 5.3096 ms/op 5.2270 ms/op 1.02
BLS verifyMultipleSignatures 32 - blst-native 19.189 ms/op 18.257 ms/op 1.05
BLS aggregatePubkeys 32 - blst-native 25.857 us/op 24.345 us/op 1.06
BLS aggregatePubkeys 128 - blst-native 100.64 us/op 94.588 us/op 1.06
getAttestationsForBlock 71.472 ms/op 51.011 ms/op 1.40
isKnown best case - 1 super set check 304.00 ns/op 252.00 ns/op 1.21
isKnown normal case - 2 super set checks 275.00 ns/op 245.00 ns/op 1.12
isKnown worse case - 16 super set checks 275.00 ns/op 243.00 ns/op 1.13
CheckpointStateCache - add get delete 5.2330 us/op 4.8800 us/op 1.07
validate gossip signedAggregateAndProof - struct 2.8081 ms/op 2.8031 ms/op 1.00
validate gossip attestation - struct 1.3195 ms/op 1.2539 ms/op 1.05
pickEth1Vote - no votes 1.3301 ms/op 1.2375 ms/op 1.07
pickEth1Vote - max votes 11.786 ms/op 9.6204 ms/op 1.23
pickEth1Vote - Eth1Data hashTreeRoot value x2048 9.0887 ms/op 8.5676 ms/op 1.06
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 15.448 ms/op 14.165 ms/op 1.09
pickEth1Vote - Eth1Data fastSerialize value x2048 778.06 us/op 667.97 us/op 1.16
pickEth1Vote - Eth1Data fastSerialize tree x2048 7.3812 ms/op 6.5241 ms/op 1.13
bytes32 toHexString 619.00 ns/op 467.00 ns/op 1.33
bytes32 Buffer.toString(hex) 445.00 ns/op 323.00 ns/op 1.38
bytes32 Buffer.toString(hex) from Uint8Array 605.00 ns/op 514.00 ns/op 1.18
bytes32 Buffer.toString(hex) + 0x 418.00 ns/op 329.00 ns/op 1.27
Object access 1 prop 0.20200 ns/op 0.15100 ns/op 1.34
Map access 1 prop 0.16700 ns/op 0.14800 ns/op 1.13
Object get x1000 6.8040 ns/op 6.8210 ns/op 1.00
Map get x1000 0.69600 ns/op 0.56800 ns/op 1.23
Object set x1000 81.295 ns/op 48.130 ns/op 1.69
Map set x1000 60.253 ns/op 40.964 ns/op 1.47
Return object 10000 times 0.24390 ns/op 0.22240 ns/op 1.10
Throw Error 10000 times 4.3606 us/op 3.9669 us/op 1.10
fastMsgIdFn sha256 / 200 bytes 3.8230 us/op 3.2210 us/op 1.19
fastMsgIdFn h32 xxhash / 200 bytes 324.00 ns/op 261.00 ns/op 1.24
fastMsgIdFn h64 xxhash / 200 bytes 500.00 ns/op 369.00 ns/op 1.36
fastMsgIdFn sha256 / 1000 bytes 11.835 us/op 10.911 us/op 1.08
fastMsgIdFn h32 xxhash / 1000 bytes 427.00 ns/op 379.00 ns/op 1.13
fastMsgIdFn h64 xxhash / 1000 bytes 543.00 ns/op 432.00 ns/op 1.26
fastMsgIdFn sha256 / 10000 bytes 106.14 us/op 97.838 us/op 1.08
fastMsgIdFn h32 xxhash / 10000 bytes 1.9950 us/op 1.8260 us/op 1.09
fastMsgIdFn h64 xxhash / 10000 bytes 1.4270 us/op 1.3050 us/op 1.09
enrSubnets - fastDeserialize 64 bits 1.5670 us/op 1.2040 us/op 1.30
enrSubnets - ssz BitVector 64 bits 820.00 ns/op 469.00 ns/op 1.75
enrSubnets - fastDeserialize 4 bits 234.00 ns/op 156.00 ns/op 1.50
enrSubnets - ssz BitVector 4 bits 690.00 ns/op 466.00 ns/op 1.48
prioritizePeers score -10:0 att 32-0.1 sync 2-0 149.51 us/op 99.142 us/op 1.51
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 182.77 us/op 126.00 us/op 1.45
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 210.57 us/op 162.37 us/op 1.30
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 341.99 us/op 289.33 us/op 1.18
prioritizePeers score 0:0 att 64-1 sync 4-1 441.78 us/op 343.85 us/op 1.28
array of 16000 items push then shift 1.6409 us/op 1.5472 us/op 1.06
LinkedList of 16000 items push then shift 9.0250 ns/op 8.3460 ns/op 1.08
array of 16000 items push then pop 88.609 ns/op 82.288 ns/op 1.08
LinkedList of 16000 items push then pop 8.7460 ns/op 8.1920 ns/op 1.07
array of 24000 items push then shift 2.4627 us/op 2.3282 us/op 1.06
LinkedList of 24000 items push then shift 8.9510 ns/op 8.5660 ns/op 1.04
array of 24000 items push then pop 89.264 ns/op 73.598 ns/op 1.21
LinkedList of 24000 items push then pop 8.7360 ns/op 7.9890 ns/op 1.09
intersect bitArray bitLen 8 13.407 ns/op 12.617 ns/op 1.06
intersect array and set length 8 93.991 ns/op 73.919 ns/op 1.27
intersect bitArray bitLen 128 44.486 ns/op 41.713 ns/op 1.07
intersect array and set length 128 1.2362 us/op 1.0007 us/op 1.24
Buffer.concat 32 items 3.0470 us/op 2.7830 us/op 1.09
Uint8Array.set 32 items 2.9800 us/op 2.5540 us/op 1.17
transfer serialized Status (84 B) 2.2610 us/op 1.9880 us/op 1.14
copy serialized Status (84 B) 1.7550 us/op 1.6640 us/op 1.05
transfer serialized SignedVoluntaryExit (112 B) 2.1490 us/op 2.0370 us/op 1.05
copy serialized SignedVoluntaryExit (112 B) 1.7290 us/op 1.7160 us/op 1.01
transfer serialized ProposerSlashing (416 B) 2.7720 us/op 2.5830 us/op 1.07
copy serialized ProposerSlashing (416 B) 2.7080 us/op 2.8710 us/op 0.94
transfer serialized Attestation (485 B) 2.9160 us/op 3.1890 us/op 0.91
copy serialized Attestation (485 B) 2.8560 us/op 3.1450 us/op 0.91
transfer serialized AttesterSlashing (33232 B) 2.5010 us/op 3.2750 us/op 0.76
copy serialized AttesterSlashing (33232 B) 7.8800 us/op 6.2820 us/op 1.25
transfer serialized Small SignedBeaconBlock (128000 B) 3.1250 us/op 3.6990 us/op 0.84
copy serialized Small SignedBeaconBlock (128000 B) 20.996 us/op 14.449 us/op 1.45
transfer serialized Avg SignedBeaconBlock (200000 B) 3.4510 us/op 3.7540 us/op 0.92
copy serialized Avg SignedBeaconBlock (200000 B) 20.760 us/op 20.037 us/op 1.04
transfer serialized BlobsSidecar (524380 B) 3.9360 us/op 3.3010 us/op 1.19
copy serialized BlobsSidecar (524380 B) 109.07 us/op 177.46 us/op 0.61
transfer serialized Big SignedBeaconBlock (1000000 B) 4.2360 us/op 3.4360 us/op 1.23
copy serialized Big SignedBeaconBlock (1000000 B) 342.82 us/op 268.12 us/op 1.28
pass gossip attestations to forkchoice per slot 2.7110 ms/op 2.5745 ms/op 1.05
forkChoice updateHead vc 100000 bc 64 eq 0 2.1069 ms/op 2.0455 ms/op 1.03
forkChoice updateHead vc 600000 bc 64 eq 0 12.431 ms/op 11.657 ms/op 1.07
forkChoice updateHead vc 1000000 bc 64 eq 0 23.202 ms/op 19.456 ms/op 1.19
forkChoice updateHead vc 600000 bc 320 eq 0 16.929 ms/op 15.653 ms/op 1.08
forkChoice updateHead vc 600000 bc 1200 eq 0 84.709 ms/op 75.837 ms/op 1.12
forkChoice updateHead vc 600000 bc 64 eq 1000 21.011 ms/op 19.781 ms/op 1.06
forkChoice updateHead vc 600000 bc 64 eq 10000 23.254 ms/op 21.687 ms/op 1.07
forkChoice updateHead vc 600000 bc 64 eq 300000 32.248 ms/op 29.647 ms/op 1.09
computeDeltas 3.2260 ms/op 3.8162 ms/op 0.85
computeProposerBoostScoreFromBalances 1.8052 ms/op 1.7222 ms/op 1.05
altair processAttestation - 250000 vs - 7PWei normalcase 3.2355 ms/op 2.1019 ms/op 1.54
altair processAttestation - 250000 vs - 7PWei worstcase 4.2633 ms/op 3.1850 ms/op 1.34
altair processAttestation - setStatus - 1/6 committees join 145.81 us/op 139.41 us/op 1.05
altair processAttestation - setStatus - 1/3 committees join 275.61 us/op 270.07 us/op 1.02
altair processAttestation - setStatus - 1/2 committees join 376.04 us/op 352.35 us/op 1.07
altair processAttestation - setStatus - 2/3 committees join 469.65 us/op 441.92 us/op 1.06
altair processAttestation - setStatus - 4/5 committees join 664.25 us/op 642.41 us/op 1.03
altair processAttestation - setStatus - 100% committees join 768.67 us/op 753.81 us/op 1.02
altair processBlock - 250000 vs - 7PWei normalcase 16.538 ms/op 18.669 ms/op 0.89
altair processBlock - 250000 vs - 7PWei normalcase hashState 26.866 ms/op 25.713 ms/op 1.04
altair processBlock - 250000 vs - 7PWei worstcase 54.146 ms/op 52.520 ms/op 1.03
altair processBlock - 250000 vs - 7PWei worstcase hashState 69.770 ms/op 65.404 ms/op 1.07
phase0 processBlock - 250000 vs - 7PWei normalcase 2.1730 ms/op 1.9396 ms/op 1.12
phase0 processBlock - 250000 vs - 7PWei worstcase 28.920 ms/op 27.298 ms/op 1.06
altair processEth1Data - 250000 vs - 7PWei normalcase 516.30 us/op 505.97 us/op 1.02
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 7.9400 us/op 6.8490 us/op 1.16
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 20.262 us/op 19.333 us/op 1.05
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 8.9710 us/op 8.3280 us/op 1.08
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 6.8600 us/op 6.5550 us/op 1.05
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 105.24 us/op 74.383 us/op 1.41
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 627.40 us/op 621.45 us/op 1.01
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 885.49 us/op 899.36 us/op 0.98
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 902.09 us/op 865.43 us/op 1.04
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.2746 ms/op 2.1766 ms/op 1.05
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.6525 ms/op 1.4659 ms/op 1.13
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.9124 ms/op 3.4718 ms/op 1.13
Tree 40 250000 create 308.62 ms/op 308.99 ms/op 1.00
Tree 40 250000 get(125000) 181.92 ns/op 168.87 ns/op 1.08
Tree 40 250000 set(125000) 990.68 ns/op 823.16 ns/op 1.20
Tree 40 250000 toArray() 19.159 ms/op 16.082 ms/op 1.19
Tree 40 250000 iterate all - toArray() + loop 19.524 ms/op 15.964 ms/op 1.22
Tree 40 250000 iterate all - get(i) 70.846 ms/op 63.061 ms/op 1.12
MutableVector 250000 create 10.129 ms/op 11.224 ms/op 0.90
MutableVector 250000 get(125000) 6.2540 ns/op 6.3820 ns/op 0.98
MutableVector 250000 set(125000) 275.27 ns/op 248.60 ns/op 1.11
MutableVector 250000 toArray() 3.0411 ms/op 2.7686 ms/op 1.10
MutableVector 250000 iterate all - toArray() + loop 3.0175 ms/op 2.8917 ms/op 1.04
MutableVector 250000 iterate all - get(i) 1.5093 ms/op 1.4948 ms/op 1.01
Array 250000 create 2.5086 ms/op 2.5561 ms/op 0.98
Array 250000 clone - spread 1.1872 ms/op 1.1806 ms/op 1.01
Array 250000 get(125000) 0.62700 ns/op 0.57000 ns/op 1.10
Array 250000 set(125000) 0.65800 ns/op 0.65000 ns/op 1.01
Array 250000 iterate all - loop 104.33 us/op 108.45 us/op 0.96
effectiveBalanceIncrements clone Uint8Array 300000 36.278 us/op 29.213 us/op 1.24
effectiveBalanceIncrements clone MutableVector 300000 365.00 ns/op 370.00 ns/op 0.99
effectiveBalanceIncrements rw all Uint8Array 300000 168.49 us/op 165.28 us/op 1.02
effectiveBalanceIncrements rw all MutableVector 300000 86.579 ms/op 75.995 ms/op 1.14
phase0 afterProcessEpoch - 250000 vs - 7PWei 117.65 ms/op 107.67 ms/op 1.09
phase0 beforeProcessEpoch - 250000 vs - 7PWei 35.463 ms/op 40.642 ms/op 0.87
altair processEpoch - mainnet_e81889 347.22 ms/op 312.53 ms/op 1.11
mainnet_e81889 - altair beforeProcessEpoch 65.476 ms/op 63.980 ms/op 1.02
mainnet_e81889 - altair processJustificationAndFinalization 18.292 us/op 16.789 us/op 1.09
mainnet_e81889 - altair processInactivityUpdates 6.0047 ms/op 5.4066 ms/op 1.11
mainnet_e81889 - altair processRewardsAndPenalties 64.779 ms/op 72.736 ms/op 0.89
mainnet_e81889 - altair processRegistryUpdates 2.5930 us/op 2.8450 us/op 0.91
mainnet_e81889 - altair processSlashings 417.00 ns/op 468.00 ns/op 0.89
mainnet_e81889 - altair processEth1DataReset 780.00 ns/op 563.00 ns/op 1.39
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2741 ms/op 1.2252 ms/op 1.04
mainnet_e81889 - altair processSlashingsReset 4.6340 us/op 4.6450 us/op 1.00
mainnet_e81889 - altair processRandaoMixesReset 5.2350 us/op 4.4720 us/op 1.17
mainnet_e81889 - altair processHistoricalRootsUpdate 996.00 ns/op 714.00 ns/op 1.39
mainnet_e81889 - altair processParticipationFlagUpdates 4.0790 us/op 2.4330 us/op 1.68
mainnet_e81889 - altair processSyncCommitteeUpdates 1.1880 us/op 468.00 ns/op 2.54
mainnet_e81889 - altair afterProcessEpoch 133.87 ms/op 111.50 ms/op 1.20
phase0 processEpoch - mainnet_e58758 404.40 ms/op 313.84 ms/op 1.29
mainnet_e58758 - phase0 beforeProcessEpoch 175.63 ms/op 119.86 ms/op 1.47
mainnet_e58758 - phase0 processJustificationAndFinalization 23.896 us/op 15.797 us/op 1.51
mainnet_e58758 - phase0 processRewardsAndPenalties 65.363 ms/op 53.002 ms/op 1.23
mainnet_e58758 - phase0 processRegistryUpdates 13.415 us/op 7.8830 us/op 1.70
mainnet_e58758 - phase0 processSlashings 635.00 ns/op 535.00 ns/op 1.19
mainnet_e58758 - phase0 processEth1DataReset 1.0290 us/op 583.00 ns/op 1.77
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.0653 ms/op 950.77 us/op 1.12
mainnet_e58758 - phase0 processSlashingsReset 7.1750 us/op 3.1090 us/op 2.31
mainnet_e58758 - phase0 processRandaoMixesReset 6.1470 us/op 4.7800 us/op 1.29
mainnet_e58758 - phase0 processHistoricalRootsUpdate 826.00 ns/op 831.00 ns/op 0.99
mainnet_e58758 - phase0 processParticipationRecordUpdates 6.1090 us/op 4.0080 us/op 1.52
mainnet_e58758 - phase0 afterProcessEpoch 100.45 ms/op 95.370 ms/op 1.05
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2729 ms/op 1.2014 ms/op 1.06
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4501 ms/op 1.4182 ms/op 1.02
altair processInactivityUpdates - 250000 normalcase 26.389 ms/op 20.773 ms/op 1.27
altair processInactivityUpdates - 250000 worstcase 26.935 ms/op 20.586 ms/op 1.31
phase0 processRegistryUpdates - 250000 normalcase 7.3920 us/op 6.2560 us/op 1.18
phase0 processRegistryUpdates - 250000 badcase_full_deposits 274.10 us/op 259.16 us/op 1.06
phase0 processRegistryUpdates - 250000 worstcase 0.5 123.58 ms/op 121.98 ms/op 1.01
altair processRewardsAndPenalties - 250000 normalcase 65.797 ms/op 42.836 ms/op 1.54
altair processRewardsAndPenalties - 250000 worstcase 71.007 ms/op 54.780 ms/op 1.30
phase0 getAttestationDeltas - 250000 normalcase 6.6372 ms/op 6.8446 ms/op 0.97
phase0 getAttestationDeltas - 250000 worstcase 6.6408 ms/op 6.8183 ms/op 0.97
phase0 processSlashings - 250000 worstcase 3.5707 ms/op 3.5221 ms/op 1.01
altair processSyncCommitteeUpdates - 250000 180.12 ms/op 177.04 ms/op 1.02
BeaconState.hashTreeRoot - No change 305.00 ns/op 277.00 ns/op 1.10
BeaconState.hashTreeRoot - 1 full validator 54.133 us/op 50.906 us/op 1.06
BeaconState.hashTreeRoot - 32 full validator 490.75 us/op 551.52 us/op 0.89
BeaconState.hashTreeRoot - 512 full validator 6.5656 ms/op 5.1405 ms/op 1.28
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 64.064 us/op 62.649 us/op 1.02
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 967.68 us/op 886.17 us/op 1.09
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 12.491 ms/op 11.464 ms/op 1.09
BeaconState.hashTreeRoot - 1 balances 50.762 us/op 48.873 us/op 1.04
BeaconState.hashTreeRoot - 32 balances 455.92 us/op 440.97 us/op 1.03
BeaconState.hashTreeRoot - 512 balances 4.7519 ms/op 4.3468 ms/op 1.09
BeaconState.hashTreeRoot - 250000 balances 74.021 ms/op 75.186 ms/op 0.98
aggregationBits - 2048 els - zipIndexesInBitList 19.755 us/op 16.433 us/op 1.20
regular array get 100000 times 44.575 us/op 32.766 us/op 1.36
wrappedArray get 100000 times 41.461 us/op 32.758 us/op 1.27
arrayWithProxy get 100000 times 15.393 ms/op 15.420 ms/op 1.00
ssz.Root.equals 569.00 ns/op 539.00 ns/op 1.06
byteArrayEquals 588.00 ns/op 532.00 ns/op 1.11
shuffle list - 16384 els 6.8896 ms/op 6.9522 ms/op 0.99
shuffle list - 250000 els 101.65 ms/op 99.837 ms/op 1.02
processSlot - 1 slots 9.1240 us/op 8.9160 us/op 1.02
processSlot - 32 slots 1.3958 ms/op 1.3720 ms/op 1.02
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 38.034 ms/op 31.813 ms/op 1.20
getCommitteeAssignments - req 1 vs - 250000 vc 3.0406 ms/op 2.8622 ms/op 1.06
getCommitteeAssignments - req 100 vs - 250000 vc 4.2686 ms/op 4.1010 ms/op 1.04
getCommitteeAssignments - req 1000 vs - 250000 vc 4.6246 ms/op 4.5219 ms/op 1.02
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.5400 ns/op 4.5600 ns/op 1.21
state getBlockRootAtSlot - 250000 vs - 7PWei 738.17 ns/op 699.53 ns/op 1.06
computeProposers - vc 250000 11.804 ms/op 11.008 ms/op 1.07
computeEpochShuffling - vc 250000 111.95 ms/op 101.11 ms/op 1.11
getNextSyncCommittee - vc 250000 206.05 ms/op 179.53 ms/op 1.15
computeSigningRoot for AttestationData 15.093 us/op 14.152 us/op 1.07
hash AttestationData serialized data then Buffer.toString(base64) 2.6243 us/op 2.5100 us/op 1.05
toHexString serialized data 1.2727 us/op 1.1470 us/op 1.11
Buffer.toString(base64) 375.78 ns/op 318.35 ns/op 1.18

by benchmarkbot/action

@g11tech g11tech merged commit 3dd0dfe into unstable Jun 22, 2023
12 checks passed
@g11tech g11tech deleted the g11tech/fix-blobsbyrange-count branch June 22, 2023 12:44
@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.

None yet

3 participants