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

docs: correction on weak subjectivity #5712

Merged
merged 1 commit into from
Jun 27, 2023
Merged

Conversation

matthewkeil
Copy link
Member

Motivation

Moved from #5557 . Credit to @eccentricexit. Closing #5557

There is incorrect information on the documentation. Weak subjectivity is not a path to execute long range attacs.

Description

This is just a really small documentation correction.

@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 1eb1b62 Previous: a208afb Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 968.13 us/op 816.44 us/op 1.19
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 50.315 us/op 46.294 us/op 1.09
BLS verify - blst-native 1.2109 ms/op 1.2151 ms/op 1.00
BLS verifyMultipleSignatures 3 - blst-native 2.4675 ms/op 2.4652 ms/op 1.00
BLS verifyMultipleSignatures 8 - blst-native 5.2975 ms/op 5.2976 ms/op 1.00
BLS verifyMultipleSignatures 32 - blst-native 19.217 ms/op 19.152 ms/op 1.00
BLS aggregatePubkeys 32 - blst-native 25.499 us/op 25.886 us/op 0.99
BLS aggregatePubkeys 128 - blst-native 100.20 us/op 100.04 us/op 1.00
getAttestationsForBlock 55.635 ms/op 56.262 ms/op 0.99
isKnown best case - 1 super set check 249.00 ns/op 263.00 ns/op 0.95
isKnown normal case - 2 super set checks 246.00 ns/op 261.00 ns/op 0.94
isKnown worse case - 16 super set checks 244.00 ns/op 258.00 ns/op 0.95
CheckpointStateCache - add get delete 5.3590 us/op 5.3160 us/op 1.01
validate gossip signedAggregateAndProof - struct 2.7628 ms/op 2.8217 ms/op 0.98
validate gossip attestation - struct 1.3110 ms/op 1.3492 ms/op 0.97
pickEth1Vote - no votes 1.2950 ms/op 1.3552 ms/op 0.96
pickEth1Vote - max votes 8.5553 ms/op 8.6700 ms/op 0.99
pickEth1Vote - Eth1Data hashTreeRoot value x2048 8.6729 ms/op 8.5185 ms/op 1.02
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 13.114 ms/op 15.017 ms/op 0.87
pickEth1Vote - Eth1Data fastSerialize value x2048 675.00 us/op 707.88 us/op 0.95
pickEth1Vote - Eth1Data fastSerialize tree x2048 4.6488 ms/op 7.1009 ms/op 0.65
bytes32 toHexString 485.00 ns/op 554.00 ns/op 0.88
bytes32 Buffer.toString(hex) 341.00 ns/op 418.00 ns/op 0.82
bytes32 Buffer.toString(hex) from Uint8Array 528.00 ns/op 635.00 ns/op 0.83
bytes32 Buffer.toString(hex) + 0x 349.00 ns/op 394.00 ns/op 0.89
Object access 1 prop 0.16300 ns/op 0.19000 ns/op 0.86
Map access 1 prop 0.15500 ns/op 0.16500 ns/op 0.94
Object get x1000 6.4550 ns/op 7.1970 ns/op 0.90
Map get x1000 0.63800 ns/op 0.65800 ns/op 0.97
Object set x1000 59.941 ns/op 63.017 ns/op 0.95
Map set x1000 54.220 ns/op 52.610 ns/op 1.03
Return object 10000 times 0.24010 ns/op 0.26290 ns/op 0.91
Throw Error 10000 times 4.2504 us/op 4.4858 us/op 0.95
fastMsgIdFn sha256 / 200 bytes 3.5700 us/op 3.6600 us/op 0.98
fastMsgIdFn h32 xxhash / 200 bytes 300.00 ns/op 333.00 ns/op 0.90
fastMsgIdFn h64 xxhash / 200 bytes 450.00 ns/op 495.00 ns/op 0.91
fastMsgIdFn sha256 / 1000 bytes 11.691 us/op 12.515 us/op 0.93
fastMsgIdFn h32 xxhash / 1000 bytes 433.00 ns/op 457.00 ns/op 0.95
fastMsgIdFn h64 xxhash / 1000 bytes 520.00 ns/op 547.00 ns/op 0.95
fastMsgIdFn sha256 / 10000 bytes 103.60 us/op 110.05 us/op 0.94
fastMsgIdFn h32 xxhash / 10000 bytes 1.9760 us/op 2.2260 us/op 0.89
fastMsgIdFn h64 xxhash / 10000 bytes 1.4180 us/op 1.5270 us/op 0.93
enrSubnets - fastDeserialize 64 bits 1.3520 us/op 1.4530 us/op 0.93
enrSubnets - ssz BitVector 64 bits 514.00 ns/op 606.00 ns/op 0.85
enrSubnets - fastDeserialize 4 bits 182.00 ns/op 205.00 ns/op 0.89
enrSubnets - ssz BitVector 4 bits 577.00 ns/op 640.00 ns/op 0.90
prioritizePeers score -10:0 att 32-0.1 sync 2-0 118.40 us/op 118.85 us/op 1.00
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 142.35 us/op 162.14 us/op 0.88
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 181.36 us/op 193.63 us/op 0.94
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 325.37 us/op 359.73 us/op 0.90
prioritizePeers score 0:0 att 64-1 sync 4-1 414.10 us/op 467.24 us/op 0.89
array of 16000 items push then shift 1.7055 us/op 1.8918 us/op 0.90
LinkedList of 16000 items push then shift 10.441 ns/op 10.074 ns/op 1.04
array of 16000 items push then pop 112.37 ns/op 123.72 ns/op 0.91
LinkedList of 16000 items push then pop 8.6940 ns/op 9.2460 ns/op 0.94
array of 24000 items push then shift 2.2997 us/op 2.5396 us/op 0.91
LinkedList of 24000 items push then shift 10.968 ns/op 9.2170 ns/op 1.19
array of 24000 items push then pop 81.580 ns/op 78.854 ns/op 1.03
LinkedList of 24000 items push then pop 8.7800 ns/op 9.2680 ns/op 0.95
intersect bitArray bitLen 8 13.673 ns/op 14.199 ns/op 0.96
intersect array and set length 8 111.92 ns/op 85.083 ns/op 1.32
intersect bitArray bitLen 128 44.369 ns/op 47.892 ns/op 0.93
intersect array and set length 128 1.3218 us/op 1.2012 us/op 1.10
Buffer.concat 32 items 3.0710 us/op 3.1160 us/op 0.99
Uint8Array.set 32 items 3.1270 us/op 2.6370 us/op 1.19
transfer serialized Status (84 B) 2.2930 us/op 2.2120 us/op 1.04
copy serialized Status (84 B) 1.9490 us/op 1.8260 us/op 1.07
transfer serialized SignedVoluntaryExit (112 B) 2.5250 us/op 2.3180 us/op 1.09
copy serialized SignedVoluntaryExit (112 B) 1.8230 us/op 2.0320 us/op 0.90
transfer serialized ProposerSlashing (416 B) 2.4940 us/op 2.8210 us/op 0.88
copy serialized ProposerSlashing (416 B) 2.2560 us/op 3.1570 us/op 0.71
transfer serialized Attestation (485 B) 2.5150 us/op 2.9220 us/op 0.86
copy serialized Attestation (485 B) 2.5190 us/op 2.5130 us/op 1.00
transfer serialized AttesterSlashing (33232 B) 3.0000 us/op 2.9550 us/op 1.02
copy serialized AttesterSlashing (33232 B) 6.7410 us/op 6.7140 us/op 1.00
transfer serialized Small SignedBeaconBlock (128000 B) 3.2090 us/op 3.5200 us/op 0.91
copy serialized Small SignedBeaconBlock (128000 B) 16.216 us/op 14.702 us/op 1.10
transfer serialized Avg SignedBeaconBlock (200000 B) 3.9350 us/op 3.6620 us/op 1.07
copy serialized Avg SignedBeaconBlock (200000 B) 23.691 us/op 22.309 us/op 1.06
transfer serialized BlobsSidecar (524380 B) 3.2200 us/op 3.6730 us/op 0.88
copy serialized BlobsSidecar (524380 B) 126.65 us/op 170.49 us/op 0.74
transfer serialized Big SignedBeaconBlock (1000000 B) 3.4390 us/op 4.0630 us/op 0.85
copy serialized Big SignedBeaconBlock (1000000 B) 164.93 us/op 289.00 us/op 0.57
pass gossip attestations to forkchoice per slot 2.6836 ms/op 2.8638 ms/op 0.94
forkChoice updateHead vc 100000 bc 64 eq 0 2.0684 ms/op 2.1249 ms/op 0.97
forkChoice updateHead vc 600000 bc 64 eq 0 11.961 ms/op 12.022 ms/op 0.99
forkChoice updateHead vc 1000000 bc 64 eq 0 22.931 ms/op 23.707 ms/op 0.97
forkChoice updateHead vc 600000 bc 320 eq 0 17.057 ms/op 17.998 ms/op 0.95
forkChoice updateHead vc 600000 bc 1200 eq 0 92.042 ms/op 88.577 ms/op 1.04
forkChoice updateHead vc 600000 bc 64 eq 1000 21.313 ms/op 21.368 ms/op 1.00
forkChoice updateHead vc 600000 bc 64 eq 10000 23.356 ms/op 23.551 ms/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 300000 76.030 ms/op 32.167 ms/op 2.36
computeDeltas 3.1393 ms/op 3.6116 ms/op 0.87
computeProposerBoostScoreFromBalances 1.7901 ms/op 1.9292 ms/op 0.93
altair processAttestation - 250000 vs - 7PWei normalcase 2.9390 ms/op 3.1373 ms/op 0.94
altair processAttestation - 250000 vs - 7PWei worstcase 4.2749 ms/op 4.7994 ms/op 0.89
altair processAttestation - setStatus - 1/6 committees join 146.96 us/op 157.35 us/op 0.93
altair processAttestation - setStatus - 1/3 committees join 279.85 us/op 302.95 us/op 0.92
altair processAttestation - setStatus - 1/2 committees join 363.77 us/op 430.62 us/op 0.84
altair processAttestation - setStatus - 2/3 committees join 469.04 us/op 502.34 us/op 0.93
altair processAttestation - setStatus - 4/5 committees join 662.24 us/op 809.01 us/op 0.82
altair processAttestation - setStatus - 100% committees join 755.76 us/op 917.22 us/op 0.82
altair processBlock - 250000 vs - 7PWei normalcase 17.658 ms/op 19.850 ms/op 0.89
altair processBlock - 250000 vs - 7PWei normalcase hashState 24.778 ms/op 27.696 ms/op 0.89
altair processBlock - 250000 vs - 7PWei worstcase 50.792 ms/op 57.765 ms/op 0.88
altair processBlock - 250000 vs - 7PWei worstcase hashState 73.514 ms/op 79.888 ms/op 0.92
phase0 processBlock - 250000 vs - 7PWei normalcase 1.9566 ms/op 2.2065 ms/op 0.89
phase0 processBlock - 250000 vs - 7PWei worstcase 27.253 ms/op 34.406 ms/op 0.79
altair processEth1Data - 250000 vs - 7PWei normalcase 465.46 us/op 497.79 us/op 0.94
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 7.3830 us/op 7.9140 us/op 0.93
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 25.128 us/op 24.055 us/op 1.04
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 9.2660 us/op 13.172 us/op 0.70
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 7.0930 us/op 7.1700 us/op 0.99
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 92.663 us/op 100.08 us/op 0.93
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 643.12 us/op 791.27 us/op 0.81
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 901.13 us/op 938.97 us/op 0.96
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 863.27 us/op 934.13 us/op 0.92
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.3870 ms/op 3.1501 ms/op 0.76
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.5366 ms/op 1.8368 ms/op 0.84
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.8254 ms/op 5.0921 ms/op 0.75
Tree 40 250000 create 350.12 ms/op 432.16 ms/op 0.81
Tree 40 250000 get(125000) 185.12 ns/op 217.79 ns/op 0.85
Tree 40 250000 set(125000) 1.0307 us/op 1.1860 us/op 0.87
Tree 40 250000 toArray() 21.613 ms/op 24.402 ms/op 0.89
Tree 40 250000 iterate all - toArray() + loop 21.600 ms/op 24.516 ms/op 0.88
Tree 40 250000 iterate all - get(i) 73.771 ms/op 82.194 ms/op 0.90
MutableVector 250000 create 9.7398 ms/op 13.592 ms/op 0.72
MutableVector 250000 get(125000) 6.3300 ns/op 7.7770 ns/op 0.81
MutableVector 250000 set(125000) 261.37 ns/op 308.06 ns/op 0.85
MutableVector 250000 toArray() 2.8234 ms/op 3.7496 ms/op 0.75
MutableVector 250000 iterate all - toArray() + loop 3.0128 ms/op 4.1234 ms/op 0.73
MutableVector 250000 iterate all - get(i) 1.5421 ms/op 1.7789 ms/op 0.87
Array 250000 create 2.6258 ms/op 3.7051 ms/op 0.71
Array 250000 clone - spread 1.1895 ms/op 1.5088 ms/op 0.79
Array 250000 get(125000) 0.57200 ns/op 0.93600 ns/op 0.61
Array 250000 set(125000) 0.65400 ns/op 0.89300 ns/op 0.73
Array 250000 iterate all - loop 105.93 us/op 116.11 us/op 0.91
effectiveBalanceIncrements clone Uint8Array 300000 30.118 us/op 49.209 us/op 0.61
effectiveBalanceIncrements clone MutableVector 300000 369.00 ns/op 414.00 ns/op 0.89
effectiveBalanceIncrements rw all Uint8Array 300000 166.38 us/op 184.02 us/op 0.90
effectiveBalanceIncrements rw all MutableVector 300000 83.980 ms/op 160.78 ms/op 0.52
phase0 afterProcessEpoch - 250000 vs - 7PWei 112.93 ms/op 138.73 ms/op 0.81
phase0 beforeProcessEpoch - 250000 vs - 7PWei 33.955 ms/op 54.400 ms/op 0.62
altair processEpoch - mainnet_e81889 327.69 ms/op 418.42 ms/op 0.78
mainnet_e81889 - altair beforeProcessEpoch 66.571 ms/op 100.92 ms/op 0.66
mainnet_e81889 - altair processJustificationAndFinalization 19.493 us/op 39.354 us/op 0.50
mainnet_e81889 - altair processInactivityUpdates 5.0648 ms/op 8.1918 ms/op 0.62
mainnet_e81889 - altair processRewardsAndPenalties 51.564 ms/op 87.563 ms/op 0.59
mainnet_e81889 - altair processRegistryUpdates 2.5040 us/op 5.9890 us/op 0.42
mainnet_e81889 - altair processSlashings 459.00 ns/op 1.4540 us/op 0.32
mainnet_e81889 - altair processEth1DataReset 495.00 ns/op 1.4880 us/op 0.33
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.1848 ms/op 4.6905 ms/op 0.25
mainnet_e81889 - altair processSlashingsReset 5.1450 us/op 14.240 us/op 0.36
mainnet_e81889 - altair processRandaoMixesReset 4.7550 us/op 6.6500 us/op 0.72
mainnet_e81889 - altair processHistoricalRootsUpdate 744.00 ns/op 2.4640 us/op 0.30
mainnet_e81889 - altair processParticipationFlagUpdates 2.5200 us/op 8.3850 us/op 0.30
mainnet_e81889 - altair processSyncCommitteeUpdates 481.00 ns/op 1.5200 us/op 0.32
mainnet_e81889 - altair afterProcessEpoch 116.82 ms/op 164.05 ms/op 0.71
phase0 processEpoch - mainnet_e58758 313.88 ms/op 503.21 ms/op 0.62
mainnet_e58758 - phase0 beforeProcessEpoch 122.20 ms/op 211.00 ms/op 0.58
mainnet_e58758 - phase0 processJustificationAndFinalization 15.977 us/op 25.647 us/op 0.62
mainnet_e58758 - phase0 processRewardsAndPenalties 52.446 ms/op 79.361 ms/op 0.66
mainnet_e58758 - phase0 processRegistryUpdates 8.2050 us/op 17.987 us/op 0.46
mainnet_e58758 - phase0 processSlashings 530.00 ns/op 1.4440 us/op 0.37
mainnet_e58758 - phase0 processEth1DataReset 540.00 ns/op 847.00 ns/op 0.64
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 940.10 us/op 1.4087 ms/op 0.67
mainnet_e58758 - phase0 processSlashingsReset 2.8140 us/op 7.7880 us/op 0.36
mainnet_e58758 - phase0 processRandaoMixesReset 4.3920 us/op 10.193 us/op 0.43
mainnet_e58758 - phase0 processHistoricalRootsUpdate 675.00 ns/op 1.8500 us/op 0.36
mainnet_e58758 - phase0 processParticipationRecordUpdates 7.1460 us/op 7.8540 us/op 0.91
mainnet_e58758 - phase0 afterProcessEpoch 92.914 ms/op 122.30 ms/op 0.76
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2351 ms/op 1.5551 ms/op 0.79
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4806 ms/op 1.6595 ms/op 0.89
altair processInactivityUpdates - 250000 normalcase 19.587 ms/op 25.836 ms/op 0.76
altair processInactivityUpdates - 250000 worstcase 21.807 ms/op 27.493 ms/op 0.79
phase0 processRegistryUpdates - 250000 normalcase 6.1750 us/op 8.3560 us/op 0.74
phase0 processRegistryUpdates - 250000 badcase_full_deposits 231.89 us/op 289.55 us/op 0.80
phase0 processRegistryUpdates - 250000 worstcase 0.5 120.68 ms/op 141.76 ms/op 0.85
altair processRewardsAndPenalties - 250000 normalcase 55.478 ms/op 71.832 ms/op 0.77
altair processRewardsAndPenalties - 250000 worstcase 47.253 ms/op 78.510 ms/op 0.60
phase0 getAttestationDeltas - 250000 normalcase 6.2206 ms/op 8.3068 ms/op 0.75
phase0 getAttestationDeltas - 250000 worstcase 6.1941 ms/op 7.2078 ms/op 0.86
phase0 processSlashings - 250000 worstcase 3.2801 ms/op 4.1729 ms/op 0.79
altair processSyncCommitteeUpdates - 250000 178.30 ms/op 198.47 ms/op 0.90
BeaconState.hashTreeRoot - No change 254.00 ns/op 376.00 ns/op 0.68
BeaconState.hashTreeRoot - 1 full validator 48.969 us/op 55.154 us/op 0.89
BeaconState.hashTreeRoot - 32 full validator 468.00 us/op 611.82 us/op 0.76
BeaconState.hashTreeRoot - 512 full validator 5.2833 ms/op 5.7844 ms/op 0.91
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 61.225 us/op 79.440 us/op 0.77
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 852.29 us/op 969.03 us/op 0.88
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 11.167 ms/op 13.342 ms/op 0.84
BeaconState.hashTreeRoot - 1 balances 45.769 us/op 56.077 us/op 0.82
BeaconState.hashTreeRoot - 32 balances 438.28 us/op 545.17 us/op 0.80
BeaconState.hashTreeRoot - 512 balances 4.2529 ms/op 4.8891 ms/op 0.87
BeaconState.hashTreeRoot - 250000 balances 72.392 ms/op 84.624 ms/op 0.86
aggregationBits - 2048 els - zipIndexesInBitList 16.774 us/op 18.165 us/op 0.92
regular array get 100000 times 32.429 us/op 48.003 us/op 0.68
wrappedArray get 100000 times 40.333 us/op 36.208 us/op 1.11
arrayWithProxy get 100000 times 15.129 ms/op 18.806 ms/op 0.80
ssz.Root.equals 517.00 ns/op 648.00 ns/op 0.80
byteArrayEquals 511.00 ns/op 635.00 ns/op 0.80
shuffle list - 16384 els 6.5748 ms/op 7.1492 ms/op 0.92
shuffle list - 250000 els 96.276 ms/op 104.03 ms/op 0.93
processSlot - 1 slots 8.4030 us/op 9.4190 us/op 0.89
processSlot - 32 slots 1.3026 ms/op 1.4028 ms/op 0.93
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 32.973 ms/op 37.577 ms/op 0.88
getCommitteeAssignments - req 1 vs - 250000 vc 2.7955 ms/op 3.0118 ms/op 0.93
getCommitteeAssignments - req 100 vs - 250000 vc 3.9691 ms/op 4.2533 ms/op 0.93
getCommitteeAssignments - req 1000 vs - 250000 vc 4.3425 ms/op 4.5951 ms/op 0.95
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.6800 ns/op 4.3000 ns/op 1.09
state getBlockRootAtSlot - 250000 vs - 7PWei 929.69 ns/op 924.74 ns/op 1.01
computeProposers - vc 250000 10.720 ms/op 10.781 ms/op 0.99
computeEpochShuffling - vc 250000 100.26 ms/op 104.74 ms/op 0.96
getNextSyncCommittee - vc 250000 176.19 ms/op 180.65 ms/op 0.98
computeSigningRoot for AttestationData 13.738 us/op 14.154 us/op 0.97
hash AttestationData serialized data then Buffer.toString(base64) 2.4475 us/op 2.4775 us/op 0.99
toHexString serialized data 1.0959 us/op 1.0962 us/op 1.00
Buffer.toString(base64) 319.58 ns/op 328.42 ns/op 0.97

by benchmarkbot/action

@nflaig nflaig merged commit 00877ee into unstable Jun 27, 2023
@nflaig nflaig deleted the mkeil/weak-subjectivity-docs branch June 27, 2023 07:50
@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.

3 participants