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

Make withdrawal probes bounded #4916

Merged
merged 6 commits into from
Dec 17, 2022
Merged

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Dec 16, 2022

Motivation

Spec 1.3.0-alpha 2

makes withdrawal probes bounded. This PR implements the same for upcoming withdrawals testnet.

@g11tech g11tech requested a review from a team as a code owner December 16, 2022 17:28
@github-actions
Copy link
Contributor

github-actions bot commented Dec 16, 2022

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: f902283 Previous: 65d6b22 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 981.59 us/op 968.95 us/op 1.01
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 59.228 us/op 60.054 us/op 0.99
BLS verify - blst-native 2.1767 ms/op 2.1752 ms/op 1.00
BLS verifyMultipleSignatures 3 - blst-native 4.4860 ms/op 4.4873 ms/op 1.00
BLS verifyMultipleSignatures 8 - blst-native 9.6922 ms/op 9.7037 ms/op 1.00
BLS verifyMultipleSignatures 32 - blst-native 35.220 ms/op 35.286 ms/op 1.00
BLS aggregatePubkeys 32 - blst-native 46.451 us/op 46.549 us/op 1.00
BLS aggregatePubkeys 128 - blst-native 182.38 us/op 182.26 us/op 1.00
getAttestationsForBlock 76.528 ms/op 78.535 ms/op 0.97
isKnown best case - 1 super set check 466.00 ns/op 446.00 ns/op 1.04
isKnown normal case - 2 super set checks 450.00 ns/op 433.00 ns/op 1.04
isKnown worse case - 16 super set checks 449.00 ns/op 434.00 ns/op 1.03
CheckpointStateCache - add get delete 8.2620 us/op 8.7010 us/op 0.95
validate gossip signedAggregateAndProof - struct 5.0170 ms/op 5.0189 ms/op 1.00
validate gossip attestation - struct 2.3652 ms/op 2.3601 ms/op 1.00
pickEth1Vote - no votes 2.1549 ms/op 2.1748 ms/op 0.99
pickEth1Vote - max votes 15.617 ms/op 16.048 ms/op 0.97
pickEth1Vote - Eth1Data hashTreeRoot value x2048 13.166 ms/op 13.561 ms/op 0.97
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 19.532 ms/op 21.752 ms/op 0.90
pickEth1Vote - Eth1Data fastSerialize value x2048 1.1053 ms/op 1.0869 ms/op 1.02
pickEth1Vote - Eth1Data fastSerialize tree x2048 9.5117 ms/op 9.8726 ms/op 0.96
bytes32 toHexString 894.00 ns/op 877.00 ns/op 1.02
bytes32 Buffer.toString(hex) 642.00 ns/op 630.00 ns/op 1.02
bytes32 Buffer.toString(hex) from Uint8Array 1.0090 us/op 991.00 ns/op 1.02
bytes32 Buffer.toString(hex) + 0x 607.00 ns/op 637.00 ns/op 0.95
Object access 1 prop 0.27500 ns/op 0.26900 ns/op 1.02
Map access 1 prop 0.26200 ns/op 0.26000 ns/op 1.01
Object get x1000 10.790 ns/op 10.505 ns/op 1.03
Map get x1000 0.93300 ns/op 0.93800 ns/op 0.99
Object set x1000 69.176 ns/op 70.236 ns/op 0.98
Map set x1000 40.564 ns/op 40.913 ns/op 0.99
Return object 10000 times 0.43180 ns/op 0.43710 ns/op 0.99
Throw Error 10000 times 6.6922 us/op 6.7112 us/op 1.00
fastMsgIdFn sha256 / 200 bytes 4.9190 us/op 4.8930 us/op 1.01
fastMsgIdFn h32 xxhash / 200 bytes 461.00 ns/op 464.00 ns/op 0.99
fastMsgIdFn h64 xxhash / 200 bytes 629.00 ns/op 643.00 ns/op 0.98
fastMsgIdFn sha256 / 1000 bytes 15.696 us/op 15.664 us/op 1.00
fastMsgIdFn h32 xxhash / 1000 bytes 635.00 ns/op 641.00 ns/op 0.99
fastMsgIdFn h64 xxhash / 1000 bytes 728.00 ns/op 736.00 ns/op 0.99
fastMsgIdFn sha256 / 10000 bytes 136.47 us/op 137.10 us/op 1.00
fastMsgIdFn h32 xxhash / 10000 bytes 2.5420 us/op 2.5580 us/op 0.99
fastMsgIdFn h64 xxhash / 10000 bytes 1.7660 us/op 1.7560 us/op 1.01
enrSubnets - fastDeserialize 64 bits 2.2140 us/op 2.1560 us/op 1.03
enrSubnets - ssz BitVector 64 bits 814.00 ns/op 793.00 ns/op 1.03
enrSubnets - fastDeserialize 4 bits 281.00 ns/op 290.00 ns/op 0.97
enrSubnets - ssz BitVector 4 bits 799.00 ns/op 810.00 ns/op 0.99
prioritizePeers score -10:0 att 32-0.1 sync 2-0 75.826 us/op 78.745 us/op 0.96
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 112.02 us/op 112.72 us/op 0.99
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 202.72 us/op 198.14 us/op 1.02
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 320.60 us/op 320.90 us/op 1.00
prioritizePeers score 0:0 att 64-1 sync 4-1 403.97 us/op 411.71 us/op 0.98
array of 16000 items push then shift 51.603 us/op 51.646 us/op 1.00
LinkedList of 16000 items push then shift 11.934 ns/op 12.642 ns/op 0.94
array of 16000 items push then pop 177.97 ns/op 186.38 ns/op 0.95
LinkedList of 16000 items push then pop 11.923 ns/op 11.997 ns/op 0.99
array of 24000 items push then shift 77.374 us/op 77.372 us/op 1.00
LinkedList of 24000 items push then shift 12.744 ns/op 12.888 ns/op 0.99
array of 24000 items push then pop 194.13 ns/op 196.37 ns/op 0.99
LinkedList of 24000 items push then pop 11.997 ns/op 12.095 ns/op 0.99
intersect bitArray bitLen 8 22.110 ns/op 21.672 ns/op 1.02
intersect array and set length 8 118.56 ns/op 119.76 ns/op 0.99
intersect bitArray bitLen 128 75.063 ns/op 71.161 ns/op 1.05
intersect array and set length 128 1.6193 us/op 1.6867 us/op 0.96
Buffer.concat 32 items 4.5120 us/op 4.8170 us/op 0.94
Uint8Array.set 32 items 3.5310 us/op 3.6380 us/op 0.97
pass gossip attestations to forkchoice per slot 3.7226 ms/op 3.7291 ms/op 1.00
computeDeltas 4.3047 ms/op 4.2986 ms/op 1.00
computeProposerBoostScoreFromBalances 2.4908 ms/op 2.5128 ms/op 0.99
altair processAttestation - 250000 vs - 7PWei normalcase 3.4240 ms/op 3.3065 ms/op 1.04
altair processAttestation - 250000 vs - 7PWei worstcase 5.9512 ms/op 5.1776 ms/op 1.15
altair processAttestation - setStatus - 1/6 committees join 174.76 us/op 177.25 us/op 0.99
altair processAttestation - setStatus - 1/3 committees join 351.70 us/op 355.33 us/op 0.99
altair processAttestation - setStatus - 1/2 committees join 515.38 us/op 518.25 us/op 0.99
altair processAttestation - setStatus - 2/3 committees join 666.15 us/op 679.46 us/op 0.98
altair processAttestation - setStatus - 4/5 committees join 930.89 us/op 941.87 us/op 0.99
altair processAttestation - setStatus - 100% committees join 1.1169 ms/op 1.1396 ms/op 0.98
altair processBlock - 250000 vs - 7PWei normalcase 23.557 ms/op 24.226 ms/op 0.97
altair processBlock - 250000 vs - 7PWei normalcase hashState 38.606 ms/op 31.316 ms/op 1.23
altair processBlock - 250000 vs - 7PWei worstcase 78.872 ms/op 87.305 ms/op 0.90
altair processBlock - 250000 vs - 7PWei worstcase hashState 110.99 ms/op 98.024 ms/op 1.13
phase0 processBlock - 250000 vs - 7PWei normalcase 3.2745 ms/op 3.2272 ms/op 1.01
phase0 processBlock - 250000 vs - 7PWei worstcase 51.708 ms/op 49.675 ms/op 1.04
altair processEth1Data - 250000 vs - 7PWei normalcase 623.58 us/op 633.87 us/op 0.98
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 7.8020 us/op 12.204 us/op 0.64
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 22.759 us/op 24.779 us/op 0.92
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 11.789 us/op 9.9030 us/op 1.19
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 8.9160 us/op 12.240 us/op 0.73
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 88.548 us/op 86.649 us/op 1.02
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 993.15 us/op 860.08 us/op 1.15
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 16384 1.1731 ms/op
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 16384 1.1194 ms/op
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 16384 4.0409 ms/op
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 16384 2.3438 ms/op
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 16384 6.7985 ms/op
Tree 40 250000 create 576.36 ms/op 601.94 ms/op 0.96
Tree 40 250000 get(125000) 237.96 ns/op 225.81 ns/op 1.05
Tree 40 250000 set(125000) 1.9175 us/op 1.9354 us/op 0.99
Tree 40 250000 toArray() 26.509 ms/op 25.858 ms/op 1.03
Tree 40 250000 iterate all - toArray() + loop 26.137 ms/op 24.307 ms/op 1.08
Tree 40 250000 iterate all - get(i) 106.90 ms/op 105.92 ms/op 1.01
MutableVector 250000 create 14.663 ms/op 13.039 ms/op 1.12
MutableVector 250000 get(125000) 10.651 ns/op 10.791 ns/op 0.99
MutableVector 250000 set(125000) 473.48 ns/op 483.29 ns/op 0.98
MutableVector 250000 toArray() 5.6251 ms/op 5.6738 ms/op 0.99
MutableVector 250000 iterate all - toArray() + loop 5.7958 ms/op 5.8541 ms/op 0.99
MutableVector 250000 iterate all - get(i) 2.7820 ms/op 2.6387 ms/op 1.05
Array 250000 create 5.4007 ms/op 5.6756 ms/op 0.95
Array 250000 clone - spread 2.5219 ms/op 2.3553 ms/op 1.07
Array 250000 get(125000) 1.1680 ns/op 1.1170 ns/op 1.05
Array 250000 set(125000) 1.1790 ns/op 1.1140 ns/op 1.06
Array 250000 iterate all - loop 150.89 us/op 150.93 us/op 1.00
effectiveBalanceIncrements clone Uint8Array 300000 44.366 us/op 40.899 us/op 1.08
effectiveBalanceIncrements clone MutableVector 300000 762.00 ns/op 733.00 ns/op 1.04
effectiveBalanceIncrements rw all Uint8Array 300000 243.94 us/op 243.88 us/op 1.00
effectiveBalanceIncrements rw all MutableVector 300000 157.61 ms/op 150.75 ms/op 1.05
phase0 afterProcessEpoch - 250000 vs - 7PWei 191.94 ms/op 190.07 ms/op 1.01
phase0 beforeProcessEpoch - 250000 vs - 7PWei 56.628 ms/op 55.758 ms/op 1.02
altair processEpoch - mainnet_e81889 531.51 ms/op 533.33 ms/op 1.00
mainnet_e81889 - altair beforeProcessEpoch 111.19 ms/op 119.53 ms/op 0.93
mainnet_e81889 - altair processJustificationAndFinalization 16.205 us/op 16.752 us/op 0.97
mainnet_e81889 - altair processInactivityUpdates 9.1086 ms/op 8.9330 ms/op 1.02
mainnet_e81889 - altair processRewardsAndPenalties 125.91 ms/op 76.652 ms/op 1.64
mainnet_e81889 - altair processRegistryUpdates 2.0010 us/op 4.2600 us/op 0.47
mainnet_e81889 - altair processSlashings 568.00 ns/op 1.3130 us/op 0.43
mainnet_e81889 - altair processEth1DataReset 570.00 ns/op 1.1590 us/op 0.49
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.9419 ms/op 2.1699 ms/op 0.89
mainnet_e81889 - altair processSlashingsReset 3.9040 us/op 8.6660 us/op 0.45
mainnet_e81889 - altair processRandaoMixesReset 4.0850 us/op 9.0320 us/op 0.45
mainnet_e81889 - altair processHistoricalRootsUpdate 593.00 ns/op 1.3870 us/op 0.43
mainnet_e81889 - altair processParticipationFlagUpdates 1.9840 us/op 3.7410 us/op 0.53
mainnet_e81889 - altair processSyncCommitteeUpdates 540.00 ns/op 1.1350 us/op 0.48
mainnet_e81889 - altair afterProcessEpoch 196.03 ms/op 197.54 ms/op 0.99
phase0 processEpoch - mainnet_e58758 481.52 ms/op 479.28 ms/op 1.00
mainnet_e58758 - phase0 beforeProcessEpoch 179.05 ms/op 185.85 ms/op 0.96
mainnet_e58758 - phase0 processJustificationAndFinalization 18.429 us/op 18.184 us/op 1.01
mainnet_e58758 - phase0 processRewardsAndPenalties 109.42 ms/op 98.361 ms/op 1.11
mainnet_e58758 - phase0 processRegistryUpdates 7.9440 us/op 7.5810 us/op 1.05
mainnet_e58758 - phase0 processSlashings 581.00 ns/op 536.00 ns/op 1.08
mainnet_e58758 - phase0 processEth1DataReset 571.00 ns/op 514.00 ns/op 1.11
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.6417 ms/op 1.7862 ms/op 0.92
mainnet_e58758 - phase0 processSlashingsReset 3.2660 us/op 3.3740 us/op 0.97
mainnet_e58758 - phase0 processRandaoMixesReset 3.9130 us/op 3.9580 us/op 0.99
mainnet_e58758 - phase0 processHistoricalRootsUpdate 612.00 ns/op 547.00 ns/op 1.12
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.4110 us/op 3.3890 us/op 1.01
mainnet_e58758 - phase0 afterProcessEpoch 162.21 ms/op 162.00 ms/op 1.00
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.9504 ms/op 1.9392 ms/op 1.01
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.1976 ms/op 2.3305 ms/op 0.94
altair processInactivityUpdates - 250000 normalcase 39.857 ms/op 38.662 ms/op 1.03
altair processInactivityUpdates - 250000 worstcase 33.739 ms/op 32.041 ms/op 1.05
phase0 processRegistryUpdates - 250000 normalcase 6.1640 us/op 10.325 us/op 0.60
phase0 processRegistryUpdates - 250000 badcase_full_deposits 375.88 us/op 387.26 us/op 0.97
phase0 processRegistryUpdates - 250000 worstcase 0.5 181.19 ms/op 168.66 ms/op 1.07
altair processRewardsAndPenalties - 250000 normalcase 76.230 ms/op 67.802 ms/op 1.12
altair processRewardsAndPenalties - 250000 worstcase 74.320 ms/op 104.83 ms/op 0.71
phase0 getAttestationDeltas - 250000 normalcase 12.035 ms/op 11.041 ms/op 1.09
phase0 getAttestationDeltas - 250000 worstcase 11.891 ms/op 11.129 ms/op 1.07
phase0 processSlashings - 250000 worstcase 5.0954 ms/op 5.1838 ms/op 0.98
altair processSyncCommitteeUpdates - 250000 287.27 ms/op 286.11 ms/op 1.00
BeaconState.hashTreeRoot - No change 511.00 ns/op 477.00 ns/op 1.07
BeaconState.hashTreeRoot - 1 full validator 70.374 us/op 74.523 us/op 0.94
BeaconState.hashTreeRoot - 32 full validator 742.99 us/op 697.06 us/op 1.07
BeaconState.hashTreeRoot - 512 full validator 7.6117 ms/op 7.1919 ms/op 1.06
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 90.565 us/op 88.222 us/op 1.03
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.2578 ms/op 1.2445 ms/op 1.01
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 19.377 ms/op 16.539 ms/op 1.17
BeaconState.hashTreeRoot - 1 balances 69.272 us/op 69.699 us/op 0.99
BeaconState.hashTreeRoot - 32 balances 655.70 us/op 713.23 us/op 0.92
BeaconState.hashTreeRoot - 512 balances 6.2301 ms/op 6.0898 ms/op 1.02
BeaconState.hashTreeRoot - 250000 balances 107.84 ms/op 99.200 ms/op 1.09
aggregationBits - 2048 els - zipIndexesInBitList 27.028 us/op 24.010 us/op 1.13
regular array get 100000 times 60.539 us/op 60.504 us/op 1.00
wrappedArray get 100000 times 60.537 us/op 60.711 us/op 1.00
arrayWithProxy get 100000 times 26.279 ms/op 26.239 ms/op 1.00
ssz.Root.equals 948.00 ns/op 924.00 ns/op 1.03
byteArrayEquals 931.00 ns/op 906.00 ns/op 1.03
shuffle list - 16384 els 11.414 ms/op 11.512 ms/op 0.99
shuffle list - 250000 els 168.50 ms/op 168.46 ms/op 1.00
processSlot - 1 slots 13.658 us/op 13.402 us/op 1.02
processSlot - 32 slots 1.9960 ms/op 1.9477 ms/op 1.02
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 352.67 us/op 323.12 us/op 1.09
getCommitteeAssignments - req 1 vs - 250000 vc 5.4315 ms/op 5.4335 ms/op 1.00
getCommitteeAssignments - req 100 vs - 250000 vc 7.9426 ms/op 7.9291 ms/op 1.00
getCommitteeAssignments - req 1000 vs - 250000 vc 8.4939 ms/op 8.5277 ms/op 1.00
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 7.6800 ns/op 7.3000 ns/op 1.05
state getBlockRootAtSlot - 250000 vs - 7PWei 1.2015 us/op 1.2491 us/op 0.96
computeProposers - vc 250000 17.150 ms/op 17.199 ms/op 1.00
computeEpochShuffling - vc 250000 170.37 ms/op 172.49 ms/op 0.99
getNextSyncCommittee - vc 250000 284.02 ms/op 281.03 ms/op 1.01

by benchmarkbot/action

@philknows philknows added this to the v1.3.0 milestone Dec 17, 2022
@twoeths
Copy link
Contributor

twoeths commented Dec 17, 2022

we should merge this first which skip eip4844 spec tests, then #4917

@g11tech g11tech merged commit d960f3e into unstable Dec 17, 2022
@g11tech g11tech deleted the g11tech/bounded-withdrawals branch December 17, 2022 18:48
@g11tech
Copy link
Contributor Author

g11tech commented Dec 17, 2022

we should merge this first which skip eip4844 spec tests, then #4917

yes, we can remove the corresponding code from #4917 and focus on passing the eip4844 spec vector fixes would be great

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