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: improve batch validator exit UX #6327

Merged
merged 1 commit into from
Jan 20, 2024
Merged

feat: improve batch validator exit UX #6327

merged 1 commit into from
Jan 20, 2024

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Jan 19, 2024

if there is an issue with one validator exit submission (most of the times already exited) other exits are not processed causing user frustration.

this PR processes all exits and console logs the status, and neatly handles the already exit scenarios of some of the validatoes which is what is what user faces most of the time

cc @barnabasbusa

@g11tech g11tech requested a review from a team as a code owner January 19, 2024 13:17
Copy link

codecov bot commented Jan 19, 2024

Codecov Report

Merging #6327 (6f07085) into unstable (2db7120) will decrease coverage by 0.02%.
The diff coverage is n/a.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #6327      +/-   ##
============================================
- Coverage     76.61%   76.59%   -0.02%     
============================================
  Files           248      248              
  Lines         25898    25907       +9     
  Branches       1448     1448              
============================================
+ Hits          19842    19844       +2     
- Misses         6026     6033       +7     
  Partials         30       30              

@barnabasbusa
Copy link

Bulk withdrawals: Screenshot 2024-01-19 at 14 27 22

Ran it one more time:

Voluntary exit errored for 0x8069cae6625b9db897c51808d29a662038228ddf449ba0756e27f6c21c44ff2e13cae5760e6030b91e1431027559cdf5 (2183) 1/100: Internal Server Error: VOLUNTARY_EXIT_ERROR_INVALID
Voluntary exit already submitted for 99/100
  - 0x80c1c1e2be166e969d86bfd99cfc6f6f44958d7c7d52d500d9a7b39a31792667f009c53c02403152f8b8d61bfe6c0f70 (2180)
  - 0x8289754e5fbff939d619f329b0fc5cbd8d259bd98cc9c7e58d619fb4f54fdc5b48b3c1abb2a514e442fe575c68af458f (2132)
  ....

Interesting to see that one of the validators (that have already exited) reports to be: 1/100: Internal Server Error: VOLUNTARY_EXIT_ERROR_INVALID

Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 03d72af Previous: 2db7120 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 766.67 us/op 736.57 us/op 1.04
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 116.47 us/op 106.78 us/op 1.09
BLS verify - blst-native 1.3747 ms/op 1.2986 ms/op 1.06
BLS verifyMultipleSignatures 3 - blst-native 2.8683 ms/op 2.7347 ms/op 1.05
BLS verifyMultipleSignatures 8 - blst-native 6.4141 ms/op 5.9769 ms/op 1.07
BLS verifyMultipleSignatures 32 - blst-native 23.256 ms/op 21.953 ms/op 1.06
BLS verifyMultipleSignatures 64 - blst-native 45.874 ms/op 43.329 ms/op 1.06
BLS verifyMultipleSignatures 128 - blst-native 90.561 ms/op 86.089 ms/op 1.05
BLS deserializing 10000 signatures 962.45 ms/op 925.41 ms/op 1.04
BLS deserializing 100000 signatures 9.5481 s/op 9.5280 s/op 1.00
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.3945 ms/op 1.3469 ms/op 1.04
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.5886 ms/op 1.5299 ms/op 1.04
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.4510 ms/op 2.8199 ms/op 0.87
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.6258 ms/op 4.8022 ms/op 0.76
BLS verifyMultipleSignatures - same message - 128 - blst-native 6.0273 ms/op 5.7440 ms/op 1.05
BLS aggregatePubkeys 32 - blst-native 27.171 us/op 26.473 us/op 1.03
BLS aggregatePubkeys 128 - blst-native 107.27 us/op 102.29 us/op 1.05
getAttestationsForBlock 68.364 ms/op 54.596 ms/op 1.25
getSlashingsAndExits - default max 264.98 us/op 171.34 us/op 1.55
getSlashingsAndExits - 2k 618.97 us/op 415.87 us/op 1.49
proposeBlockBody type=full, size=empty 7.6999 ms/op 5.3139 ms/op 1.45
isKnown best case - 1 super set check 744.00 ns/op 512.00 ns/op 1.45
isKnown normal case - 2 super set checks 752.00 ns/op 359.00 ns/op 2.09
isKnown worse case - 16 super set checks 743.00 ns/op 315.00 ns/op 2.36
CheckpointStateCache - add get delete 7.8500 us/op 4.8920 us/op 1.60
validate api signedAggregateAndProof - struct 3.1859 ms/op 2.7740 ms/op 1.15
validate gossip signedAggregateAndProof - struct 3.1220 ms/op 2.7897 ms/op 1.12
validate gossip attestation - vc 640000 1.6216 ms/op 1.3663 ms/op 1.19
batch validate gossip attestation - vc 640000 - chunk 32 210.52 us/op 172.20 us/op 1.22
batch validate gossip attestation - vc 640000 - chunk 64 197.16 us/op 151.73 us/op 1.30
batch validate gossip attestation - vc 640000 - chunk 128 191.17 us/op 148.69 us/op 1.29
batch validate gossip attestation - vc 640000 - chunk 256 174.64 us/op 132.70 us/op 1.32
pickEth1Vote - no votes 1.5605 ms/op 1.3804 ms/op 1.13
pickEth1Vote - max votes 17.236 ms/op 10.811 ms/op 1.59
pickEth1Vote - Eth1Data hashTreeRoot value x2048 29.747 ms/op 20.293 ms/op 1.47
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 34.347 ms/op 27.367 ms/op 1.26
pickEth1Vote - Eth1Data fastSerialize value x2048 893.36 us/op 701.15 us/op 1.27
pickEth1Vote - Eth1Data fastSerialize tree x2048 9.7370 ms/op 7.5143 ms/op 1.30
bytes32 toHexString 1.0290 us/op 578.00 ns/op 1.78
bytes32 Buffer.toString(hex) 563.00 ns/op 302.00 ns/op 1.86
bytes32 Buffer.toString(hex) from Uint8Array 830.00 ns/op 488.00 ns/op 1.70
bytes32 Buffer.toString(hex) + 0x 503.00 ns/op 304.00 ns/op 1.65
Object access 1 prop 0.28300 ns/op 0.20000 ns/op 1.41
Map access 1 prop 0.17100 ns/op 0.15400 ns/op 1.11
Object get x1000 8.2620 ns/op 7.9470 ns/op 1.04
Map get x1000 0.96100 ns/op 0.76000 ns/op 1.26
Object set x1000 80.254 ns/op 51.020 ns/op 1.57
Map set x1000 59.725 ns/op 41.317 ns/op 1.45
Return object 10000 times 0.27860 ns/op 0.24210 ns/op 1.15
Throw Error 10000 times 4.2254 us/op 3.8166 us/op 1.11
fastMsgIdFn sha256 / 200 bytes 3.7990 us/op 3.2970 us/op 1.15
fastMsgIdFn h32 xxhash / 200 bytes 398.00 ns/op 294.00 ns/op 1.35
fastMsgIdFn h64 xxhash / 200 bytes 429.00 ns/op 364.00 ns/op 1.18
fastMsgIdFn sha256 / 1000 bytes 12.986 us/op 11.566 us/op 1.12
fastMsgIdFn h32 xxhash / 1000 bytes 541.00 ns/op 440.00 ns/op 1.23
fastMsgIdFn h64 xxhash / 1000 bytes 523.00 ns/op 441.00 ns/op 1.19
fastMsgIdFn sha256 / 10000 bytes 119.83 us/op 103.20 us/op 1.16
fastMsgIdFn h32 xxhash / 10000 bytes 2.2310 us/op 1.9620 us/op 1.14
fastMsgIdFn h64 xxhash / 10000 bytes 1.5720 us/op 1.3480 us/op 1.17
send data - 1000 256B messages 25.751 ms/op 19.680 ms/op 1.31
send data - 1000 512B messages 33.134 ms/op 24.243 ms/op 1.37
send data - 1000 1024B messages 52.037 ms/op 43.434 ms/op 1.20
send data - 1000 1200B messages 51.710 ms/op 38.443 ms/op 1.35
send data - 1000 2048B messages 50.586 ms/op 47.237 ms/op 1.07
send data - 1000 4096B messages 30.494 ms/op 40.468 ms/op 0.75
send data - 1000 16384B messages 118.11 ms/op 116.25 ms/op 1.02
send data - 1000 65536B messages 543.58 ms/op 508.89 ms/op 1.07
enrSubnets - fastDeserialize 64 bits 1.7770 us/op 1.2290 us/op 1.45
enrSubnets - ssz BitVector 64 bits 578.00 ns/op 427.00 ns/op 1.35
enrSubnets - fastDeserialize 4 bits 238.00 ns/op 164.00 ns/op 1.45
enrSubnets - ssz BitVector 4 bits 546.00 ns/op 409.00 ns/op 1.33
prioritizePeers score -10:0 att 32-0.1 sync 2-0 124.32 us/op 100.67 us/op 1.23
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 162.85 us/op 129.04 us/op 1.26
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 200.61 us/op 176.49 us/op 1.14
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 372.96 us/op 302.90 us/op 1.23
prioritizePeers score 0:0 att 64-1 sync 4-1 423.67 us/op 349.63 us/op 1.21
array of 16000 items push then shift 1.8047 us/op 1.6142 us/op 1.12
LinkedList of 16000 items push then shift 10.249 ns/op 8.7790 ns/op 1.17
array of 16000 items push then pop 134.35 ns/op 92.025 ns/op 1.46
LinkedList of 16000 items push then pop 9.6410 ns/op 8.7410 ns/op 1.10
array of 24000 items push then shift 2.7330 us/op 2.4574 us/op 1.11
LinkedList of 24000 items push then shift 10.455 ns/op 8.7650 ns/op 1.19
array of 24000 items push then pop 160.11 ns/op 116.77 ns/op 1.37
LinkedList of 24000 items push then pop 9.5130 ns/op 8.4730 ns/op 1.12
intersect bitArray bitLen 8 6.9070 ns/op 6.1730 ns/op 1.12
intersect array and set length 8 100.90 ns/op 60.485 ns/op 1.67
intersect bitArray bitLen 128 36.691 ns/op 33.317 ns/op 1.10
intersect array and set length 128 1.1337 us/op 902.86 ns/op 1.26
bitArray.getTrueBitIndexes() bitLen 128 1.9760 us/op 1.4880 us/op 1.33
bitArray.getTrueBitIndexes() bitLen 248 3.2420 us/op 2.3410 us/op 1.38
bitArray.getTrueBitIndexes() bitLen 512 6.7650 us/op 4.6700 us/op 1.45
Buffer.concat 32 items 1.1390 us/op 1.0120 us/op 1.13
Uint8Array.set 32 items 2.6890 us/op 1.9720 us/op 1.36
Set add up to 64 items then delete first 5.7410 us/op 4.4104 us/op 1.30
OrderedSet add up to 64 items then delete first 7.7737 us/op 5.6100 us/op 1.39
Set add up to 64 items then delete last 6.1767 us/op 4.7044 us/op 1.31
OrderedSet add up to 64 items then delete last 7.8111 us/op 5.9024 us/op 1.32
Set add up to 64 items then delete middle 5.8232 us/op 4.6269 us/op 1.26
OrderedSet add up to 64 items then delete middle 9.4353 us/op 7.1678 us/op 1.32
Set add up to 128 items then delete first 11.962 us/op 9.3366 us/op 1.28
OrderedSet add up to 128 items then delete first 16.488 us/op 12.512 us/op 1.32
Set add up to 128 items then delete last 11.703 us/op 9.1703 us/op 1.28
OrderedSet add up to 128 items then delete last 15.438 us/op 11.619 us/op 1.33
Set add up to 128 items then delete middle 11.703 us/op 9.0540 us/op 1.29
OrderedSet add up to 128 items then delete middle 21.321 us/op 16.933 us/op 1.26
Set add up to 256 items then delete first 23.771 us/op 19.528 us/op 1.22
OrderedSet add up to 256 items then delete first 33.453 us/op 28.219 us/op 1.19
Set add up to 256 items then delete last 23.327 us/op 19.767 us/op 1.18
OrderedSet add up to 256 items then delete last 31.461 us/op 23.292 us/op 1.35
Set add up to 256 items then delete middle 23.687 us/op 18.278 us/op 1.30
OrderedSet add up to 256 items then delete middle 56.095 us/op 45.075 us/op 1.24
transfer serialized Status (84 B) 2.2200 us/op 1.6650 us/op 1.33
copy serialized Status (84 B) 1.6420 us/op 1.2520 us/op 1.31
transfer serialized SignedVoluntaryExit (112 B) 2.6100 us/op 1.8550 us/op 1.41
copy serialized SignedVoluntaryExit (112 B) 1.7770 us/op 1.3740 us/op 1.29
transfer serialized ProposerSlashing (416 B) 3.2000 us/op 2.4920 us/op 1.28
copy serialized ProposerSlashing (416 B) 2.7240 us/op 2.6590 us/op 1.02
transfer serialized Attestation (485 B) 3.3590 us/op 3.2050 us/op 1.05
copy serialized Attestation (485 B) 2.7890 us/op 2.8960 us/op 0.96
transfer serialized AttesterSlashing (33232 B) 3.1880 us/op 3.0290 us/op 1.05
copy serialized AttesterSlashing (33232 B) 9.9900 us/op 6.3360 us/op 1.58
transfer serialized Small SignedBeaconBlock (128000 B) 3.3720 us/op 2.9850 us/op 1.13
copy serialized Small SignedBeaconBlock (128000 B) 29.058 us/op 14.834 us/op 1.96
transfer serialized Avg SignedBeaconBlock (200000 B) 3.9260 us/op 2.8250 us/op 1.39
copy serialized Avg SignedBeaconBlock (200000 B) 39.935 us/op 30.191 us/op 1.32
transfer serialized BlobsSidecar (524380 B) 4.6380 us/op 3.2670 us/op 1.42
copy serialized BlobsSidecar (524380 B) 127.44 us/op 96.383 us/op 1.32
transfer serialized Big SignedBeaconBlock (1000000 B) 4.5820 us/op 3.2910 us/op 1.39
copy serialized Big SignedBeaconBlock (1000000 B) 260.08 us/op 366.20 us/op 0.71
pass gossip attestations to forkchoice per slot 4.2795 ms/op 4.3233 ms/op 0.99
forkChoice updateHead vc 100000 bc 64 eq 0 848.53 us/op 761.49 us/op 1.11
forkChoice updateHead vc 600000 bc 64 eq 0 5.8239 ms/op 4.2206 ms/op 1.38
forkChoice updateHead vc 1000000 bc 64 eq 0 7.6629 ms/op 6.8921 ms/op 1.11
forkChoice updateHead vc 600000 bc 320 eq 0 6.4598 ms/op 4.2519 ms/op 1.52
forkChoice updateHead vc 600000 bc 1200 eq 0 4.7501 ms/op 4.4226 ms/op 1.07
forkChoice updateHead vc 600000 bc 7200 eq 0 5.7317 ms/op 5.2757 ms/op 1.09
forkChoice updateHead vc 600000 bc 64 eq 1000 11.818 ms/op 11.429 ms/op 1.03
forkChoice updateHead vc 600000 bc 64 eq 10000 12.536 ms/op 12.393 ms/op 1.01
forkChoice updateHead vc 600000 bc 64 eq 300000 17.627 ms/op 15.885 ms/op 1.11
computeDeltas 500000 validators 300 proto nodes 6.9121 ms/op 6.6687 ms/op 1.04
computeDeltas 500000 validators 1200 proto nodes 6.8965 ms/op 6.8137 ms/op 1.01
computeDeltas 500000 validators 7200 proto nodes 6.5667 ms/op 6.7639 ms/op 0.97
computeDeltas 750000 validators 300 proto nodes 10.031 ms/op 9.7864 ms/op 1.02
computeDeltas 750000 validators 1200 proto nodes 10.397 ms/op 9.9852 ms/op 1.04
computeDeltas 750000 validators 7200 proto nodes 10.247 ms/op 10.164 ms/op 1.01
computeDeltas 1400000 validators 300 proto nodes 19.992 ms/op 19.800 ms/op 1.01
computeDeltas 1400000 validators 1200 proto nodes 19.973 ms/op 18.898 ms/op 1.06
computeDeltas 1400000 validators 7200 proto nodes 19.564 ms/op 18.812 ms/op 1.04
computeDeltas 2100000 validators 300 proto nodes 29.373 ms/op 27.961 ms/op 1.05
computeDeltas 2100000 validators 1200 proto nodes 29.523 ms/op 28.909 ms/op 1.02
computeDeltas 2100000 validators 7200 proto nodes 29.531 ms/op 28.200 ms/op 1.05
altair processAttestation - 250000 vs - 7PWei normalcase 2.2244 ms/op 2.1891 ms/op 1.02
altair processAttestation - 250000 vs - 7PWei worstcase 3.2207 ms/op 3.4223 ms/op 0.94
altair processAttestation - setStatus - 1/6 committees join 184.84 us/op 143.46 us/op 1.29
altair processAttestation - setStatus - 1/3 committees join 357.92 us/op 275.28 us/op 1.30
altair processAttestation - setStatus - 1/2 committees join 503.20 us/op 382.97 us/op 1.31
altair processAttestation - setStatus - 2/3 committees join 613.13 us/op 478.88 us/op 1.28
altair processAttestation - setStatus - 4/5 committees join 828.41 us/op 667.86 us/op 1.24
altair processAttestation - setStatus - 100% committees join 971.33 us/op 775.32 us/op 1.25
altair processBlock - 250000 vs - 7PWei normalcase 11.331 ms/op 10.944 ms/op 1.04
altair processBlock - 250000 vs - 7PWei normalcase hashState 39.510 ms/op 34.056 ms/op 1.16
altair processBlock - 250000 vs - 7PWei worstcase 40.189 ms/op 38.901 ms/op 1.03
altair processBlock - 250000 vs - 7PWei worstcase hashState 102.76 ms/op 99.558 ms/op 1.03
phase0 processBlock - 250000 vs - 7PWei normalcase 3.0341 ms/op 6.7883 ms/op 0.45
phase0 processBlock - 250000 vs - 7PWei worstcase 33.742 ms/op 31.682 ms/op 1.07
altair processEth1Data - 250000 vs - 7PWei normalcase 737.20 us/op 654.38 us/op 1.13
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 18.140 us/op 15.588 us/op 1.16
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 83.382 us/op 46.251 us/op 1.80
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 18.819 us/op 33.924 us/op 0.55
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 16.515 us/op 14.123 us/op 1.17
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 220.70 us/op 218.80 us/op 1.01
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.9276 ms/op 1.5955 ms/op 1.21
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.3738 ms/op 1.8834 ms/op 1.26
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.9272 ms/op 1.8350 ms/op 1.05
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.9075 ms/op 3.8793 ms/op 1.27
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 3.2385 ms/op 2.8651 ms/op 1.13
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 6.7667 ms/op 5.6020 ms/op 1.21
Tree 40 250000 create 565.22 ms/op 419.16 ms/op 1.35
Tree 40 250000 get(125000) 225.32 ns/op 222.13 ns/op 1.01
Tree 40 250000 set(125000) 1.4537 us/op 1.1403 us/op 1.27
Tree 40 250000 toArray() 27.640 ms/op 22.889 ms/op 1.21
Tree 40 250000 iterate all - toArray() + loop 27.345 ms/op 23.495 ms/op 1.16
Tree 40 250000 iterate all - get(i) 81.907 ms/op 77.076 ms/op 1.06
MutableVector 250000 create 18.531 ms/op 12.072 ms/op 1.53
MutableVector 250000 get(125000) 7.4020 ns/op 6.8340 ns/op 1.08
MutableVector 250000 set(125000) 358.88 ns/op 348.28 ns/op 1.03
MutableVector 250000 toArray() 4.4534 ms/op 4.3115 ms/op 1.03
MutableVector 250000 iterate all - toArray() + loop 4.4850 ms/op 4.1133 ms/op 1.09
MutableVector 250000 iterate all - get(i) 1.8519 ms/op 1.6028 ms/op 1.16
Array 250000 create 3.9396 ms/op 3.8431 ms/op 1.03
Array 250000 clone - spread 1.6762 ms/op 1.6532 ms/op 1.01
Array 250000 get(125000) 1.3690 ns/op 1.3900 ns/op 0.98
Array 250000 set(125000) 5.8870 ns/op 5.7160 ns/op 1.03
Array 250000 iterate all - loop 179.94 us/op 180.98 us/op 0.99
effectiveBalanceIncrements clone Uint8Array 300000 58.219 us/op 62.834 us/op 0.93
effectiveBalanceIncrements clone MutableVector 300000 508.00 ns/op 477.00 ns/op 1.06
effectiveBalanceIncrements rw all Uint8Array 300000 217.50 us/op 216.70 us/op 1.00
effectiveBalanceIncrements rw all MutableVector 300000 112.40 ms/op 120.21 ms/op 0.93
phase0 afterProcessEpoch - 250000 vs - 7PWei 124.67 ms/op 121.00 ms/op 1.03
phase0 beforeProcessEpoch - 250000 vs - 7PWei 58.632 ms/op 43.861 ms/op 1.34
altair processEpoch - mainnet_e81889 557.36 ms/op 575.46 ms/op 0.97
mainnet_e81889 - altair beforeProcessEpoch 93.447 ms/op 96.783 ms/op 0.97
mainnet_e81889 - altair processJustificationAndFinalization 17.673 us/op 25.612 us/op 0.69
mainnet_e81889 - altair processInactivityUpdates 6.5115 ms/op 6.7508 ms/op 0.96
mainnet_e81889 - altair processRewardsAndPenalties 67.878 ms/op 69.496 ms/op 0.98
mainnet_e81889 - altair processRegistryUpdates 3.7140 us/op 3.9930 us/op 0.93
mainnet_e81889 - altair processSlashings 656.00 ns/op 491.00 ns/op 1.34
mainnet_e81889 - altair processEth1DataReset 857.00 ns/op 767.00 ns/op 1.12
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.5348 ms/op 1.6003 ms/op 0.96
mainnet_e81889 - altair processSlashingsReset 8.1000 us/op 6.2420 us/op 1.30
mainnet_e81889 - altair processRandaoMixesReset 7.4050 us/op 7.9520 us/op 0.93
mainnet_e81889 - altair processHistoricalRootsUpdate 1.0530 us/op 896.00 ns/op 1.18
mainnet_e81889 - altair processParticipationFlagUpdates 3.7150 us/op 4.7290 us/op 0.79
mainnet_e81889 - altair processSyncCommitteeUpdates 771.00 ns/op 1.3370 us/op 0.58
mainnet_e81889 - altair afterProcessEpoch 124.32 ms/op 132.10 ms/op 0.94
capella processEpoch - mainnet_e217614 2.1379 s/op 2.6790 s/op 0.80
mainnet_e217614 - capella beforeProcessEpoch 522.24 ms/op 579.95 ms/op 0.90
mainnet_e217614 - capella processJustificationAndFinalization 27.222 us/op 15.166 us/op 1.79
mainnet_e217614 - capella processInactivityUpdates 19.372 ms/op 18.625 ms/op 1.04
mainnet_e217614 - capella processRewardsAndPenalties 501.82 ms/op 414.22 ms/op 1.21
mainnet_e217614 - capella processRegistryUpdates 24.988 us/op 19.483 us/op 1.28
mainnet_e217614 - capella processSlashings 783.00 ns/op 471.00 ns/op 1.66
mainnet_e217614 - capella processEth1DataReset 842.00 ns/op 413.00 ns/op 2.04
mainnet_e217614 - capella processEffectiveBalanceUpdates 8.2705 ms/op 6.9391 ms/op 1.19
mainnet_e217614 - capella processSlashingsReset 3.4590 us/op 2.9950 us/op 1.15
mainnet_e217614 - capella processRandaoMixesReset 4.4030 us/op 4.3780 us/op 1.01
mainnet_e217614 - capella processHistoricalRootsUpdate 686.00 ns/op 416.00 ns/op 1.65
mainnet_e217614 - capella processParticipationFlagUpdates 1.5290 us/op 1.4060 us/op 1.09
mainnet_e217614 - capella afterProcessEpoch 317.72 ms/op 301.56 ms/op 1.05
phase0 processEpoch - mainnet_e58758 517.87 ms/op 414.53 ms/op 1.25
mainnet_e58758 - phase0 beforeProcessEpoch 129.50 ms/op 126.04 ms/op 1.03
mainnet_e58758 - phase0 processJustificationAndFinalization 18.306 us/op 16.199 us/op 1.13
mainnet_e58758 - phase0 processRewardsAndPenalties 51.808 ms/op 51.007 ms/op 1.02
mainnet_e58758 - phase0 processRegistryUpdates 12.040 us/op 13.473 us/op 0.89
mainnet_e58758 - phase0 processSlashings 604.00 ns/op 558.00 ns/op 1.08
mainnet_e58758 - phase0 processEth1DataReset 954.00 ns/op 389.00 ns/op 2.45
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.8619 ms/op 1.1561 ms/op 1.61
mainnet_e58758 - phase0 processSlashingsReset 4.5780 us/op 4.0220 us/op 1.14
mainnet_e58758 - phase0 processRandaoMixesReset 4.8100 us/op 6.0730 us/op 0.79
mainnet_e58758 - phase0 processHistoricalRootsUpdate 948.00 ns/op 609.00 ns/op 1.56
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.4320 us/op 4.8200 us/op 0.92
mainnet_e58758 - phase0 afterProcessEpoch 108.64 ms/op 96.211 ms/op 1.13
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.6158 ms/op 1.4121 ms/op 1.14
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.6667 ms/op 1.5751 ms/op 1.06
altair processInactivityUpdates - 250000 normalcase 34.563 ms/op 29.510 ms/op 1.17
altair processInactivityUpdates - 250000 worstcase 29.441 ms/op 21.778 ms/op 1.35
phase0 processRegistryUpdates - 250000 normalcase 12.451 us/op 13.362 us/op 0.93
phase0 processRegistryUpdates - 250000 badcase_full_deposits 486.99 us/op 474.87 us/op 1.03
phase0 processRegistryUpdates - 250000 worstcase 0.5 165.32 ms/op 126.16 ms/op 1.31
altair processRewardsAndPenalties - 250000 normalcase 74.957 ms/op 58.318 ms/op 1.29
altair processRewardsAndPenalties - 250000 worstcase 86.112 ms/op 56.507 ms/op 1.52
phase0 getAttestationDeltas - 250000 normalcase 17.695 ms/op 12.337 ms/op 1.43
phase0 getAttestationDeltas - 250000 worstcase 16.135 ms/op 12.708 ms/op 1.27
phase0 processSlashings - 250000 worstcase 107.48 us/op 122.30 us/op 0.88
altair processSyncCommitteeUpdates - 250000 178.40 ms/op 169.22 ms/op 1.05
BeaconState.hashTreeRoot - No change 369.00 ns/op 787.00 ns/op 0.47
BeaconState.hashTreeRoot - 1 full validator 175.12 us/op 140.52 us/op 1.25
BeaconState.hashTreeRoot - 32 full validator 1.6439 ms/op 1.4482 ms/op 1.14
BeaconState.hashTreeRoot - 512 full validator 21.403 ms/op 18.432 ms/op 1.16
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 221.17 us/op 167.89 us/op 1.32
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.4836 ms/op 2.2951 ms/op 1.08
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 28.518 ms/op 42.441 ms/op 0.67
BeaconState.hashTreeRoot - 1 balances 129.47 us/op 164.32 us/op 0.79
BeaconState.hashTreeRoot - 32 balances 1.1661 ms/op 1.3654 ms/op 0.85
BeaconState.hashTreeRoot - 512 balances 11.269 ms/op 13.547 ms/op 0.83
BeaconState.hashTreeRoot - 250000 balances 192.26 ms/op 218.35 ms/op 0.88
aggregationBits - 2048 els - zipIndexesInBitList 19.693 us/op 19.673 us/op 1.00
byteArrayEquals 32 79.423 ns/op 77.188 ns/op 1.03
Buffer.compare 32 58.028 ns/op 56.063 ns/op 1.04
byteArrayEquals 1024 2.1665 us/op 2.0788 us/op 1.04
Buffer.compare 1024 73.763 ns/op 74.864 ns/op 0.99
byteArrayEquals 16384 34.352 us/op 33.107 us/op 1.04
Buffer.compare 16384 286.55 ns/op 276.20 ns/op 1.04
byteArrayEquals 123687377 262.53 ms/op 260.27 ms/op 1.01
Buffer.compare 123687377 7.8803 ms/op 8.4484 ms/op 0.93
byteArrayEquals 32 - diff last byte 77.892 ns/op 77.465 ns/op 1.01
Buffer.compare 32 - diff last byte 73.211 ns/op 59.642 ns/op 1.23
byteArrayEquals 1024 - diff last byte 2.1269 us/op 2.1742 us/op 0.98
Buffer.compare 1024 - diff last byte 85.995 ns/op 74.093 ns/op 1.16
byteArrayEquals 16384 - diff last byte 33.907 us/op 33.112 us/op 1.02
Buffer.compare 16384 - diff last byte 291.91 ns/op 271.73 ns/op 1.07
byteArrayEquals 123687377 - diff last byte 256.67 ms/op 251.25 ms/op 1.02
Buffer.compare 123687377 - diff last byte 6.3241 ms/op 8.0408 ms/op 0.79
byteArrayEquals 32 - random bytes 5.4200 ns/op 5.7840 ns/op 0.94
Buffer.compare 32 - random bytes 61.881 ns/op 63.802 ns/op 0.97
byteArrayEquals 1024 - random bytes 5.3190 ns/op 5.4600 ns/op 0.97
Buffer.compare 1024 - random bytes 61.470 ns/op 62.038 ns/op 0.99
byteArrayEquals 16384 - random bytes 5.3270 ns/op 5.9320 ns/op 0.90
Buffer.compare 16384 - random bytes 61.590 ns/op 60.077 ns/op 1.03
byteArrayEquals 123687377 - random bytes 8.7500 ns/op 8.3300 ns/op 1.05
Buffer.compare 123687377 - random bytes 65.110 ns/op 61.980 ns/op 1.05
regular array get 100000 times 45.486 us/op 44.679 us/op 1.02
wrappedArray get 100000 times 45.289 us/op 44.683 us/op 1.01
arrayWithProxy get 100000 times 14.417 ms/op 14.515 ms/op 0.99
ssz.Root.equals 55.545 ns/op 55.326 ns/op 1.00
byteArrayEquals 53.953 ns/op 54.536 ns/op 0.99
Buffer.compare 11.067 ns/op 11.508 ns/op 0.96
shuffle list - 16384 els 7.0557 ms/op 7.1020 ms/op 0.99
shuffle list - 250000 els 103.89 ms/op 104.16 ms/op 1.00
processSlot - 1 slots 17.659 us/op 16.974 us/op 1.04
processSlot - 32 slots 3.2132 ms/op 3.6258 ms/op 0.89
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 58.164 ms/op 55.085 ms/op 1.06
getCommitteeAssignments - req 1 vs - 250000 vc 2.6407 ms/op 2.4832 ms/op 1.06
getCommitteeAssignments - req 100 vs - 250000 vc 3.9351 ms/op 3.5669 ms/op 1.10
getCommitteeAssignments - req 1000 vs - 250000 vc 4.6155 ms/op 3.8554 ms/op 1.20
findModifiedValidators - 10000 modified validators 584.26 ms/op 521.43 ms/op 1.12
findModifiedValidators - 1000 modified validators 481.23 ms/op 427.43 ms/op 1.13
findModifiedValidators - 100 modified validators 441.54 ms/op 401.96 ms/op 1.10
findModifiedValidators - 10 modified validators 483.69 ms/op 446.17 ms/op 1.08
findModifiedValidators - 1 modified validators 453.22 ms/op 392.93 ms/op 1.15
findModifiedValidators - no difference 458.00 ms/op 422.97 ms/op 1.08
compare ViewDUs 5.8329 s/op 4.3951 s/op 1.33
compare each validator Uint8Array 2.4451 s/op 1.4423 s/op 1.70
compare ViewDU to Uint8Array 1.7177 s/op 1.3331 s/op 1.29
migrate state 1000000 validators, 24 modified, 0 new 939.63 ms/op 828.85 ms/op 1.13
migrate state 1000000 validators, 1700 modified, 1000 new 1.2576 s/op 1.1720 s/op 1.07
migrate state 1000000 validators, 3400 modified, 2000 new 1.6451 s/op 1.4498 s/op 1.13
migrate state 1500000 validators, 24 modified, 0 new 1.0247 s/op 993.22 ms/op 1.03
migrate state 1500000 validators, 1700 modified, 1000 new 1.3381 s/op 1.1004 s/op 1.22
migrate state 1500000 validators, 3400 modified, 2000 new 1.4131 s/op 1.3011 s/op 1.09
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.2600 ns/op 4.2300 ns/op 1.24
state getBlockRootAtSlot - 250000 vs - 7PWei 585.05 ns/op 760.47 ns/op 0.77
computeProposers - vc 250000 9.4758 ms/op 9.3263 ms/op 1.02
computeEpochShuffling - vc 250000 110.91 ms/op 103.32 ms/op 1.07
getNextSyncCommittee - vc 250000 177.24 ms/op 149.73 ms/op 1.18
computeSigningRoot for AttestationData 27.706 us/op 25.908 us/op 1.07
hash AttestationData serialized data then Buffer.toString(base64) 2.4620 us/op 2.2573 us/op 1.09
toHexString serialized data 1.2326 us/op 1.0464 us/op 1.18
Buffer.toString(base64) 264.91 ns/op 195.42 ns/op 1.36

by benchmarkbot/action

break;
const alreadySubmitted = [];
for (const [i, validatorToExit] of validatorsToExit.entries()) {
const {err} = await wrapError(processVoluntaryExit({config, client}, exitEpoch, validatorToExit));
Copy link
Member

Choose a reason for hiding this comment

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

If we wanted to support better logging, esp in the case an exit is already processed by the chain, we could modify isValidVoluntaryExit to return an enum value

export enum VoluntaryExitValidity {
  valid = "valid",
  inactive = "inactive",
  alreadyExited = "already_exited",
  earlyEpoch = "early_epoch",
  shortTimeActive = "short_time_active"
  invalidSignature = "invalid_signature"
}

export function isValidVoluntaryExit(
  state: CachedBeaconStateAllForks,
  signedVoluntaryExit: phase0.SignedVoluntaryExit,
  verifySignature = true
): boolean {
  const {config, epochCtx} = state;
  const voluntaryExit = signedVoluntaryExit.message;
  const validator = state.validators.get(voluntaryExit.validatorIndex);
  const currentEpoch = epochCtx.epoch;

  // verify the validator is active
  if(isActiveValidator(validator, currentEpoch) return VoluntaryExitValidity.inactive;
  ...

  return VoluntaryExitValidity.valid;
}

That enum value can get passed up into an error message / code and checked against for logging.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we can do it if requested by anyone, for now this suffices as the main aim was to process all the exits and not bail early even if one errored

Copy link
Member

Choose a reason for hiding this comment

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

Ok, lets make a low priority issue for it based on @barnabasbusa 's comment of:

Interesting to see that one of the validators (that have already exited) reports to be: 1/100: Internal Server Error: VOLUNTARY_EXIT_ERROR_INVALID

I read that "interesting to see" as "its weird/confusing/bad ux to see"

Choose a reason for hiding this comment

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

It's not great UX to show internal server error imho, but I'm happy the bulk exists just work! Happy to get it merged as is.

Copy link
Member

Choose a reason for hiding this comment

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

It's not great UX to show internal server error imho

The beacon node returning more user friendly errors could solve this as well, as per spec we should return a 400 (and not 500) error if voluntary exit is invalid.

break;
const alreadySubmitted = [];
for (const [i, validatorToExit] of validatorsToExit.entries()) {
const {err} = await wrapError(processVoluntaryExit({config, client}, exitEpoch, validatorToExit));
Copy link
Member

Choose a reason for hiding this comment

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

It's not great UX to show internal server error imho

The beacon node returning more user friendly errors could solve this as well, as per spec we should return a 400 (and not 500) error if voluntary exit is invalid.

@@ -2,3 +2,12 @@
* Expected error that shouldn't print a stack trace
*/
export class YargsError extends Error {}

export type Result<T> = {err: null; result: T} | {err: Error};
export async function wrapError<T>(promise: Promise<T>): Promise<Result<T>> {
Copy link
Member

Choose a reason for hiding this comment

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

This function already exists as part of beacon node utils

export async function wrapError<T>(promise: Promise<T>): Promise<Result<T>> {

Would make sense to move this to @lodestar/utils to make it more reusable across packages

@g11tech g11tech merged commit 0f375fa into unstable Jan 20, 2024
14 of 15 checks passed
@g11tech g11tech deleted the valexit-batchux branch January 20, 2024 13:05
ensi321 pushed a commit to ensi321/lodestar that referenced this pull request Jan 22, 2024
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.15.0 🎉

jeluard pushed a commit to jeluard/lodestar that referenced this pull request Jan 30, 2024
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