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

feat: add basic broadcast validation to the block publishing #5762

Merged
merged 10 commits into from
Aug 2, 2023

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Jul 16, 2023

implement

TODO:

  • use the new methods in validator publish calls with none param as default (expose via a cli option), primarily to support block publishing via fallback beacon nodes
  • add a cli option to beacon node for broadcast validation strickness - "warning" or "error" as the two options and use the accordingly in the validation part (warning as default)
  • for consensus vals
    • for the blocks (full or blinded produced from the same beacon node) keep a map in chain to check via beacon block hash
    • for blocks not produced via beacon, do a consensus val (state transition check)
  • instead of throwing right now if validation is not supported only log a warnng and change to throw as feature matures

@g11tech g11tech requested a review from a team as a code owner July 16, 2023 14:09
@g11tech g11tech mentioned this pull request Jul 16, 2023
5 tasks
@g11tech g11tech changed the title feat: add broadcast validation to the block publishing feat: add basic broadcast validation to the block publishing Jul 16, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 16, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 11f6d0b Previous: 19b723c Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 839.06 us/op 772.23 us/op 1.09
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 75.737 us/op 75.456 us/op 1.00
BLS verify - blst-native 1.2077 ms/op 1.2092 ms/op 1.00
BLS verifyMultipleSignatures 3 - blst-native 2.4553 ms/op 2.4736 ms/op 0.99
BLS verifyMultipleSignatures 8 - blst-native 5.2800 ms/op 5.3734 ms/op 0.98
BLS verifyMultipleSignatures 32 - blst-native 18.588 ms/op 19.118 ms/op 0.97
BLS aggregatePubkeys 32 - blst-native 24.503 us/op 25.582 us/op 0.96
BLS aggregatePubkeys 128 - blst-native 96.547 us/op 99.168 us/op 0.97
getAttestationsForBlock 59.668 ms/op 50.251 ms/op 1.19
isKnown best case - 1 super set check 265.00 ns/op 271.00 ns/op 0.98
isKnown normal case - 2 super set checks 263.00 ns/op 263.00 ns/op 1.00
isKnown worse case - 16 super set checks 260.00 ns/op 284.00 ns/op 0.92
CheckpointStateCache - add get delete 5.0930 us/op 4.7000 us/op 1.08
validate api signedAggregateAndProof - struct 3.1323 ms/op 2.7113 ms/op 1.16
validate gossip signedAggregateAndProof - struct 2.7026 ms/op 2.7131 ms/op 1.00
validate api attestation - struct 1.3656 ms/op 1.2954 ms/op 1.05
validate gossip attestation - struct 1.3017 ms/op 1.3149 ms/op 0.99
pickEth1Vote - no votes 1.1138 ms/op 1.1595 ms/op 0.96
pickEth1Vote - max votes 7.8835 ms/op 10.659 ms/op 0.74
pickEth1Vote - Eth1Data hashTreeRoot value x2048 8.1913 ms/op 8.5414 ms/op 0.96
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 17.766 ms/op 14.207 ms/op 1.25
pickEth1Vote - Eth1Data fastSerialize value x2048 580.10 us/op 562.29 us/op 1.03
pickEth1Vote - Eth1Data fastSerialize tree x2048 5.2826 ms/op 6.5854 ms/op 0.80
bytes32 toHexString 453.00 ns/op 486.00 ns/op 0.93
bytes32 Buffer.toString(hex) 279.00 ns/op 294.00 ns/op 0.95
bytes32 Buffer.toString(hex) from Uint8Array 417.00 ns/op 430.00 ns/op 0.97
bytes32 Buffer.toString(hex) + 0x 280.00 ns/op 298.00 ns/op 0.94
Object access 1 prop 0.14500 ns/op 0.15700 ns/op 0.92
Map access 1 prop 0.14700 ns/op 0.14300 ns/op 1.03
Object get x1000 6.9240 ns/op 7.7880 ns/op 0.89
Map get x1000 0.49700 ns/op 0.51400 ns/op 0.97
Object set x1000 48.069 ns/op 48.961 ns/op 0.98
Map set x1000 37.563 ns/op 38.750 ns/op 0.97
Return object 10000 times 0.23700 ns/op 0.23430 ns/op 1.01
Throw Error 10000 times 3.9751 us/op 3.8302 us/op 1.04
fastMsgIdFn sha256 / 200 bytes 3.2600 us/op 3.3130 us/op 0.98
fastMsgIdFn h32 xxhash / 200 bytes 275.00 ns/op 285.00 ns/op 0.96
fastMsgIdFn h64 xxhash / 200 bytes 339.00 ns/op 339.00 ns/op 1.00
fastMsgIdFn sha256 / 1000 bytes 11.253 us/op 11.251 us/op 1.00
fastMsgIdFn h32 xxhash / 1000 bytes 395.00 ns/op 414.00 ns/op 0.95
fastMsgIdFn h64 xxhash / 1000 bytes 408.00 ns/op 413.00 ns/op 0.99
fastMsgIdFn sha256 / 10000 bytes 102.74 us/op 103.33 us/op 0.99
fastMsgIdFn h32 xxhash / 10000 bytes 1.9240 us/op 1.9110 us/op 1.01
fastMsgIdFn h64 xxhash / 10000 bytes 1.3200 us/op 1.2980 us/op 1.02
enrSubnets - fastDeserialize 64 bits 1.2100 us/op 1.2210 us/op 0.99
enrSubnets - ssz BitVector 64 bits 408.00 ns/op 417.00 ns/op 0.98
enrSubnets - fastDeserialize 4 bits 162.00 ns/op 169.00 ns/op 0.96
enrSubnets - ssz BitVector 4 bits 416.00 ns/op 419.00 ns/op 0.99
prioritizePeers score -10:0 att 32-0.1 sync 2-0 99.527 us/op 96.667 us/op 1.03
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 126.12 us/op 132.24 us/op 0.95
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 161.44 us/op 165.05 us/op 0.98
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 272.80 us/op 288.00 us/op 0.95
prioritizePeers score 0:0 att 64-1 sync 4-1 325.40 us/op 335.54 us/op 0.97
array of 16000 items push then shift 1.5390 us/op 1.5907 us/op 0.97
LinkedList of 16000 items push then shift 8.6820 ns/op 8.9420 ns/op 0.97
array of 16000 items push then pop 54.053 ns/op 50.794 ns/op 1.06
LinkedList of 16000 items push then pop 8.4480 ns/op 8.4350 ns/op 1.00
array of 24000 items push then shift 2.4540 us/op 2.3434 us/op 1.05
LinkedList of 24000 items push then shift 8.6960 ns/op 8.5630 ns/op 1.02
array of 24000 items push then pop 89.285 ns/op 68.658 ns/op 1.30
LinkedList of 24000 items push then pop 8.3960 ns/op 8.5060 ns/op 0.99
intersect bitArray bitLen 8 6.6340 ns/op 6.7400 ns/op 0.98
intersect array and set length 8 54.180 ns/op 57.759 ns/op 0.94
intersect bitArray bitLen 128 31.189 ns/op 31.584 ns/op 0.99
intersect array and set length 128 729.54 ns/op 784.92 ns/op 0.93
bitArray.getTrueBitIndexes() bitLen 128 1.4120 us/op 1.4950 us/op 0.94
bitArray.getTrueBitIndexes() bitLen 248 2.4030 us/op 2.5520 us/op 0.94
bitArray.getTrueBitIndexes() bitLen 512 4.7280 us/op 4.8640 us/op 0.97
Buffer.concat 32 items 895.00 ns/op 1.0250 us/op 0.87
Uint8Array.set 32 items 2.0240 us/op 1.8930 us/op 1.07
transfer serialized Status (84 B) 1.8760 us/op 1.8460 us/op 1.02
copy serialized Status (84 B) 1.4700 us/op 1.5110 us/op 0.97
transfer serialized SignedVoluntaryExit (112 B) 1.8980 us/op 1.9650 us/op 0.97
copy serialized SignedVoluntaryExit (112 B) 1.5530 us/op 1.5820 us/op 0.98
transfer serialized ProposerSlashing (416 B) 2.3460 us/op 2.3650 us/op 0.99
copy serialized ProposerSlashing (416 B) 2.1190 us/op 2.2130 us/op 0.96
transfer serialized Attestation (485 B) 2.4500 us/op 2.3860 us/op 1.03
copy serialized Attestation (485 B) 2.1850 us/op 2.1920 us/op 1.00
transfer serialized AttesterSlashing (33232 B) 2.5280 us/op 2.5160 us/op 1.00
copy serialized AttesterSlashing (33232 B) 5.0600 us/op 4.6540 us/op 1.09
transfer serialized Small SignedBeaconBlock (128000 B) 2.6000 us/op 2.5950 us/op 1.00
copy serialized Small SignedBeaconBlock (128000 B) 14.742 us/op 11.326 us/op 1.30
transfer serialized Avg SignedBeaconBlock (200000 B) 3.0580 us/op 2.8410 us/op 1.08
copy serialized Avg SignedBeaconBlock (200000 B) 18.453 us/op 16.421 us/op 1.12
transfer serialized BlobsSidecar (524380 B) 2.7970 us/op 2.6100 us/op 1.07
copy serialized BlobsSidecar (524380 B) 84.205 us/op 112.55 us/op 0.75
transfer serialized Big SignedBeaconBlock (1000000 B) 2.8530 us/op 2.6740 us/op 1.07
copy serialized Big SignedBeaconBlock (1000000 B) 154.66 us/op 143.95 us/op 1.07
pass gossip attestations to forkchoice per slot 2.0990 ms/op 2.0369 ms/op 1.03
forkChoice updateHead vc 100000 bc 64 eq 0 2.0362 ms/op 2.0181 ms/op 1.01
forkChoice updateHead vc 600000 bc 64 eq 0 13.633 ms/op 13.460 ms/op 1.01
forkChoice updateHead vc 1000000 bc 64 eq 0 22.877 ms/op 21.844 ms/op 1.05
forkChoice updateHead vc 600000 bc 320 eq 0 16.530 ms/op 17.198 ms/op 0.96
forkChoice updateHead vc 600000 bc 1200 eq 0 83.269 ms/op 80.755 ms/op 1.03
forkChoice updateHead vc 600000 bc 64 eq 1000 22.309 ms/op 22.175 ms/op 1.01
forkChoice updateHead vc 600000 bc 64 eq 10000 23.524 ms/op 24.339 ms/op 0.97
forkChoice updateHead vc 600000 bc 64 eq 300000 28.911 ms/op 29.180 ms/op 0.99
computeDeltas 2.9483 ms/op 2.9503 ms/op 1.00
computeProposerBoostScoreFromBalances 376.85 us/op 384.86 us/op 0.98
altair processAttestation - 250000 vs - 7PWei normalcase 2.0783 ms/op 2.0761 ms/op 1.00
altair processAttestation - 250000 vs - 7PWei worstcase 3.3432 ms/op 3.1726 ms/op 1.05
altair processAttestation - setStatus - 1/6 committees join 216.88 us/op 238.06 us/op 0.91
altair processAttestation - setStatus - 1/3 committees join 415.35 us/op 416.74 us/op 1.00
altair processAttestation - setStatus - 1/2 committees join 589.43 us/op 593.36 us/op 0.99
altair processAttestation - setStatus - 2/3 committees join 692.25 us/op 754.87 us/op 0.92
altair processAttestation - setStatus - 4/5 committees join 968.80 us/op 991.22 us/op 0.98
altair processAttestation - setStatus - 100% committees join 1.1995 ms/op 1.1930 ms/op 1.01
altair processBlock - 250000 vs - 7PWei normalcase 9.3376 ms/op 9.2007 ms/op 1.01
altair processBlock - 250000 vs - 7PWei normalcase hashState 17.508 ms/op 16.968 ms/op 1.03
altair processBlock - 250000 vs - 7PWei worstcase 38.793 ms/op 36.412 ms/op 1.07
altair processBlock - 250000 vs - 7PWei worstcase hashState 61.711 ms/op 57.850 ms/op 1.07
phase0 processBlock - 250000 vs - 7PWei normalcase 1.8730 ms/op 1.9233 ms/op 0.97
phase0 processBlock - 250000 vs - 7PWei worstcase 27.382 ms/op 27.850 ms/op 0.98
altair processEth1Data - 250000 vs - 7PWei normalcase 426.93 us/op 487.17 us/op 0.88
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 11.701 us/op 9.1750 us/op 1.28
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 76.402 us/op 49.336 us/op 1.55
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 17.187 us/op 15.560 us/op 1.10
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 15.675 us/op 7.1280 us/op 2.20
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 282.64 us/op 126.64 us/op 2.23
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.5680 ms/op 1.0489 ms/op 1.49
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.1454 ms/op 1.4673 ms/op 1.46
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.0608 ms/op 1.4084 ms/op 1.46
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.2568 ms/op 2.8806 ms/op 1.13
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 3.5252 ms/op 2.3301 ms/op 1.51
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.9191 ms/op 4.9232 ms/op 1.00
Tree 40 250000 create 321.29 ms/op 291.91 ms/op 1.10
Tree 40 250000 get(125000) 190.47 ns/op 192.20 ns/op 0.99
Tree 40 250000 set(125000) 847.17 ns/op 840.51 ns/op 1.01
Tree 40 250000 toArray() 16.536 ms/op 17.658 ms/op 0.94
Tree 40 250000 iterate all - toArray() + loop 16.583 ms/op 18.109 ms/op 0.92
Tree 40 250000 iterate all - get(i) 63.275 ms/op 65.648 ms/op 0.96
MutableVector 250000 create 13.425 ms/op 11.733 ms/op 1.14
MutableVector 250000 get(125000) 6.4070 ns/op 6.4960 ns/op 0.99
MutableVector 250000 set(125000) 242.95 ns/op 252.85 ns/op 0.96
MutableVector 250000 toArray() 3.0118 ms/op 2.7413 ms/op 1.10
MutableVector 250000 iterate all - toArray() + loop 3.6740 ms/op 2.9264 ms/op 1.26
MutableVector 250000 iterate all - get(i) 1.5400 ms/op 1.5347 ms/op 1.00
Array 250000 create 2.9896 ms/op 2.5461 ms/op 1.17
Array 250000 clone - spread 1.1156 ms/op 1.1248 ms/op 0.99
Array 250000 get(125000) 0.56200 ns/op 0.55600 ns/op 1.01
Array 250000 set(125000) 0.63100 ns/op 0.62900 ns/op 1.00
Array 250000 iterate all - loop 82.226 us/op 79.735 us/op 1.03
effectiveBalanceIncrements clone Uint8Array 300000 24.199 us/op 25.705 us/op 0.94
effectiveBalanceIncrements clone MutableVector 300000 327.00 ns/op 335.00 ns/op 0.98
effectiveBalanceIncrements rw all Uint8Array 300000 178.49 us/op 173.48 us/op 1.03
effectiveBalanceIncrements rw all MutableVector 300000 77.127 ms/op 78.684 ms/op 0.98
phase0 afterProcessEpoch - 250000 vs - 7PWei 115.72 ms/op 112.18 ms/op 1.03
phase0 beforeProcessEpoch - 250000 vs - 7PWei 40.457 ms/op 30.511 ms/op 1.33
altair processEpoch - mainnet_e81889 360.78 ms/op 315.03 ms/op 1.15
mainnet_e81889 - altair beforeProcessEpoch 64.191 ms/op 58.395 ms/op 1.10
mainnet_e81889 - altair processJustificationAndFinalization 22.468 us/op 13.324 us/op 1.69
mainnet_e81889 - altair processInactivityUpdates 5.4508 ms/op 5.3442 ms/op 1.02
mainnet_e81889 - altair processRewardsAndPenalties 88.687 ms/op 62.663 ms/op 1.42
mainnet_e81889 - altair processRegistryUpdates 3.0900 us/op 2.3690 us/op 1.30
mainnet_e81889 - altair processSlashings 713.00 ns/op 400.00 ns/op 1.78
mainnet_e81889 - altair processEth1DataReset 759.00 ns/op 507.00 ns/op 1.50
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.3784 ms/op 1.2134 ms/op 1.96
mainnet_e81889 - altair processSlashingsReset 3.6890 us/op 2.7880 us/op 1.32
mainnet_e81889 - altair processRandaoMixesReset 7.7390 us/op 4.9070 us/op 1.58
mainnet_e81889 - altair processHistoricalRootsUpdate 1.2130 us/op 852.00 ns/op 1.42
mainnet_e81889 - altair processParticipationFlagUpdates 2.4630 us/op 1.9910 us/op 1.24
mainnet_e81889 - altair processSyncCommitteeUpdates 928.00 ns/op 543.00 ns/op 1.71
mainnet_e81889 - altair afterProcessEpoch 125.82 ms/op 124.65 ms/op 1.01
capella processEpoch - mainnet_e217614 1.0947 s/op 1.0235 s/op 1.07
mainnet_e217614 - capella beforeProcessEpoch 239.81 ms/op 218.86 ms/op 1.10
mainnet_e217614 - capella processJustificationAndFinalization 21.285 us/op 14.202 us/op 1.50
mainnet_e217614 - capella processInactivityUpdates 16.216 ms/op 19.071 ms/op 0.85
mainnet_e217614 - capella processRewardsAndPenalties 347.67 ms/op 282.90 ms/op 1.23
mainnet_e217614 - capella processRegistryUpdates 25.734 us/op 16.740 us/op 1.54
mainnet_e217614 - capella processSlashings 754.00 ns/op 475.00 ns/op 1.59
mainnet_e217614 - capella processEth1DataReset 673.00 ns/op 452.00 ns/op 1.49
mainnet_e217614 - capella processEffectiveBalanceUpdates 3.9448 ms/op 3.9466 ms/op 1.00
mainnet_e217614 - capella processSlashingsReset 2.0630 us/op 2.1860 us/op 0.94
mainnet_e217614 - capella processRandaoMixesReset 5.5130 us/op 3.6940 us/op 1.49
mainnet_e217614 - capella processHistoricalRootsUpdate 1.0160 us/op 546.00 ns/op 1.86
mainnet_e217614 - capella processParticipationFlagUpdates 3.1820 us/op 1.6230 us/op 1.96
mainnet_e217614 - capella afterProcessEpoch 291.84 ms/op 294.70 ms/op 0.99
phase0 processEpoch - mainnet_e58758 381.22 ms/op 320.02 ms/op 1.19
mainnet_e58758 - phase0 beforeProcessEpoch 127.14 ms/op 114.76 ms/op 1.11
mainnet_e58758 - phase0 processJustificationAndFinalization 22.473 us/op 14.577 us/op 1.54
mainnet_e58758 - phase0 processRewardsAndPenalties 73.011 ms/op 53.374 ms/op 1.37
mainnet_e58758 - phase0 processRegistryUpdates 8.5510 us/op 9.4150 us/op 0.91
mainnet_e58758 - phase0 processSlashings 769.00 ns/op 504.00 ns/op 1.53
mainnet_e58758 - phase0 processEth1DataReset 643.00 ns/op 424.00 ns/op 1.52
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.9445 ms/op 940.48 us/op 2.07
mainnet_e58758 - phase0 processSlashingsReset 3.1550 us/op 2.0910 us/op 1.51
mainnet_e58758 - phase0 processRandaoMixesReset 5.8150 us/op 3.7730 us/op 1.54
mainnet_e58758 - phase0 processHistoricalRootsUpdate 714.00 ns/op 587.00 ns/op 1.22
mainnet_e58758 - phase0 processParticipationRecordUpdates 5.4170 us/op 3.3140 us/op 1.63
mainnet_e58758 - phase0 afterProcessEpoch 92.875 ms/op 100.72 ms/op 0.92
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.1339 ms/op 1.1883 ms/op 0.95
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.6499 ms/op 1.4424 ms/op 1.84
altair processInactivityUpdates - 250000 normalcase 25.125 ms/op 18.413 ms/op 1.36
altair processInactivityUpdates - 250000 worstcase 26.699 ms/op 20.601 ms/op 1.30
phase0 processRegistryUpdates - 250000 normalcase 7.7340 us/op 8.6520 us/op 0.89
phase0 processRegistryUpdates - 250000 badcase_full_deposits 623.85 us/op 307.09 us/op 2.03
phase0 processRegistryUpdates - 250000 worstcase 0.5 117.21 ms/op 123.62 ms/op 0.95
altair processRewardsAndPenalties - 250000 normalcase 78.236 ms/op 57.403 ms/op 1.36
altair processRewardsAndPenalties - 250000 worstcase 75.353 ms/op 56.468 ms/op 1.33
phase0 getAttestationDeltas - 250000 normalcase 7.5521 ms/op 7.5840 ms/op 1.00
phase0 getAttestationDeltas - 250000 worstcase 7.7239 ms/op 7.6661 ms/op 1.01
phase0 processSlashings - 250000 worstcase 2.1579 ms/op 2.1955 ms/op 0.98
altair processSyncCommitteeUpdates - 250000 146.04 ms/op 139.13 ms/op 1.05
BeaconState.hashTreeRoot - No change 292.00 ns/op 278.00 ns/op 1.05
BeaconState.hashTreeRoot - 1 full validator 49.552 us/op 47.548 us/op 1.04
BeaconState.hashTreeRoot - 32 full validator 483.02 us/op 462.29 us/op 1.04
BeaconState.hashTreeRoot - 512 full validator 5.0616 ms/op 4.8522 ms/op 1.04
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 59.152 us/op 57.723 us/op 1.02
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 834.71 us/op 790.89 us/op 1.06
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 10.095 ms/op 9.7362 ms/op 1.04
BeaconState.hashTreeRoot - 1 balances 46.006 us/op 44.944 us/op 1.02
BeaconState.hashTreeRoot - 32 balances 409.57 us/op 400.38 us/op 1.02
BeaconState.hashTreeRoot - 512 balances 3.7684 ms/op 3.6808 ms/op 1.02
BeaconState.hashTreeRoot - 250000 balances 99.354 ms/op 73.866 ms/op 1.35
aggregationBits - 2048 els - zipIndexesInBitList 15.226 us/op 14.156 us/op 1.08
regular array get 100000 times 31.918 us/op 31.925 us/op 1.00
wrappedArray get 100000 times 31.823 us/op 42.530 us/op 0.75
arrayWithProxy get 100000 times 15.805 ms/op 13.905 ms/op 1.14
ssz.Root.equals 210.00 ns/op 202.00 ns/op 1.04
byteArrayEquals 212.00 ns/op 197.00 ns/op 1.08
shuffle list - 16384 els 6.7093 ms/op 6.7637 ms/op 0.99
shuffle list - 250000 els 98.350 ms/op 99.316 ms/op 0.99
processSlot - 1 slots 8.6720 us/op 7.4210 us/op 1.17
processSlot - 32 slots 1.2468 ms/op 1.2950 ms/op 0.96
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 51.498 ms/op 53.001 ms/op 0.97
getCommitteeAssignments - req 1 vs - 250000 vc 2.5261 ms/op 2.5032 ms/op 1.01
getCommitteeAssignments - req 100 vs - 250000 vc 3.7138 ms/op 3.6998 ms/op 1.00
getCommitteeAssignments - req 1000 vs - 250000 vc 3.8763 ms/op 4.0178 ms/op 0.96
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.6200 ns/op 4.4500 ns/op 1.04
state getBlockRootAtSlot - 250000 vs - 7PWei 702.52 ns/op 703.29 ns/op 1.00
computeProposers - vc 250000 8.7285 ms/op 8.4577 ms/op 1.03
computeEpochShuffling - vc 250000 101.21 ms/op 101.50 ms/op 1.00
getNextSyncCommittee - vc 250000 145.44 ms/op 140.68 ms/op 1.03
computeSigningRoot for AttestationData 13.152 us/op 12.793 us/op 1.03
hash AttestationData serialized data then Buffer.toString(base64) 2.2315 us/op 2.3185 us/op 0.96
toHexString serialized data 1.0761 us/op 1.0698 us/op 1.01
Buffer.toString(base64) 229.46 ns/op 215.96 ns/op 1.06

by benchmarkbot/action

dapplion
dapplion previously approved these changes Jul 20, 2023
Copy link
Contributor

@dapplion dapplion left a comment

Choose a reason for hiding this comment

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

This PR changes current behaviour that ignores broadcastValidation, to rejecting calls with values != consensus. I'm not sure if it's an strictly improvement, but I can see the reasoning why. Do you think there value in merging a throw before the full actual implementation?

@g11tech
Copy link
Contributor Author

g11tech commented Jul 21, 2023

This PR changes current behaviour that ignores broadcastValidation, to rejecting calls with values != consensus. I'm not sure if it's an strictly improvement, but I can see the reasoning why. Do you think there value in merging a throw before the full actual implementation?

added a flag to enforce strictness (mostly for dev purposes) I agree will push follow up PRs on this tracking here:

currently default broadCastValdaton requested by valdator s none as well as defaut strictness on beacon s warn. so should not impact current behavor but allow us to add valdatons n progressve manner (as per tracker above)

@@ -44,6 +44,13 @@ export type BlockHeaderResponse = {
header: phase0.SignedBeaconBlockHeader;
};

export enum BroadcastValidation {
none = "none",
Copy link
Member

Choose a reason for hiding this comment

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

according to the beacon APIs this shouldn't exist

Copy link
Contributor Author

@g11tech g11tech Jul 25, 2023

Choose a reason for hiding this comment

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

none is what our current case is, just added it for convenience and incase one doesn't want to actually do any validations before publishing... may be we can remove it later

packages/api/src/beacon/routes/beacon/block.ts Outdated Show resolved Hide resolved
@philknows philknows added this to the v1.10.0 milestone Jul 25, 2023
}
break;
}
case routes.beacon.BroadcastValidation.consensus: {
Copy link
Member

Choose a reason for hiding this comment

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

I think this PR should implement the different broadcast validations

Copy link
Contributor Author

Choose a reason for hiding this comment

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

would prefer to do followups unless you feel strongly about this

@philknows philknows modified the milestones: v1.10.0, v1.11.0 Jul 31, 2023
@g11tech g11tech merged commit f9821df into unstable Aug 2, 2023
12 checks passed
@g11tech g11tech deleted the g11tech/broadcast-val branch August 2, 2023 13:58
@wemeetagain
Copy link
Member

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

4 participants