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 lodestar validator to not break on cross client block production #5296

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Mar 22, 2023

Fix cross client validator usage as propagating blockValue to validator is not standard yet

image

@g11tech g11tech requested a review from a team as a code owner March 22, 2023 14:31
@g11tech g11tech enabled auto-merge (squash) March 22, 2023 14:34
@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 0fe4e81 Previous: f28adf6 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 951.33 us/op 847.25 us/op 1.12
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 45.815 us/op 45.894 us/op 1.00
BLS verify - blst-native 1.2137 ms/op 1.2207 ms/op 0.99
BLS verifyMultipleSignatures 3 - blst-native 2.4675 ms/op 2.4849 ms/op 0.99
BLS verifyMultipleSignatures 8 - blst-native 5.3722 ms/op 5.3419 ms/op 1.01
BLS verifyMultipleSignatures 32 - blst-native 19.544 ms/op 19.312 ms/op 1.01
BLS aggregatePubkeys 32 - blst-native 26.359 us/op 26.131 us/op 1.01
BLS aggregatePubkeys 128 - blst-native 103.67 us/op 100.78 us/op 1.03
getAttestationsForBlock 62.320 ms/op 61.390 ms/op 1.02
isKnown best case - 1 super set check 257.00 ns/op 265.00 ns/op 0.97
isKnown normal case - 2 super set checks 263.00 ns/op 258.00 ns/op 1.02
isKnown worse case - 16 super set checks 266.00 ns/op 257.00 ns/op 1.04
CheckpointStateCache - add get delete 5.5490 us/op 5.7450 us/op 0.97
validate gossip signedAggregateAndProof - struct 2.7948 ms/op 2.8214 ms/op 0.99
validate gossip attestation - struct 1.3490 ms/op 1.3259 ms/op 1.02
pickEth1Vote - no votes 1.3959 ms/op 1.4221 ms/op 0.98
pickEth1Vote - max votes 11.515 ms/op 10.344 ms/op 1.11
pickEth1Vote - Eth1Data hashTreeRoot value x2048 9.7089 ms/op 9.7374 ms/op 1.00
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 15.876 ms/op 15.617 ms/op 1.02
pickEth1Vote - Eth1Data fastSerialize value x2048 747.08 us/op 754.58 us/op 0.99
pickEth1Vote - Eth1Data fastSerialize tree x2048 5.4164 ms/op 5.0553 ms/op 1.07
bytes32 toHexString 598.00 ns/op 523.00 ns/op 1.14
bytes32 Buffer.toString(hex) 412.00 ns/op 383.00 ns/op 1.08
bytes32 Buffer.toString(hex) from Uint8Array 623.00 ns/op 614.00 ns/op 1.01
bytes32 Buffer.toString(hex) + 0x 422.00 ns/op 402.00 ns/op 1.05
Object access 1 prop 0.17700 ns/op 0.17800 ns/op 0.99
Map access 1 prop 0.15600 ns/op 0.15800 ns/op 0.99
Object get x1000 6.3820 ns/op 7.0000 ns/op 0.91
Map get x1000 0.61900 ns/op 0.59300 ns/op 1.04
Object set x1000 53.865 ns/op 52.316 ns/op 1.03
Map set x1000 47.433 ns/op 42.850 ns/op 1.11
Return object 10000 times 0.25020 ns/op 0.23800 ns/op 1.05
Throw Error 10000 times 4.2461 us/op 4.2743 us/op 0.99
fastMsgIdFn sha256 / 200 bytes 3.6210 us/op 3.4940 us/op 1.04
fastMsgIdFn h32 xxhash / 200 bytes 304.00 ns/op 306.00 ns/op 0.99
fastMsgIdFn h64 xxhash / 200 bytes 451.00 ns/op 425.00 ns/op 1.06
fastMsgIdFn sha256 / 1000 bytes 11.819 us/op 11.809 us/op 1.00
fastMsgIdFn h32 xxhash / 1000 bytes 437.00 ns/op 428.00 ns/op 1.02
fastMsgIdFn h64 xxhash / 1000 bytes 542.00 ns/op 473.00 ns/op 1.15
fastMsgIdFn sha256 / 10000 bytes 105.44 us/op 103.34 us/op 1.02
fastMsgIdFn h32 xxhash / 10000 bytes 2.0270 us/op 1.9700 us/op 1.03
fastMsgIdFn h64 xxhash / 10000 bytes 1.4180 us/op 1.3870 us/op 1.02
enrSubnets - fastDeserialize 64 bits 1.4540 us/op 1.3090 us/op 1.11
enrSubnets - ssz BitVector 64 bits 592.00 ns/op 516.00 ns/op 1.15
enrSubnets - fastDeserialize 4 bits 199.00 ns/op 170.00 ns/op 1.17
enrSubnets - ssz BitVector 4 bits 599.00 ns/op 497.00 ns/op 1.21
prioritizePeers score -10:0 att 32-0.1 sync 2-0 102.89 us/op 105.20 us/op 0.98
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 147.18 us/op 141.25 us/op 1.04
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 190.16 us/op 166.58 us/op 1.14
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 387.02 us/op 306.54 us/op 1.26
prioritizePeers score 0:0 att 64-1 sync 4-1 389.47 us/op 362.51 us/op 1.07
array of 16000 items push then shift 1.6500 us/op 1.6130 us/op 1.02
LinkedList of 16000 items push then shift 8.8340 ns/op 8.7650 ns/op 1.01
array of 16000 items push then pop 95.498 ns/op 94.508 ns/op 1.01
LinkedList of 16000 items push then pop 8.6300 ns/op 8.3850 ns/op 1.03
array of 24000 items push then shift 2.3524 us/op 2.2946 us/op 1.03
LinkedList of 24000 items push then shift 8.7330 ns/op 8.7410 ns/op 1.00
array of 24000 items push then pop 73.288 ns/op 76.864 ns/op 0.95
LinkedList of 24000 items push then pop 8.8980 ns/op 8.4990 ns/op 1.05
intersect bitArray bitLen 8 13.205 ns/op 13.154 ns/op 1.00
intersect array and set length 8 80.166 ns/op 78.849 ns/op 1.02
intersect bitArray bitLen 128 43.979 ns/op 43.526 ns/op 1.01
intersect array and set length 128 1.1272 us/op 1.0379 us/op 1.09
Buffer.concat 32 items 2.6770 us/op 2.5930 us/op 1.03
Uint8Array.set 32 items 2.4240 us/op 2.4900 us/op 0.97
pass gossip attestations to forkchoice per slot 3.4916 ms/op 3.4252 ms/op 1.02
computeDeltas 3.1826 ms/op 3.3147 ms/op 0.96
computeProposerBoostScoreFromBalances 1.8217 ms/op 1.8275 ms/op 1.00
altair processAttestation - 250000 vs - 7PWei normalcase 3.2276 ms/op 2.6342 ms/op 1.23
altair processAttestation - 250000 vs - 7PWei worstcase 4.4113 ms/op 4.5012 ms/op 0.98
altair processAttestation - setStatus - 1/6 committees join 141.72 us/op 145.80 us/op 0.97
altair processAttestation - setStatus - 1/3 committees join 281.25 us/op 285.45 us/op 0.99
altair processAttestation - setStatus - 1/2 committees join 389.06 us/op 375.59 us/op 1.04
altair processAttestation - setStatus - 2/3 committees join 476.89 us/op 478.12 us/op 1.00
altair processAttestation - setStatus - 4/5 committees join 676.83 us/op 667.49 us/op 1.01
altair processAttestation - setStatus - 100% committees join 786.83 us/op 782.37 us/op 1.01
altair processBlock - 250000 vs - 7PWei normalcase 17.197 ms/op 15.259 ms/op 1.13
altair processBlock - 250000 vs - 7PWei normalcase hashState 27.888 ms/op 27.795 ms/op 1.00
altair processBlock - 250000 vs - 7PWei worstcase 51.224 ms/op 48.487 ms/op 1.06
altair processBlock - 250000 vs - 7PWei worstcase hashState 65.652 ms/op 70.837 ms/op 0.93
phase0 processBlock - 250000 vs - 7PWei normalcase 2.0345 ms/op 2.0110 ms/op 1.01
phase0 processBlock - 250000 vs - 7PWei worstcase 31.328 ms/op 29.521 ms/op 1.06
altair processEth1Data - 250000 vs - 7PWei normalcase 488.23 us/op 655.23 us/op 0.75
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 9.8030 us/op 8.5740 us/op 1.14
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 32.397 us/op 29.771 us/op 1.09
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 12.521 us/op 13.661 us/op 0.92
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 8.8180 us/op 9.2090 us/op 0.96
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 122.16 us/op 104.39 us/op 1.17
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 710.41 us/op 696.09 us/op 1.02
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 16384 919.91 us/op 917.26 us/op 1.00
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 16384 898.06 us/op 939.12 us/op 0.96
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 16384 2.3712 ms/op 2.5742 ms/op 0.92
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 16384 1.5571 ms/op 1.7572 ms/op 0.89
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 16384 4.0822 ms/op 4.1661 ms/op 0.98
Tree 40 250000 create 454.07 ms/op 320.36 ms/op 1.42
Tree 40 250000 get(125000) 201.98 ns/op 195.32 ns/op 1.03
Tree 40 250000 set(125000) 939.99 ns/op 1.0216 us/op 0.92
Tree 40 250000 toArray() 21.759 ms/op 21.857 ms/op 1.00
Tree 40 250000 iterate all - toArray() + loop 21.668 ms/op 21.899 ms/op 0.99
Tree 40 250000 iterate all - get(i) 74.720 ms/op 73.969 ms/op 1.01
MutableVector 250000 create 10.369 ms/op 11.298 ms/op 0.92
MutableVector 250000 get(125000) 6.6490 ns/op 6.4510 ns/op 1.03
MutableVector 250000 set(125000) 278.31 ns/op 281.24 ns/op 0.99
MutableVector 250000 toArray() 3.3365 ms/op 3.3124 ms/op 1.01
MutableVector 250000 iterate all - toArray() + loop 3.5750 ms/op 2.9701 ms/op 1.20
MutableVector 250000 iterate all - get(i) 1.5401 ms/op 1.5141 ms/op 1.02
Array 250000 create 3.5663 ms/op 2.6770 ms/op 1.33
Array 250000 clone - spread 1.1615 ms/op 1.1126 ms/op 1.04
Array 250000 get(125000) 0.60100 ns/op 0.54700 ns/op 1.10
Array 250000 set(125000) 0.70400 ns/op 1.6010 ns/op 0.44
Array 250000 iterate all - loop 87.554 us/op 147.89 us/op 0.59
effectiveBalanceIncrements clone Uint8Array 300000 44.302 us/op 76.876 us/op 0.58
effectiveBalanceIncrements clone MutableVector 300000 369.00 ns/op 1.6890 us/op 0.22
effectiveBalanceIncrements rw all Uint8Array 300000 179.89 us/op 228.59 us/op 0.79
effectiveBalanceIncrements rw all MutableVector 300000 146.02 ms/op 213.26 ms/op 0.68
phase0 afterProcessEpoch - 250000 vs - 7PWei 135.61 ms/op 161.96 ms/op 0.84
phase0 beforeProcessEpoch - 250000 vs - 7PWei 40.317 ms/op 51.857 ms/op 0.78
altair processEpoch - mainnet_e81889 322.41 ms/op 347.34 ms/op 0.93
mainnet_e81889 - altair beforeProcessEpoch 70.468 ms/op 72.961 ms/op 0.97
mainnet_e81889 - altair processJustificationAndFinalization 21.214 us/op 18.344 us/op 1.16
mainnet_e81889 - altair processInactivityUpdates 5.9749 ms/op 6.5980 ms/op 0.91
mainnet_e81889 - altair processRewardsAndPenalties 54.451 ms/op 72.452 ms/op 0.75
mainnet_e81889 - altair processRegistryUpdates 3.8380 us/op 2.9670 us/op 1.29
mainnet_e81889 - altair processSlashings 596.00 ns/op 587.00 ns/op 1.02
mainnet_e81889 - altair processEth1DataReset 715.00 ns/op 508.00 ns/op 1.41
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.3143 ms/op 1.3075 ms/op 1.01
mainnet_e81889 - altair processSlashingsReset 9.1590 us/op 4.7550 us/op 1.93
mainnet_e81889 - altair processRandaoMixesReset 6.6610 us/op 8.5480 us/op 0.78
mainnet_e81889 - altair processHistoricalRootsUpdate 1.4470 us/op 1.0080 us/op 1.44
mainnet_e81889 - altair processParticipationFlagUpdates 5.4370 us/op 2.7890 us/op 1.95
mainnet_e81889 - altair processSyncCommitteeUpdates 1.5060 us/op 1.3950 us/op 1.08
mainnet_e81889 - altair afterProcessEpoch 144.60 ms/op 151.87 ms/op 0.95
phase0 processEpoch - mainnet_e58758 423.78 ms/op 371.68 ms/op 1.14
mainnet_e58758 - phase0 beforeProcessEpoch 155.58 ms/op 159.02 ms/op 0.98
mainnet_e58758 - phase0 processJustificationAndFinalization 25.609 us/op 31.672 us/op 0.81
mainnet_e58758 - phase0 processRewardsAndPenalties 71.929 ms/op 69.898 ms/op 1.03
mainnet_e58758 - phase0 processRegistryUpdates 13.376 us/op 14.855 us/op 0.90
mainnet_e58758 - phase0 processSlashings 919.00 ns/op 1.1780 us/op 0.78
mainnet_e58758 - phase0 processEth1DataReset 692.00 ns/op 1.2600 us/op 0.55
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.8278 ms/op 1.5749 ms/op 1.80
mainnet_e58758 - phase0 processSlashingsReset 7.6800 us/op 8.6810 us/op 0.88
mainnet_e58758 - phase0 processRandaoMixesReset 11.391 us/op 10.428 us/op 1.09
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.6200 us/op 1.5810 us/op 1.02
mainnet_e58758 - phase0 processParticipationRecordUpdates 9.6280 us/op 7.8420 us/op 1.23
mainnet_e58758 - phase0 afterProcessEpoch 111.59 ms/op 105.93 ms/op 1.05
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.1866 ms/op 1.9475 ms/op 1.12
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.0023 ms/op 2.1115 ms/op 0.95
altair processInactivityUpdates - 250000 normalcase 28.808 ms/op 26.944 ms/op 1.07
altair processInactivityUpdates - 250000 worstcase 24.473 ms/op 27.800 ms/op 0.88
phase0 processRegistryUpdates - 250000 normalcase 9.1830 us/op 12.826 us/op 0.72
phase0 processRegistryUpdates - 250000 badcase_full_deposits 313.08 us/op 343.04 us/op 0.91
phase0 processRegistryUpdates - 250000 worstcase 0.5 128.23 ms/op 138.76 ms/op 0.92
altair processRewardsAndPenalties - 250000 normalcase 65.674 ms/op 67.720 ms/op 0.97
altair processRewardsAndPenalties - 250000 worstcase 69.920 ms/op 68.603 ms/op 1.02
phase0 getAttestationDeltas - 250000 normalcase 7.4232 ms/op 8.9523 ms/op 0.83
phase0 getAttestationDeltas - 250000 worstcase 6.7187 ms/op 8.9166 ms/op 0.75
phase0 processSlashings - 250000 worstcase 3.6305 ms/op 4.1913 ms/op 0.87
altair processSyncCommitteeUpdates - 250000 177.81 ms/op 195.06 ms/op 0.91
BeaconState.hashTreeRoot - No change 347.00 ns/op 377.00 ns/op 0.92
BeaconState.hashTreeRoot - 1 full validator 50.996 us/op 55.479 us/op 0.92
BeaconState.hashTreeRoot - 32 full validator 509.23 us/op 604.71 us/op 0.84
BeaconState.hashTreeRoot - 512 full validator 5.4643 ms/op 6.3717 ms/op 0.86
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 65.653 us/op 72.064 us/op 0.91
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 880.95 us/op 1.0383 ms/op 0.85
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 11.501 ms/op 13.444 ms/op 0.86
BeaconState.hashTreeRoot - 1 balances 51.775 us/op 52.327 us/op 0.99
BeaconState.hashTreeRoot - 32 balances 478.11 us/op 483.28 us/op 0.99
BeaconState.hashTreeRoot - 512 balances 4.6560 ms/op 5.1360 ms/op 0.91
BeaconState.hashTreeRoot - 250000 balances 76.446 ms/op 79.619 ms/op 0.96
aggregationBits - 2048 els - zipIndexesInBitList 17.236 us/op 21.764 us/op 0.79
regular array get 100000 times 33.597 us/op 38.374 us/op 0.88
wrappedArray get 100000 times 33.779 us/op 36.962 us/op 0.91
arrayWithProxy get 100000 times 15.800 ms/op 17.045 ms/op 0.93
ssz.Root.equals 577.00 ns/op 605.00 ns/op 0.95
byteArrayEquals 566.00 ns/op 613.00 ns/op 0.92
shuffle list - 16384 els 7.1342 ms/op 7.6233 ms/op 0.94
shuffle list - 250000 els 107.61 ms/op 108.70 ms/op 0.99
processSlot - 1 slots 10.902 us/op 10.435 us/op 1.04
processSlot - 32 slots 1.4804 ms/op 1.4745 ms/op 1.00
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 45.425 ms/op 39.059 ms/op 1.16
getCommitteeAssignments - req 1 vs - 250000 vc 3.5165 ms/op 3.0259 ms/op 1.16
getCommitteeAssignments - req 100 vs - 250000 vc 4.7648 ms/op 4.3146 ms/op 1.10
getCommitteeAssignments - req 1000 vs - 250000 vc 5.0983 ms/op 4.6975 ms/op 1.09
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.5900 ns/op 5.8600 ns/op 0.95
state getBlockRootAtSlot - 250000 vs - 7PWei 1.0371 us/op 935.64 ns/op 1.11
computeProposers - vc 250000 12.220 ms/op 12.091 ms/op 1.01
computeEpochShuffling - vc 250000 128.03 ms/op 115.36 ms/op 1.11
getNextSyncCommittee - vc 250000 212.50 ms/op 187.26 ms/op 1.13

by benchmarkbot/action

Copy link
Member

@nflaig nflaig left a comment

Choose a reason for hiding this comment

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

lgtm

@g11tech g11tech merged commit f5a6537 into unstable Mar 22, 2023
@g11tech g11tech deleted the g11tech/fix-cross-client-blockvalue branch March 22, 2023 14:56
@wemeetagain
Copy link
Member

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