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: consistently check no pending withdrawals when processing voluntary exit #7379

Merged
merged 2 commits into from
Jan 20, 2025

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Jan 20, 2025

Fixes another issue, we might build a block with an invalid voluntary exit since we haven't updated the check when building the block post-electra, only in state transition.

This was caught by pk910

Jan-19 22:03:13.017[api]              warn: Engine failed to produce the block slot=169, fork=electra, builderSelection=executiononly, isBuilderEnabled=false, isEngineEnabled=true, strictFeeRecipientCheck=false, builderBoostFactor=0, durationMs=5 - Invalid voluntary exit at forkSeq=5
Error: Invalid voluntary exit at forkSeq=5

Looking at the spec, it's pretty clear that those validations should be applied to gossip as well as block construction

From phase0 p2p / gossip spec here

[REJECT] All of the conditions within process_voluntary_exit pass validation.

which references process_voluntary_exit which was updated in electra here

assert get_pending_balance_to_withdraw(state, voluntary_exit.validator_index) == 0

Updating the existing isValidVoluntaryExit and adding the check there ensures we apply the check everywhere. It also follows the same order of checks now as in the spec, ie. run less expensive checks first.

Copy link

codecov bot commented Jan 20, 2025

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 48.63%. Comparing base (06831cf) to head (1366781).
Report is 3 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #7379      +/-   ##
============================================
+ Coverage     48.62%   48.63%   +0.01%     
============================================
  Files           603      603              
  Lines         40516    40506      -10     
  Branches       2071     2071              
============================================
  Hits          19700    19700              
+ Misses        20778    20768      -10     
  Partials         38       38              

Copy link
Contributor

github-actions bot commented Jan 20, 2025

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 8786d51 Previous: 06831cf Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.6776 ms/op 1.7507 ms/op 0.96
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 56.771 us/op 46.950 us/op 1.21
BLS verify - blst 943.29 us/op 983.98 us/op 0.96
BLS verifyMultipleSignatures 3 - blst 1.3586 ms/op 1.2295 ms/op 1.10
BLS verifyMultipleSignatures 8 - blst 1.5559 ms/op 1.8946 ms/op 0.82
BLS verifyMultipleSignatures 32 - blst 4.7106 ms/op 5.6728 ms/op 0.83
BLS verifyMultipleSignatures 64 - blst 8.6021 ms/op 11.067 ms/op 0.78
BLS verifyMultipleSignatures 128 - blst 16.504 ms/op 17.534 ms/op 0.94
BLS deserializing 10000 signatures 640.83 ms/op 696.53 ms/op 0.92
BLS deserializing 100000 signatures 6.3046 s/op 6.9720 s/op 0.90
BLS verifyMultipleSignatures - same message - 3 - blst 986.92 us/op 923.99 us/op 1.07
BLS verifyMultipleSignatures - same message - 8 - blst 1.0808 ms/op 1.1069 ms/op 0.98
BLS verifyMultipleSignatures - same message - 32 - blst 1.6813 ms/op 1.8766 ms/op 0.90
BLS verifyMultipleSignatures - same message - 64 - blst 2.5256 ms/op 2.6411 ms/op 0.96
BLS verifyMultipleSignatures - same message - 128 - blst 4.1830 ms/op 4.4469 ms/op 0.94
BLS aggregatePubkeys 32 - blst 18.429 us/op 19.903 us/op 0.93
BLS aggregatePubkeys 128 - blst 65.244 us/op 71.477 us/op 0.91
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 52.000 ms/op 61.814 ms/op 0.84
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 46.922 ms/op 59.550 ms/op 0.79
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 39.122 ms/op 49.640 ms/op 0.79
getSlashingsAndExits - default max 126.83 us/op 131.79 us/op 0.96
getSlashingsAndExits - 2k 486.29 us/op 434.87 us/op 1.12
proposeBlockBody type=full, size=empty 6.1883 ms/op 5.7538 ms/op 1.08
isKnown best case - 1 super set check 701.00 ns/op 269.00 ns/op 2.61
isKnown normal case - 2 super set checks 716.00 ns/op 258.00 ns/op 2.78
isKnown worse case - 16 super set checks 572.00 ns/op 259.00 ns/op 2.21
InMemoryCheckpointStateCache - add get delete 3.1080 us/op 2.5510 us/op 1.22
validate api signedAggregateAndProof - struct 1.5866 ms/op 1.4694 ms/op 1.08
validate gossip signedAggregateAndProof - struct 1.5115 ms/op 1.4483 ms/op 1.04
batch validate gossip attestation - vc 640000 - chunk 32 136.39 us/op 127.67 us/op 1.07
batch validate gossip attestation - vc 640000 - chunk 64 117.11 us/op 112.44 us/op 1.04
batch validate gossip attestation - vc 640000 - chunk 128 101.00 us/op 103.46 us/op 0.98
batch validate gossip attestation - vc 640000 - chunk 256 93.677 us/op 110.75 us/op 0.85
pickEth1Vote - no votes 851.70 us/op 1.0688 ms/op 0.80
pickEth1Vote - max votes 5.9012 ms/op 6.9442 ms/op 0.85
pickEth1Vote - Eth1Data hashTreeRoot value x2048 16.098 ms/op 20.736 ms/op 0.78
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 22.496 ms/op 25.418 ms/op 0.89
pickEth1Vote - Eth1Data fastSerialize value x2048 347.73 us/op 515.37 us/op 0.67
pickEth1Vote - Eth1Data fastSerialize tree x2048 3.7626 ms/op 3.3694 ms/op 1.12
bytes32 toHexString 616.00 ns/op 440.00 ns/op 1.40
bytes32 Buffer.toString(hex) 439.00 ns/op 234.00 ns/op 1.88
bytes32 Buffer.toString(hex) from Uint8Array 546.00 ns/op 364.00 ns/op 1.50
bytes32 Buffer.toString(hex) + 0x 424.00 ns/op 235.00 ns/op 1.80
Object access 1 prop 0.33100 ns/op 0.12700 ns/op 2.61
Map access 1 prop 0.31100 ns/op 0.13000 ns/op 2.39
Object get x1000 4.9670 ns/op 5.7080 ns/op 0.87
Map get x1000 5.7750 ns/op 6.1850 ns/op 0.93
Object set x1000 23.704 ns/op 33.875 ns/op 0.70
Map set x1000 19.093 ns/op 23.656 ns/op 0.81
Return object 10000 times 0.29580 ns/op 0.29340 ns/op 1.01
Throw Error 10000 times 2.6921 us/op 3.3922 us/op 0.79
toHex 103.12 ns/op 174.14 ns/op 0.59
Buffer.from 95.680 ns/op 148.31 ns/op 0.65
shared Buffer 60.788 ns/op 101.62 ns/op 0.60
fastMsgIdFn sha256 / 200 bytes 1.9310 us/op 2.2980 us/op 0.84
fastMsgIdFn h32 xxhash / 200 bytes 402.00 ns/op 259.00 ns/op 1.55
fastMsgIdFn h64 xxhash / 200 bytes 466.00 ns/op 271.00 ns/op 1.72
fastMsgIdFn sha256 / 1000 bytes 5.9260 us/op 7.5540 us/op 0.78
fastMsgIdFn h32 xxhash / 1000 bytes 581.00 ns/op 396.00 ns/op 1.47
fastMsgIdFn h64 xxhash / 1000 bytes 526.00 ns/op 346.00 ns/op 1.52
fastMsgIdFn sha256 / 10000 bytes 48.487 us/op 64.768 us/op 0.75
fastMsgIdFn h32 xxhash / 10000 bytes 1.9640 us/op 1.8410 us/op 1.07
fastMsgIdFn h64 xxhash / 10000 bytes 1.3330 us/op 1.1980 us/op 1.11
send data - 1000 256B messages 12.357 ms/op 11.654 ms/op 1.06
send data - 1000 512B messages 12.783 ms/op 18.581 ms/op 0.69
send data - 1000 1024B messages 20.528 ms/op 25.561 ms/op 0.80
send data - 1000 1200B messages 14.395 ms/op 26.575 ms/op 0.54
send data - 1000 2048B messages 28.528 ms/op 33.108 ms/op 0.86
send data - 1000 4096B messages 25.015 ms/op 31.326 ms/op 0.80
send data - 1000 16384B messages 66.194 ms/op 73.747 ms/op 0.90
send data - 1000 65536B messages 250.30 ms/op 201.74 ms/op 1.24
enrSubnets - fastDeserialize 64 bits 1.4210 us/op 1.0680 us/op 1.33
enrSubnets - ssz BitVector 64 bits 596.00 ns/op 354.00 ns/op 1.68
enrSubnets - fastDeserialize 4 bits 385.00 ns/op 148.00 ns/op 2.60
enrSubnets - ssz BitVector 4 bits 646.00 ns/op 342.00 ns/op 1.89
prioritizePeers score -10:0 att 32-0.1 sync 2-0 120.49 us/op 143.77 us/op 0.84
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 144.65 us/op 180.15 us/op 0.80
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 239.55 us/op 239.65 us/op 1.00
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 384.58 us/op 395.31 us/op 0.97
prioritizePeers score 0:0 att 64-1 sync 4-1 587.30 us/op 523.13 us/op 1.12
array of 16000 items push then shift 1.2908 us/op 1.5830 us/op 0.82
LinkedList of 16000 items push then shift 9.2150 ns/op 6.9440 ns/op 1.33
array of 16000 items push then pop 132.28 ns/op 90.495 ns/op 1.46
LinkedList of 16000 items push then pop 7.0790 ns/op 6.8460 ns/op 1.03
array of 24000 items push then shift 1.9648 us/op 2.3390 us/op 0.84
LinkedList of 24000 items push then shift 11.069 ns/op 6.9440 ns/op 1.59
array of 24000 items push then pop 154.18 ns/op 130.04 ns/op 1.19
LinkedList of 24000 items push then pop 6.8340 ns/op 7.1690 ns/op 0.95
intersect bitArray bitLen 8 6.2490 ns/op 6.5370 ns/op 0.96
intersect array and set length 8 40.432 ns/op 44.962 ns/op 0.90
intersect bitArray bitLen 128 27.952 ns/op 29.862 ns/op 0.94
intersect array and set length 128 573.80 ns/op 661.62 ns/op 0.87
bitArray.getTrueBitIndexes() bitLen 128 1.5340 us/op 1.4280 us/op 1.07
bitArray.getTrueBitIndexes() bitLen 248 2.8810 us/op 2.3110 us/op 1.25
bitArray.getTrueBitIndexes() bitLen 512 4.5050 us/op 4.5870 us/op 0.98
Buffer.concat 32 items 998.00 ns/op 855.00 ns/op 1.17
Uint8Array.set 32 items 1.8760 us/op 1.6460 us/op 1.14
Buffer.copy 2.5580 us/op 2.7200 us/op 0.94
Uint8Array.set - with subarray 2.5950 us/op 2.2170 us/op 1.17
Uint8Array.set - without subarray 1.4040 us/op 1.4700 us/op 0.96
getUint32 - dataview 417.00 ns/op 229.00 ns/op 1.82
getUint32 - manual 383.00 ns/op 153.00 ns/op 2.50
Set add up to 64 items then delete first 1.7877 us/op 2.1612 us/op 0.83
OrderedSet add up to 64 items then delete first 2.7630 us/op 3.2004 us/op 0.86
Set add up to 64 items then delete last 2.0028 us/op 2.4304 us/op 0.82
OrderedSet add up to 64 items then delete last 3.0709 us/op 3.5876 us/op 0.86
Set add up to 64 items then delete middle 2.0320 us/op 2.4918 us/op 0.82
OrderedSet add up to 64 items then delete middle 4.4722 us/op 5.1155 us/op 0.87
Set add up to 128 items then delete first 4.0446 us/op 5.1838 us/op 0.78
OrderedSet add up to 128 items then delete first 6.2040 us/op 7.5986 us/op 0.82
Set add up to 128 items then delete last 3.8521 us/op 4.8289 us/op 0.80
OrderedSet add up to 128 items then delete last 5.9194 us/op 7.2762 us/op 0.81
Set add up to 128 items then delete middle 3.8498 us/op 4.8385 us/op 0.80
OrderedSet add up to 128 items then delete middle 11.624 us/op 13.616 us/op 0.85
Set add up to 256 items then delete first 7.8763 us/op 10.098 us/op 0.78
OrderedSet add up to 256 items then delete first 12.569 us/op 15.869 us/op 0.79
Set add up to 256 items then delete last 7.6727 us/op 9.6884 us/op 0.79
OrderedSet add up to 256 items then delete last 11.594 us/op 14.538 us/op 0.80
Set add up to 256 items then delete middle 7.5791 us/op 9.5623 us/op 0.79
OrderedSet add up to 256 items then delete middle 34.371 us/op 40.974 us/op 0.84
transfer serialized Status (84 B) 2.2700 us/op 2.5380 us/op 0.89
copy serialized Status (84 B) 1.4050 us/op 1.2440 us/op 1.13
transfer serialized SignedVoluntaryExit (112 B) 2.4250 us/op 2.5400 us/op 0.95
copy serialized SignedVoluntaryExit (112 B) 1.4860 us/op 1.2680 us/op 1.17
transfer serialized ProposerSlashing (416 B) 2.8790 us/op 2.6400 us/op 1.09
copy serialized ProposerSlashing (416 B) 2.4240 us/op 1.4000 us/op 1.73
transfer serialized Attestation (485 B) 2.9670 us/op 2.8490 us/op 1.04
copy serialized Attestation (485 B) 2.5720 us/op 1.9690 us/op 1.31
transfer serialized AttesterSlashing (33232 B) 3.2900 us/op 3.2910 us/op 1.00
copy serialized AttesterSlashing (33232 B) 5.8990 us/op 5.0310 us/op 1.17
transfer serialized Small SignedBeaconBlock (128000 B) 3.2520 us/op 4.4830 us/op 0.73
copy serialized Small SignedBeaconBlock (128000 B) 9.9160 us/op 14.137 us/op 0.70
transfer serialized Avg SignedBeaconBlock (200000 B) 2.8660 us/op 4.8160 us/op 0.60
copy serialized Avg SignedBeaconBlock (200000 B) 11.999 us/op 19.553 us/op 0.61
transfer serialized BlobsSidecar (524380 B) 3.8770 us/op 4.0750 us/op 0.95
copy serialized BlobsSidecar (524380 B) 86.525 us/op 177.96 us/op 0.49
transfer serialized Big SignedBeaconBlock (1000000 B) 4.8630 us/op 4.3430 us/op 1.12
copy serialized Big SignedBeaconBlock (1000000 B) 157.49 us/op 150.86 us/op 1.04
pass gossip attestations to forkchoice per slot 2.4262 ms/op 2.7567 ms/op 0.88
forkChoice updateHead vc 100000 bc 64 eq 0 433.90 us/op 456.67 us/op 0.95
forkChoice updateHead vc 600000 bc 64 eq 0 2.5454 ms/op 3.3429 ms/op 0.76
forkChoice updateHead vc 1000000 bc 64 eq 0 4.0403 ms/op 4.8417 ms/op 0.83
forkChoice updateHead vc 600000 bc 320 eq 0 2.1768 ms/op 2.8573 ms/op 0.76
forkChoice updateHead vc 600000 bc 1200 eq 0 2.3123 ms/op 2.8911 ms/op 0.80
forkChoice updateHead vc 600000 bc 7200 eq 0 3.0639 ms/op 3.6141 ms/op 0.85
forkChoice updateHead vc 600000 bc 64 eq 1000 9.4572 ms/op 10.534 ms/op 0.90
forkChoice updateHead vc 600000 bc 64 eq 10000 9.1716 ms/op 10.486 ms/op 0.87
forkChoice updateHead vc 600000 bc 64 eq 300000 12.262 ms/op 14.028 ms/op 0.87
computeDeltas 500000 validators 300 proto nodes 3.3752 ms/op 4.1342 ms/op 0.82
computeDeltas 500000 validators 1200 proto nodes 3.5385 ms/op 4.2797 ms/op 0.83
computeDeltas 500000 validators 7200 proto nodes 3.4064 ms/op 5.0443 ms/op 0.68
computeDeltas 750000 validators 300 proto nodes 5.1647 ms/op 6.4580 ms/op 0.80
computeDeltas 750000 validators 1200 proto nodes 5.0584 ms/op 6.4997 ms/op 0.78
computeDeltas 750000 validators 7200 proto nodes 4.9108 ms/op 6.6634 ms/op 0.74
computeDeltas 1400000 validators 300 proto nodes 9.1572 ms/op 12.145 ms/op 0.75
computeDeltas 1400000 validators 1200 proto nodes 9.3154 ms/op 12.664 ms/op 0.74
computeDeltas 1400000 validators 7200 proto nodes 9.9183 ms/op 12.881 ms/op 0.77
computeDeltas 2100000 validators 300 proto nodes 16.164 ms/op 20.489 ms/op 0.79
computeDeltas 2100000 validators 1200 proto nodes 16.199 ms/op 19.227 ms/op 0.84
computeDeltas 2100000 validators 7200 proto nodes 17.362 ms/op 21.764 ms/op 0.80
altair processAttestation - 250000 vs - 7PWei normalcase 3.0283 ms/op 3.1560 ms/op 0.96
altair processAttestation - 250000 vs - 7PWei worstcase 4.1298 ms/op 3.9778 ms/op 1.04
altair processAttestation - setStatus - 1/6 committees join 128.21 us/op 152.67 us/op 0.84
altair processAttestation - setStatus - 1/3 committees join 250.39 us/op 285.59 us/op 0.88
altair processAttestation - setStatus - 1/2 committees join 306.94 us/op 387.68 us/op 0.79
altair processAttestation - setStatus - 2/3 committees join 390.01 us/op 517.32 us/op 0.75
altair processAttestation - setStatus - 4/5 committees join 602.61 us/op 691.87 us/op 0.87
altair processAttestation - setStatus - 100% committees join 655.06 us/op 764.08 us/op 0.86
altair processBlock - 250000 vs - 7PWei normalcase 5.6291 ms/op 5.2380 ms/op 1.07
altair processBlock - 250000 vs - 7PWei normalcase hashState 27.443 ms/op 29.182 ms/op 0.94
altair processBlock - 250000 vs - 7PWei worstcase 40.403 ms/op 41.337 ms/op 0.98
altair processBlock - 250000 vs - 7PWei worstcase hashState 75.991 ms/op 87.230 ms/op 0.87
phase0 processBlock - 250000 vs - 7PWei normalcase 2.7355 ms/op 2.0467 ms/op 1.34
phase0 processBlock - 250000 vs - 7PWei worstcase 28.470 ms/op 26.573 ms/op 1.07
altair processEth1Data - 250000 vs - 7PWei normalcase 365.02 us/op 448.01 us/op 0.81
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 12.234 us/op 11.277 us/op 1.08
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 58.332 us/op 58.652 us/op 0.99
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 22.293 us/op 23.448 us/op 0.95
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 14.400 us/op 11.999 us/op 1.20
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 204.86 us/op 229.13 us/op 0.89
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.1742 ms/op 1.9461 ms/op 0.60
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.2708 ms/op 2.1222 ms/op 0.60
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.3854 ms/op 1.9983 ms/op 0.69
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.6953 ms/op 6.2819 ms/op 0.75
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.4749 ms/op 2.0028 ms/op 1.24
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 8.3716 ms/op 6.0817 ms/op 1.38
Tree 40 250000 create 231.07 ms/op 280.07 ms/op 0.83
Tree 40 250000 get(125000) 141.52 ns/op 160.03 ns/op 0.88
Tree 40 250000 set(125000) 629.36 ns/op 702.79 ns/op 0.90
Tree 40 250000 toArray() 25.938 ms/op 21.092 ms/op 1.23
Tree 40 250000 iterate all - toArray() + loop 23.211 ms/op 20.966 ms/op 1.11
Tree 40 250000 iterate all - get(i) 55.582 ms/op 58.315 ms/op 0.95
Array 250000 create 3.9571 ms/op 3.8893 ms/op 1.02
Array 250000 clone - spread 1.4767 ms/op 1.4673 ms/op 1.01
Array 250000 get(125000) 0.60600 ns/op 0.43300 ns/op 1.40
Array 250000 set(125000) 0.61500 ns/op 0.46100 ns/op 1.33
Array 250000 iterate all - loop 80.508 us/op 103.87 us/op 0.78
phase0 afterProcessEpoch - 250000 vs - 7PWei 64.002 ms/op 52.860 ms/op 1.21
Array.fill - length 1000000 9.7112 ms/op 3.9239 ms/op 2.47
Array push - length 1000000 29.193 ms/op 21.329 ms/op 1.37
Array.get 0.28759 ns/op 0.28924 ns/op 0.99
Uint8Array.get 0.38932 ns/op 0.45635 ns/op 0.85
phase0 beforeProcessEpoch - 250000 vs - 7PWei 37.406 ms/op 21.419 ms/op 1.75
altair processEpoch - mainnet_e81889 327.93 ms/op 286.89 ms/op 1.14
mainnet_e81889 - altair beforeProcessEpoch 23.195 ms/op 18.919 ms/op 1.23
mainnet_e81889 - altair processJustificationAndFinalization 19.411 us/op 23.766 us/op 0.82
mainnet_e81889 - altair processInactivityUpdates 6.7474 ms/op 5.4120 ms/op 1.25
mainnet_e81889 - altair processRewardsAndPenalties 53.178 ms/op 53.390 ms/op 1.00
mainnet_e81889 - altair processRegistryUpdates 3.1230 us/op 4.2250 us/op 0.74
mainnet_e81889 - altair processSlashings 1.2010 us/op 626.00 ns/op 1.92
mainnet_e81889 - altair processEth1DataReset 1.1390 us/op 885.00 ns/op 1.29
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.1870 ms/op 1.2921 ms/op 0.92
mainnet_e81889 - altair processSlashingsReset 5.8900 us/op 7.5750 us/op 0.78
mainnet_e81889 - altair processRandaoMixesReset 6.8070 us/op 8.0250 us/op 0.85
mainnet_e81889 - altair processHistoricalRootsUpdate 2.4030 us/op 938.00 ns/op 2.56
mainnet_e81889 - altair processParticipationFlagUpdates 2.4770 us/op 3.5730 us/op 0.69
mainnet_e81889 - altair processSyncCommitteeUpdates 1.0090 us/op 1.1900 us/op 0.85
mainnet_e81889 - altair afterProcessEpoch 44.928 ms/op 52.185 ms/op 0.86
capella processEpoch - mainnet_e217614 1.1926 s/op 1.0619 s/op 1.12
mainnet_e217614 - capella beforeProcessEpoch 75.924 ms/op 71.217 ms/op 1.07
mainnet_e217614 - capella processJustificationAndFinalization 12.989 us/op 17.484 us/op 0.74
mainnet_e217614 - capella processInactivityUpdates 14.436 ms/op 17.756 ms/op 0.81
mainnet_e217614 - capella processRewardsAndPenalties 233.16 ms/op 245.55 ms/op 0.95
mainnet_e217614 - capella processRegistryUpdates 19.394 us/op 22.987 us/op 0.84
mainnet_e217614 - capella processSlashings 952.00 ns/op 716.00 ns/op 1.33
mainnet_e217614 - capella processEth1DataReset 938.00 ns/op 601.00 ns/op 1.56
mainnet_e217614 - capella processEffectiveBalanceUpdates 15.943 ms/op 14.715 ms/op 1.08
mainnet_e217614 - capella processSlashingsReset 2.3920 us/op 5.6120 us/op 0.43
mainnet_e217614 - capella processRandaoMixesReset 6.4050 us/op 6.8050 us/op 0.94
mainnet_e217614 - capella processHistoricalRootsUpdate 1.0920 us/op 1.1240 us/op 0.97
mainnet_e217614 - capella processParticipationFlagUpdates 3.9050 us/op 1.9270 us/op 2.03
mainnet_e217614 - capella afterProcessEpoch 108.20 ms/op 123.12 ms/op 0.88
phase0 processEpoch - mainnet_e58758 345.16 ms/op 350.83 ms/op 0.98
mainnet_e58758 - phase0 beforeProcessEpoch 71.552 ms/op 81.401 ms/op 0.88
mainnet_e58758 - phase0 processJustificationAndFinalization 6.5030 us/op 21.000 us/op 0.31
mainnet_e58758 - phase0 processRewardsAndPenalties 24.780 ms/op 31.468 ms/op 0.79
mainnet_e58758 - phase0 processRegistryUpdates 7.5420 us/op 12.887 us/op 0.59
mainnet_e58758 - phase0 processSlashings 861.00 ns/op 648.00 ns/op 1.33
mainnet_e58758 - phase0 processEth1DataReset 770.00 ns/op 559.00 ns/op 1.38
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.3341 ms/op 1.4568 ms/op 0.92
mainnet_e58758 - phase0 processSlashingsReset 2.3000 us/op 3.2670 us/op 0.70
mainnet_e58758 - phase0 processRandaoMixesReset 3.3080 us/op 5.4580 us/op 0.61
mainnet_e58758 - phase0 processHistoricalRootsUpdate 852.00 ns/op 642.00 ns/op 1.33
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.3090 us/op 3.8330 us/op 0.86
mainnet_e58758 - phase0 afterProcessEpoch 34.104 ms/op 43.501 ms/op 0.78
phase0 processEffectiveBalanceUpdates - 250000 normalcase 981.72 us/op 2.1973 ms/op 0.45
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.8982 ms/op 2.7974 ms/op 0.68
altair processInactivityUpdates - 250000 normalcase 17.309 ms/op 20.705 ms/op 0.84
altair processInactivityUpdates - 250000 worstcase 16.835 ms/op 20.126 ms/op 0.84
phase0 processRegistryUpdates - 250000 normalcase 6.5120 us/op 11.566 us/op 0.56
phase0 processRegistryUpdates - 250000 badcase_full_deposits 340.60 us/op 485.30 us/op 0.70
phase0 processRegistryUpdates - 250000 worstcase 0.5 110.68 ms/op 108.23 ms/op 1.02
altair processRewardsAndPenalties - 250000 normalcase 44.570 ms/op 39.966 ms/op 1.12
altair processRewardsAndPenalties - 250000 worstcase 39.882 ms/op 49.152 ms/op 0.81
phase0 getAttestationDeltas - 250000 normalcase 6.5706 ms/op 7.4544 ms/op 0.88
phase0 getAttestationDeltas - 250000 worstcase 6.6931 ms/op 6.9910 ms/op 0.96
phase0 processSlashings - 250000 worstcase 50.971 us/op 112.31 us/op 0.45
altair processSyncCommitteeUpdates - 250000 95.203 ms/op 120.03 ms/op 0.79
BeaconState.hashTreeRoot - No change 449.00 ns/op 265.00 ns/op 1.69
BeaconState.hashTreeRoot - 1 full validator 103.64 us/op 114.36 us/op 0.91
BeaconState.hashTreeRoot - 32 full validator 1.2463 ms/op 1.1875 ms/op 1.05
BeaconState.hashTreeRoot - 512 full validator 9.2058 ms/op 9.1215 ms/op 1.01
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 129.00 us/op 111.50 us/op 1.16
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.8289 ms/op 1.7457 ms/op 1.05
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 23.297 ms/op 19.844 ms/op 1.17
BeaconState.hashTreeRoot - 1 balances 107.38 us/op 101.91 us/op 1.05
BeaconState.hashTreeRoot - 32 balances 1.1604 ms/op 752.61 us/op 1.54
BeaconState.hashTreeRoot - 512 balances 9.1318 ms/op 6.9835 ms/op 1.31
BeaconState.hashTreeRoot - 250000 balances 168.13 ms/op 177.07 ms/op 0.95
aggregationBits - 2048 els - zipIndexesInBitList 18.842 us/op 24.421 us/op 0.77
byteArrayEquals 32 47.991 ns/op 53.382 ns/op 0.90
Buffer.compare 32 16.067 ns/op 17.055 ns/op 0.94
byteArrayEquals 1024 1.2673 us/op 1.5949 us/op 0.79
Buffer.compare 1024 23.854 ns/op 25.418 ns/op 0.94
byteArrayEquals 16384 20.139 us/op 25.274 us/op 0.80
Buffer.compare 16384 192.04 ns/op 192.47 ns/op 1.00
byteArrayEquals 123687377 150.40 ms/op 189.85 ms/op 0.79
Buffer.compare 123687377 3.7150 ms/op 6.7574 ms/op 0.55
byteArrayEquals 32 - diff last byte 45.627 ns/op 53.723 ns/op 0.85
Buffer.compare 32 - diff last byte 17.055 ns/op 18.233 ns/op 0.94
byteArrayEquals 1024 - diff last byte 1.2479 us/op 1.6103 us/op 0.77
Buffer.compare 1024 - diff last byte 24.351 ns/op 25.523 ns/op 0.95
byteArrayEquals 16384 - diff last byte 19.791 us/op 25.601 us/op 0.77
Buffer.compare 16384 - diff last byte 184.47 ns/op 194.22 ns/op 0.95
byteArrayEquals 123687377 - diff last byte 151.29 ms/op 193.49 ms/op 0.78
Buffer.compare 123687377 - diff last byte 6.6440 ms/op 6.3706 ms/op 1.04
byteArrayEquals 32 - random bytes 4.8460 ns/op 5.1410 ns/op 0.94
Buffer.compare 32 - random bytes 15.363 ns/op 17.104 ns/op 0.90
byteArrayEquals 1024 - random bytes 4.8410 ns/op 5.1330 ns/op 0.94
Buffer.compare 1024 - random bytes 19.857 ns/op 17.096 ns/op 1.16
byteArrayEquals 16384 - random bytes 6.0520 ns/op 5.1160 ns/op 1.18
Buffer.compare 16384 - random bytes 17.962 ns/op 17.117 ns/op 1.05
byteArrayEquals 123687377 - random bytes 8.1200 ns/op 6.4300 ns/op 1.26
Buffer.compare 123687377 - random bytes 18.320 ns/op 18.340 ns/op 1.00
regular array get 100000 times 30.322 us/op 32.877 us/op 0.92
wrappedArray get 100000 times 30.052 us/op 32.854 us/op 0.91
arrayWithProxy get 100000 times 9.1064 ms/op 13.154 ms/op 0.69
ssz.Root.equals 44.135 ns/op 45.555 ns/op 0.97
byteArrayEquals 40.844 ns/op 45.045 ns/op 0.91
Buffer.compare 9.4710 ns/op 10.242 ns/op 0.92
processSlot - 1 slots 11.617 us/op 13.959 us/op 0.83
processSlot - 32 slots 2.4212 ms/op 3.0562 ms/op 0.79
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 38.841 ms/op 39.411 ms/op 0.99
getCommitteeAssignments - req 1 vs - 250000 vc 1.7438 ms/op 2.1510 ms/op 0.81
getCommitteeAssignments - req 100 vs - 250000 vc 3.4510 ms/op 4.1608 ms/op 0.83
getCommitteeAssignments - req 1000 vs - 250000 vc 3.7238 ms/op 4.6719 ms/op 0.80
findModifiedValidators - 10000 modified validators 289.57 ms/op 305.03 ms/op 0.95
findModifiedValidators - 1000 modified validators 231.31 ms/op 174.47 ms/op 1.33
findModifiedValidators - 100 modified validators 208.16 ms/op 169.30 ms/op 1.23
findModifiedValidators - 10 modified validators 168.16 ms/op 176.44 ms/op 0.95
findModifiedValidators - 1 modified validators 167.81 ms/op 158.91 ms/op 1.06
findModifiedValidators - no difference 150.96 ms/op 169.76 ms/op 0.89
compare ViewDUs 3.6003 s/op 3.3481 s/op 1.08
compare each validator Uint8Array 1.6763 s/op 1.6522 s/op 1.01
compare ViewDU to Uint8Array 1.0798 s/op 1.0330 s/op 1.05
migrate state 1000000 validators, 24 modified, 0 new 686.42 ms/op 747.44 ms/op 0.92
migrate state 1000000 validators, 1700 modified, 1000 new 874.13 ms/op 998.72 ms/op 0.88
migrate state 1000000 validators, 3400 modified, 2000 new 1.3735 s/op 1.2204 s/op 1.13
migrate state 1500000 validators, 24 modified, 0 new 923.56 ms/op 807.33 ms/op 1.14
migrate state 1500000 validators, 1700 modified, 1000 new 1.1579 s/op 1.1234 s/op 1.03
migrate state 1500000 validators, 3400 modified, 2000 new 1.1185 s/op 1.2723 s/op 0.88
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 6.9000 ns/op 4.9800 ns/op 1.39
state getBlockRootAtSlot - 250000 vs - 7PWei 522.65 ns/op 609.66 ns/op 0.86
computeProposers - vc 250000 6.2818 ms/op 8.8333 ms/op 0.71
computeEpochShuffling - vc 250000 36.062 ms/op 44.316 ms/op 0.81
getNextSyncCommittee - vc 250000 110.00 ms/op 143.98 ms/op 0.76
computeSigningRoot for AttestationData 19.013 us/op 26.277 us/op 0.72
hash AttestationData serialized data then Buffer.toString(base64) 1.2179 us/op 1.6902 us/op 0.72
toHexString serialized data 751.49 ns/op 1.0382 us/op 0.72
Buffer.toString(base64) 123.81 ns/op 208.97 ns/op 0.59
nodejs block root to RootHex using toHex 108.03 ns/op 184.02 ns/op 0.59
nodejs block root to RootHex using toRootHex 68.357 ns/op 97.967 ns/op 0.70
browser block root to RootHex using the deprecated toHexString 200.06 ns/op 240.76 ns/op 0.83
browser block root to RootHex using toHex 162.59 ns/op 183.96 ns/op 0.88
browser block root to RootHex using toRootHex 154.96 ns/op 172.11 ns/op 0.90

by benchmarkbot/action

@nflaig nflaig marked this pull request as ready for review January 20, 2025 15:21
@nflaig nflaig requested a review from a team as a code owner January 20, 2025 15:21
@nflaig
Copy link
Member Author

nflaig commented Jan 20, 2025

Something to note, we apply the same validation on the api as we do on gossip

export async function validateApiVoluntaryExit(

this is due to the fact that we publish it to the network immediately

await network.publishVoluntaryExit(signedVoluntaryExit);

but something we could consider is that we separate out some transient checks which would become valid eventually, there are like 3-4 of them and post-electra we add another one which checks that there are no pending withdrawals. Meaning we would keep the volunary exit in the cache and publish it to the network only after those conditions are met.

As this has worked like this since phase0 it seems like no issue but something to consider to improve UX, on the other hand I can also see that accepting the voluntary exit but not publishing it immediately might be confusing as well.

@wemeetagain wemeetagain merged commit d584aed into unstable Jan 20, 2025
22 checks passed
@wemeetagain wemeetagain deleted the nflaig/voluntary-exit-checks branch January 20, 2025 21:30
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.

2 participants