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 validator status ssz type #6059

Closed
wants to merge 3 commits into from

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Oct 23, 2023

Motivation

Prerequisite to support SSZ response for validators endpoint (ethereum/beacon-APIs#333) as validator status needs to be byte encoded which is currently not possible with existing StringType

Description

Adds validator status SSZ type

Note: The spec has not yet been updated and there still needs to be discussion on the exact encoding. See ethereum/beacon-APIs#333 (comment) for currently used encoding.

Open Tasks

  • update to canonical encoding as defined in spec
  • address / remove TODO: comments

@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 1b7c750 Previous: 18dc0c9 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 468.46 us/op 629.07 us/op 0.74
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 74.239 us/op 103.44 us/op 0.72
BLS verify - blst-native 1.3013 ms/op 1.3631 ms/op 0.95
BLS verifyMultipleSignatures 3 - blst-native 2.7478 ms/op 2.9763 ms/op 0.92
BLS verifyMultipleSignatures 8 - blst-native 6.0902 ms/op 6.5568 ms/op 0.93
BLS verifyMultipleSignatures 32 - blst-native 22.065 ms/op 23.254 ms/op 0.95
BLS verifyMultipleSignatures 64 - blst-native 44.265 ms/op 45.033 ms/op 0.98
BLS verifyMultipleSignatures 128 - blst-native 86.891 ms/op 90.560 ms/op 0.96
BLS deserializing 10000 signatures 891.69 ms/op 923.04 ms/op 0.97
BLS deserializing 100000 signatures 9.1326 s/op 9.6705 s/op 0.94
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.3533 ms/op 1.4379 ms/op 0.94
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.5227 ms/op 1.6182 ms/op 0.94
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.5288 ms/op 2.5321 ms/op 1.00
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.5058 ms/op 3.7155 ms/op 0.94
BLS verifyMultipleSignatures - same message - 128 - blst-native 5.6626 ms/op 5.9923 ms/op 0.94
BLS aggregatePubkeys 32 - blst-native 27.623 us/op 27.498 us/op 1.00
BLS aggregatePubkeys 128 - blst-native 101.80 us/op 107.27 us/op 0.95
getAttestationsForBlock 46.654 ms/op 59.460 ms/op 0.78
isKnown best case - 1 super set check 419.00 ns/op 582.00 ns/op 0.72
isKnown normal case - 2 super set checks 370.00 ns/op 556.00 ns/op 0.67
isKnown worse case - 16 super set checks 455.00 ns/op 532.00 ns/op 0.86
CheckpointStateCache - add get delete 5.9700 us/op 6.2580 us/op 0.95
validate api signedAggregateAndProof - struct 2.8403 ms/op 2.9136 ms/op 0.97
validate gossip signedAggregateAndProof - struct 2.8104 ms/op 2.8943 ms/op 0.97
validate gossip attestation - vc 640000 1.3736 ms/op 1.4641 ms/op 0.94
batch validate gossip attestation - vc 640000 - chunk 32 172.89 us/op 178.41 us/op 0.97
batch validate gossip attestation - vc 640000 - chunk 64 150.85 us/op 154.17 us/op 0.98
batch validate gossip attestation - vc 640000 - chunk 128 139.46 us/op 150.07 us/op 0.93
batch validate gossip attestation - vc 640000 - chunk 256 128.72 us/op 141.27 us/op 0.91
pickEth1Vote - no votes 1.2213 ms/op 1.3322 ms/op 0.92
pickEth1Vote - max votes 8.1600 ms/op 12.296 ms/op 0.66
pickEth1Vote - Eth1Data hashTreeRoot value x2048 14.623 ms/op 24.423 ms/op 0.60
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 21.380 ms/op 27.282 ms/op 0.78
pickEth1Vote - Eth1Data fastSerialize value x2048 611.58 us/op 753.69 us/op 0.81
pickEth1Vote - Eth1Data fastSerialize tree x2048 5.6655 ms/op 5.6982 ms/op 0.99
bytes32 toHexString 492.00 ns/op 558.00 ns/op 0.88
bytes32 Buffer.toString(hex) 306.00 ns/op 318.00 ns/op 0.96
bytes32 Buffer.toString(hex) from Uint8Array 464.00 ns/op 518.00 ns/op 0.90
bytes32 Buffer.toString(hex) + 0x 292.00 ns/op 308.00 ns/op 0.95
Object access 1 prop 0.19900 ns/op 0.19700 ns/op 1.01
Map access 1 prop 0.15300 ns/op 0.15900 ns/op 0.96
Object get x1000 7.5570 ns/op 7.9110 ns/op 0.96
Map get x1000 0.68700 ns/op 0.66300 ns/op 1.04
Object set x1000 55.815 ns/op 66.462 ns/op 0.84
Map set x1000 42.125 ns/op 47.350 ns/op 0.89
Return object 10000 times 0.25450 ns/op 0.33090 ns/op 0.77
Throw Error 10000 times 3.9061 us/op 4.1895 us/op 0.93
fastMsgIdFn sha256 / 200 bytes 3.3380 us/op 3.4460 us/op 0.97
fastMsgIdFn h32 xxhash / 200 bytes 308.00 ns/op 313.00 ns/op 0.98
fastMsgIdFn h64 xxhash / 200 bytes 365.00 ns/op 396.00 ns/op 0.92
fastMsgIdFn sha256 / 1000 bytes 11.510 us/op 11.997 us/op 0.96
fastMsgIdFn h32 xxhash / 1000 bytes 441.00 ns/op 456.00 ns/op 0.97
fastMsgIdFn h64 xxhash / 1000 bytes 434.00 ns/op 458.00 ns/op 0.95
fastMsgIdFn sha256 / 10000 bytes 105.00 us/op 108.95 us/op 0.96
fastMsgIdFn h32 xxhash / 10000 bytes 1.9850 us/op 2.0630 us/op 0.96
fastMsgIdFn h64 xxhash / 10000 bytes 1.3840 us/op 1.4040 us/op 0.99
send data - 1000 256B messages 20.877 ms/op 21.228 ms/op 0.98
send data - 1000 512B messages 28.171 ms/op 35.421 ms/op 0.80
send data - 1000 1024B messages 42.567 ms/op 46.769 ms/op 0.91
send data - 1000 1200B messages 30.474 ms/op 38.599 ms/op 0.79
send data - 1000 2048B messages 35.752 ms/op 38.694 ms/op 0.92
send data - 1000 4096B messages 32.876 ms/op 40.838 ms/op 0.81
send data - 1000 16384B messages 83.446 ms/op 88.521 ms/op 0.94
send data - 1000 65536B messages 320.04 ms/op 306.26 ms/op 1.05
enrSubnets - fastDeserialize 64 bits 1.2440 us/op 1.4650 us/op 0.85
enrSubnets - ssz BitVector 64 bits 462.00 ns/op 497.00 ns/op 0.93
enrSubnets - fastDeserialize 4 bits 184.00 ns/op 197.00 ns/op 0.93
enrSubnets - ssz BitVector 4 bits 466.00 ns/op 482.00 ns/op 0.97
prioritizePeers score -10:0 att 32-0.1 sync 2-0 104.03 us/op 117.61 us/op 0.88
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 133.91 us/op 138.47 us/op 0.97
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 180.69 us/op 183.87 us/op 0.98
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 316.56 us/op 318.62 us/op 0.99
prioritizePeers score 0:0 att 64-1 sync 4-1 359.21 us/op 386.00 us/op 0.93
array of 16000 items push then shift 1.7518 us/op 1.7930 us/op 0.98
LinkedList of 16000 items push then shift 9.4930 ns/op 9.8960 ns/op 0.96
array of 16000 items push then pop 97.367 ns/op 105.89 ns/op 0.92
LinkedList of 16000 items push then pop 9.0920 ns/op 9.3530 ns/op 0.97
array of 24000 items push then shift 2.4541 us/op 2.6981 us/op 0.91
LinkedList of 24000 items push then shift 9.2630 ns/op 9.6380 ns/op 0.96
array of 24000 items push then pop 129.54 ns/op 128.72 ns/op 1.01
LinkedList of 24000 items push then pop 9.1820 ns/op 10.342 ns/op 0.89
intersect bitArray bitLen 8 6.8550 ns/op 7.3520 ns/op 0.93
intersect array and set length 8 55.915 ns/op 71.129 ns/op 0.79
intersect bitArray bitLen 128 31.959 ns/op 34.823 ns/op 0.92
intersect array and set length 128 804.00 ns/op 881.68 ns/op 0.91
bitArray.getTrueBitIndexes() bitLen 128 1.6460 us/op 1.8670 us/op 0.88
bitArray.getTrueBitIndexes() bitLen 248 2.9380 us/op 2.8900 us/op 1.02
bitArray.getTrueBitIndexes() bitLen 512 6.0180 us/op 5.6600 us/op 1.06
Buffer.concat 32 items 1.0130 us/op 1.0260 us/op 0.99
Uint8Array.set 32 items 2.0110 us/op 2.2540 us/op 0.89
Set add up to 64 items then delete first 4.8404 us/op 4.7115 us/op 1.03
OrderedSet add up to 64 items then delete first 6.2052 us/op 6.0943 us/op 1.02
Set add up to 64 items then delete last 5.1956 us/op 4.9848 us/op 1.04
OrderedSet add up to 64 items then delete last 6.8823 us/op 6.2697 us/op 1.10
Set add up to 64 items then delete middle 5.1554 us/op 5.0118 us/op 1.03
OrderedSet add up to 64 items then delete middle 8.3453 us/op 8.0286 us/op 1.04
Set add up to 128 items then delete first 10.583 us/op 10.242 us/op 1.03
OrderedSet add up to 128 items then delete first 14.577 us/op 13.739 us/op 1.06
Set add up to 128 items then delete last 10.550 us/op 10.116 us/op 1.04
OrderedSet add up to 128 items then delete last 14.549 us/op 13.804 us/op 1.05
Set add up to 128 items then delete middle 10.788 us/op 10.336 us/op 1.04
OrderedSet add up to 128 items then delete middle 20.544 us/op 19.302 us/op 1.06
Set add up to 256 items then delete first 21.958 us/op 20.682 us/op 1.06
OrderedSet add up to 256 items then delete first 29.739 us/op 29.073 us/op 1.02
Set add up to 256 items then delete last 21.558 us/op 20.830 us/op 1.03
OrderedSet add up to 256 items then delete last 27.566 us/op 26.549 us/op 1.04
Set add up to 256 items then delete middle 20.659 us/op 20.491 us/op 1.01
OrderedSet add up to 256 items then delete middle 54.027 us/op 51.000 us/op 1.06
transfer serialized Status (84 B) 2.0020 us/op 2.1600 us/op 0.93
copy serialized Status (84 B) 1.8010 us/op 2.0240 us/op 0.89
transfer serialized SignedVoluntaryExit (112 B) 2.3760 us/op 2.1940 us/op 1.08
copy serialized SignedVoluntaryExit (112 B) 1.7940 us/op 1.7310 us/op 1.04
transfer serialized ProposerSlashing (416 B) 3.4140 us/op 2.4290 us/op 1.41
copy serialized ProposerSlashing (416 B) 3.5550 us/op 2.2520 us/op 1.58
transfer serialized Attestation (485 B) 3.6070 us/op 2.3150 us/op 1.56
copy serialized Attestation (485 B) 3.5120 us/op 2.2340 us/op 1.57
transfer serialized AttesterSlashing (33232 B) 3.5230 us/op 2.4100 us/op 1.46
copy serialized AttesterSlashing (33232 B) 9.4920 us/op 7.4720 us/op 1.27
transfer serialized Small SignedBeaconBlock (128000 B) 3.1780 us/op 2.9500 us/op 1.08
copy serialized Small SignedBeaconBlock (128000 B) 23.226 us/op 24.809 us/op 0.94
transfer serialized Avg SignedBeaconBlock (200000 B) 3.6130 us/op 3.4430 us/op 1.05
copy serialized Avg SignedBeaconBlock (200000 B) 30.833 us/op 33.624 us/op 0.92
transfer serialized BlobsSidecar (524380 B) 3.4870 us/op 4.4430 us/op 0.78
copy serialized BlobsSidecar (524380 B) 120.21 us/op 88.603 us/op 1.36
transfer serialized Big SignedBeaconBlock (1000000 B) 4.1900 us/op 4.0170 us/op 1.04
copy serialized Big SignedBeaconBlock (1000000 B) 292.33 us/op 234.66 us/op 1.25
pass gossip attestations to forkchoice per slot 4.0181 ms/op 4.3323 ms/op 0.93
forkChoice updateHead vc 100000 bc 64 eq 0 697.11 us/op 802.71 us/op 0.87
forkChoice updateHead vc 600000 bc 64 eq 0 6.2471 ms/op 4.5464 ms/op 1.37
forkChoice updateHead vc 1000000 bc 64 eq 0 8.6571 ms/op 7.5403 ms/op 1.15
forkChoice updateHead vc 600000 bc 320 eq 0 4.7721 ms/op 4.5231 ms/op 1.06
forkChoice updateHead vc 600000 bc 1200 eq 0 4.7787 ms/op 4.9208 ms/op 0.97
forkChoice updateHead vc 600000 bc 7200 eq 0 5.7012 ms/op 5.9760 ms/op 0.95
forkChoice updateHead vc 600000 bc 64 eq 1000 12.270 ms/op 12.018 ms/op 1.02
forkChoice updateHead vc 600000 bc 64 eq 10000 13.313 ms/op 13.255 ms/op 1.00
forkChoice updateHead vc 600000 bc 64 eq 300000 32.985 ms/op 21.566 ms/op 1.53
computeDeltas 500000 validators 300 proto nodes 6.9607 ms/op 6.7270 ms/op 1.03
computeDeltas 500000 validators 1200 proto nodes 6.3668 ms/op 6.6330 ms/op 0.96
computeDeltas 500000 validators 7200 proto nodes 6.2777 ms/op 6.4443 ms/op 0.97
computeDeltas 750000 validators 300 proto nodes 9.5879 ms/op 9.6814 ms/op 0.99
computeDeltas 750000 validators 1200 proto nodes 9.7318 ms/op 9.7910 ms/op 0.99
computeDeltas 750000 validators 7200 proto nodes 9.8127 ms/op 9.7575 ms/op 1.01
computeDeltas 1400000 validators 300 proto nodes 19.889 ms/op 18.550 ms/op 1.07
computeDeltas 1400000 validators 1200 proto nodes 19.117 ms/op 18.570 ms/op 1.03
computeDeltas 1400000 validators 7200 proto nodes 18.029 ms/op 18.567 ms/op 0.97
computeDeltas 2100000 validators 300 proto nodes 27.677 ms/op 27.908 ms/op 0.99
computeDeltas 2100000 validators 1200 proto nodes 27.659 ms/op 27.026 ms/op 1.02
computeDeltas 2100000 validators 7200 proto nodes 27.286 ms/op 27.022 ms/op 1.01
computeProposerBoostScoreFromBalances 500000 validators 3.3180 ms/op 3.3379 ms/op 0.99
computeProposerBoostScoreFromBalances 750000 validators 3.3471 ms/op 3.3870 ms/op 0.99
computeProposerBoostScoreFromBalances 1400000 validators 3.4390 ms/op 3.4797 ms/op 0.99
computeProposerBoostScoreFromBalances 2100000 validators 3.3262 ms/op 3.5773 ms/op 0.93
altair processAttestation - 250000 vs - 7PWei normalcase 2.9426 ms/op 3.2266 ms/op 0.91
altair processAttestation - 250000 vs - 7PWei worstcase 4.0279 ms/op 4.3033 ms/op 0.94
altair processAttestation - setStatus - 1/6 committees join 181.03 us/op 141.85 us/op 1.28
altair processAttestation - setStatus - 1/3 committees join 351.62 us/op 272.02 us/op 1.29
altair processAttestation - setStatus - 1/2 committees join 485.10 us/op 378.82 us/op 1.28
altair processAttestation - setStatus - 2/3 committees join 635.37 us/op 470.79 us/op 1.35
altair processAttestation - setStatus - 4/5 committees join 868.74 us/op 718.19 us/op 1.21
altair processAttestation - setStatus - 100% committees join 957.81 us/op 829.94 us/op 1.15
altair processBlock - 250000 vs - 7PWei normalcase 10.619 ms/op 10.694 ms/op 0.99
altair processBlock - 250000 vs - 7PWei normalcase hashState 33.069 ms/op 40.016 ms/op 0.83
altair processBlock - 250000 vs - 7PWei worstcase 42.152 ms/op 44.477 ms/op 0.95
altair processBlock - 250000 vs - 7PWei worstcase hashState 94.515 ms/op 96.239 ms/op 0.98
phase0 processBlock - 250000 vs - 7PWei normalcase 3.0822 ms/op 3.3341 ms/op 0.92
phase0 processBlock - 250000 vs - 7PWei worstcase 36.425 ms/op 41.891 ms/op 0.87
altair processEth1Data - 250000 vs - 7PWei normalcase 662.27 us/op 759.92 us/op 0.87
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 16.028 us/op 17.090 us/op 0.94
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 74.014 us/op 60.605 us/op 1.22
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 27.602 us/op 24.789 us/op 1.11
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 20.382 us/op 11.712 us/op 1.74
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 216.99 us/op 158.51 us/op 1.37
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.5764 ms/op 1.2437 ms/op 1.27
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.7907 ms/op 1.7397 ms/op 1.03
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.5194 ms/op 1.8508 ms/op 0.82
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.7654 ms/op 4.0630 ms/op 0.93
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.5748 ms/op 2.6218 ms/op 0.98
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 5.9873 ms/op 6.1503 ms/op 0.97
Tree 40 250000 create 404.11 ms/op 396.46 ms/op 1.02
Tree 40 250000 get(125000) 211.29 ns/op 220.50 ns/op 0.96
Tree 40 250000 set(125000) 1.1410 us/op 1.1316 us/op 1.01
Tree 40 250000 toArray() 22.999 ms/op 22.910 ms/op 1.00
Tree 40 250000 iterate all - toArray() + loop 26.854 ms/op 23.009 ms/op 1.17
Tree 40 250000 iterate all - get(i) 79.323 ms/op 75.380 ms/op 1.05
MutableVector 250000 create 12.882 ms/op 14.857 ms/op 0.87
MutableVector 250000 get(125000) 6.8170 ns/op 7.0030 ns/op 0.97
MutableVector 250000 set(125000) 327.56 ns/op 310.00 ns/op 1.06
MutableVector 250000 toArray() 3.9021 ms/op 4.0517 ms/op 0.96
MutableVector 250000 iterate all - toArray() + loop 3.7860 ms/op 4.5561 ms/op 0.83
MutableVector 250000 iterate all - get(i) 1.5576 ms/op 1.7044 ms/op 0.91
Array 250000 create 3.1477 ms/op 4.0030 ms/op 0.79
Array 250000 clone - spread 1.1847 ms/op 1.1700 ms/op 1.01
Array 250000 get(125000) 0.58000 ns/op 0.57600 ns/op 1.01
Array 250000 set(125000) 0.65900 ns/op 0.63700 ns/op 1.03
Array 250000 iterate all - loop 84.479 us/op 85.534 us/op 0.99
effectiveBalanceIncrements clone Uint8Array 300000 34.614 us/op 46.468 us/op 0.74
effectiveBalanceIncrements clone MutableVector 300000 333.00 ns/op 247.00 ns/op 1.35
effectiveBalanceIncrements rw all Uint8Array 300000 182.63 us/op 182.35 us/op 1.00
effectiveBalanceIncrements rw all MutableVector 300000 103.79 ms/op 81.721 ms/op 1.27
phase0 afterProcessEpoch - 250000 vs - 7PWei 121.62 ms/op 117.21 ms/op 1.04
phase0 beforeProcessEpoch - 250000 vs - 7PWei 43.802 ms/op 41.263 ms/op 1.06
altair processEpoch - mainnet_e81889 410.81 ms/op 504.72 ms/op 0.81
mainnet_e81889 - altair beforeProcessEpoch 60.874 ms/op 69.064 ms/op 0.88
mainnet_e81889 - altair processJustificationAndFinalization 17.674 us/op 20.696 us/op 0.85
mainnet_e81889 - altair processInactivityUpdates 5.7227 ms/op 6.4504 ms/op 0.89
mainnet_e81889 - altair processRewardsAndPenalties 65.527 ms/op 55.658 ms/op 1.18
mainnet_e81889 - altair processRegistryUpdates 2.4490 us/op 4.6460 us/op 0.53
mainnet_e81889 - altair processSlashings 607.00 ns/op 984.00 ns/op 0.62
mainnet_e81889 - altair processEth1DataReset 892.00 ns/op 1.0120 us/op 0.88
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2978 ms/op 1.3299 ms/op 0.98
mainnet_e81889 - altair processSlashingsReset 3.3340 us/op 6.7160 us/op 0.50
mainnet_e81889 - altair processRandaoMixesReset 5.1470 us/op 7.2680 us/op 0.71
mainnet_e81889 - altair processHistoricalRootsUpdate 1.1550 us/op 965.00 ns/op 1.20
mainnet_e81889 - altair processParticipationFlagUpdates 1.7740 us/op 3.6260 us/op 0.49
mainnet_e81889 - altair processSyncCommitteeUpdates 568.00 ns/op 1.9560 us/op 0.29
mainnet_e81889 - altair afterProcessEpoch 128.30 ms/op 139.92 ms/op 0.92
capella processEpoch - mainnet_e217614 1.5114 s/op 1.8699 s/op 0.81
mainnet_e217614 - capella beforeProcessEpoch 331.89 ms/op 301.29 ms/op 1.10
mainnet_e217614 - capella processJustificationAndFinalization 26.231 us/op 31.603 us/op 0.83
mainnet_e217614 - capella processInactivityUpdates 26.183 ms/op 20.429 ms/op 1.28
mainnet_e217614 - capella processRewardsAndPenalties 406.48 ms/op 364.09 ms/op 1.12
mainnet_e217614 - capella processRegistryUpdates 37.692 us/op 33.141 us/op 1.14
mainnet_e217614 - capella processSlashings 1.5250 us/op 1.7410 us/op 0.88
mainnet_e217614 - capella processEth1DataReset 1.2430 us/op 1.1410 us/op 1.09
mainnet_e217614 - capella processEffectiveBalanceUpdates 7.9237 ms/op 4.3939 ms/op 1.80
mainnet_e217614 - capella processSlashingsReset 7.0650 us/op 7.3880 us/op 0.96
mainnet_e217614 - capella processRandaoMixesReset 13.322 us/op 12.129 us/op 1.10
mainnet_e217614 - capella processHistoricalRootsUpdate 1.2950 us/op 1.5440 us/op 0.84
mainnet_e217614 - capella processParticipationFlagUpdates 6.7500 us/op 4.6840 us/op 1.44
mainnet_e217614 - capella afterProcessEpoch 384.30 ms/op 333.31 ms/op 1.15
phase0 processEpoch - mainnet_e58758 700.72 ms/op 577.07 ms/op 1.21
mainnet_e58758 - phase0 beforeProcessEpoch 213.59 ms/op 176.54 ms/op 1.21
mainnet_e58758 - phase0 processJustificationAndFinalization 32.347 us/op 26.705 us/op 1.21
mainnet_e58758 - phase0 processRewardsAndPenalties 76.195 ms/op 69.583 ms/op 1.10
mainnet_e58758 - phase0 processRegistryUpdates 21.975 us/op 17.924 us/op 1.23
mainnet_e58758 - phase0 processSlashings 1.6380 us/op 1.1120 us/op 1.47
mainnet_e58758 - phase0 processEth1DataReset 1.3310 us/op 882.00 ns/op 1.51
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.2705 ms/op 1.3915 ms/op 1.63
mainnet_e58758 - phase0 processSlashingsReset 5.9580 us/op 3.9670 us/op 1.50
mainnet_e58758 - phase0 processRandaoMixesReset 11.011 us/op 7.7080 us/op 1.43
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.3670 us/op 1.4120 us/op 0.97
mainnet_e58758 - phase0 processParticipationRecordUpdates 8.9400 us/op 6.2330 us/op 1.43
mainnet_e58758 - phase0 afterProcessEpoch 118.05 ms/op 112.34 ms/op 1.05
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.7354 ms/op 2.0094 ms/op 1.36
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 3.1330 ms/op 2.4581 ms/op 1.27
altair processInactivityUpdates - 250000 normalcase 31.806 ms/op 31.061 ms/op 1.02
altair processInactivityUpdates - 250000 worstcase 34.259 ms/op 29.946 ms/op 1.14
phase0 processRegistryUpdates - 250000 normalcase 20.442 us/op 14.384 us/op 1.42
phase0 processRegistryUpdates - 250000 badcase_full_deposits 648.06 us/op 442.02 us/op 1.47
phase0 processRegistryUpdates - 250000 worstcase 0.5 229.99 ms/op 160.49 ms/op 1.43
altair processRewardsAndPenalties - 250000 normalcase 85.775 ms/op 55.371 ms/op 1.55
altair processRewardsAndPenalties - 250000 worstcase 85.901 ms/op 60.040 ms/op 1.43
phase0 getAttestationDeltas - 250000 normalcase 14.244 ms/op 11.888 ms/op 1.20
phase0 getAttestationDeltas - 250000 worstcase 13.760 ms/op 9.5069 ms/op 1.45
phase0 processSlashings - 250000 worstcase 3.9284 ms/op 2.6537 ms/op 1.48
altair processSyncCommitteeUpdates - 250000 184.44 ms/op 165.84 ms/op 1.11
BeaconState.hashTreeRoot - No change 415.00 ns/op 303.00 ns/op 1.37
BeaconState.hashTreeRoot - 1 full validator 181.25 us/op 146.21 us/op 1.24
BeaconState.hashTreeRoot - 32 full validator 2.1854 ms/op 1.6209 ms/op 1.35
BeaconState.hashTreeRoot - 512 full validator 26.252 ms/op 18.809 ms/op 1.40
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 248.97 us/op 264.69 us/op 0.94
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 3.9760 ms/op 3.0104 ms/op 1.32
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 42.176 ms/op 34.705 ms/op 1.22
BeaconState.hashTreeRoot - 1 balances 236.36 us/op 151.26 us/op 1.56
BeaconState.hashTreeRoot - 32 balances 1.6832 ms/op 1.4498 ms/op 1.16
BeaconState.hashTreeRoot - 512 balances 16.794 ms/op 18.002 ms/op 0.93
BeaconState.hashTreeRoot - 250000 balances 252.26 ms/op 231.68 ms/op 1.09
aggregationBits - 2048 els - zipIndexesInBitList 29.508 us/op 28.434 us/op 1.04
regular array get 100000 times 47.781 us/op 45.196 us/op 1.06
wrappedArray get 100000 times 58.605 us/op 36.441 us/op 1.61
arrayWithProxy get 100000 times 16.018 ms/op 16.237 ms/op 0.99
ssz.Root.equals 304.00 ns/op 278.00 ns/op 1.09
byteArrayEquals 311.00 ns/op 281.00 ns/op 1.11
shuffle list - 16384 els 8.9979 ms/op 7.3257 ms/op 1.23
shuffle list - 250000 els 123.10 ms/op 108.50 ms/op 1.13
processSlot - 1 slots 29.119 us/op 22.606 us/op 1.29
processSlot - 32 slots 3.9154 ms/op 3.8682 ms/op 1.01
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 57.145 ms/op 58.786 ms/op 0.97
getCommitteeAssignments - req 1 vs - 250000 vc 2.5671 ms/op 2.6304 ms/op 0.98
getCommitteeAssignments - req 100 vs - 250000 vc 3.9129 ms/op 3.8459 ms/op 1.02
getCommitteeAssignments - req 1000 vs - 250000 vc 4.2351 ms/op 4.3580 ms/op 0.97
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.8900 ns/op 6.2900 ns/op 0.94
state getBlockRootAtSlot - 250000 vs - 7PWei 921.17 ns/op 702.85 ns/op 1.31
computeProposers - vc 250000 10.172 ms/op 9.9194 ms/op 1.03
computeEpochShuffling - vc 250000 107.57 ms/op 111.94 ms/op 0.96
getNextSyncCommittee - vc 250000 172.58 ms/op 178.92 ms/op 0.96
computeSigningRoot for AttestationData 32.906 us/op 34.675 us/op 0.95
hash AttestationData serialized data then Buffer.toString(base64) 2.3726 us/op 2.5321 us/op 0.94
toHexString serialized data 1.1094 us/op 1.7548 us/op 0.63
Buffer.toString(base64) 234.58 ns/op 302.04 ns/op 0.78

by benchmarkbot/action

@nflaig
Copy link
Member Author

nflaig commented Dec 28, 2023

Closed in favor of #6080

@nflaig nflaig closed this Dec 28, 2023
nflaig added a commit that referenced this pull request Feb 3, 2024
wemeetagain added a commit that referenced this pull request Jun 10, 2024
* Add config route definitions

* Add debug route definitions

* Add events route description

* Add lightclient route definitions

* Flatten function params

* Type safety for optional params in write / parse req

* Method args are optional if only optional props

* Fix genesisValidatorsRoot type issue

* Revert requiring all params in write / parse req

* Update http client errors

* Add lodestar route definitions

* Add node route definitions

* Add proof route definitions

* Add builder route definitions

* Add validator route definitions

* Application method response can be void

* Generic options can be passed to application methods

* Default endpoint request type has body property

* Improve types of transform methods

* Export server types from index (to be removed)

* Update config api impl

* Update lightclient api impl

* Update events api impl

* Update lodestar api impl

* Update proof api impl

* Update node api impl

* Update debug api impl

* Update state api impl

* Update pool api impl

* Update blocks api impl

* Partially update validator api impl

* Update beacon routes export

* Align submitPoolBlsToExecutionChange method args

* Filters are always a object

* Update errors messages

* Add beacon client methods

* Add missing routeId label to stream time metric

* Fix json casing in codecs

* Apply remaining changes from #6227

* Produce block apis only have version meta

* Add block values meta to all produce block apis

* Apply changes from #6337

* Handle unsafe version in WithMeta and WithVersion

* Restore server api error

* Update fastify route types

* Update server routes / handlers

* Remove unnecessary type cast

* Restore per route clients

* Fix beacon route types

* Remove option to patch fetch from http client

* Update eventstream client, remove fetch override

Fallback does not work like this, see #6180 for proper solution

* Use StringType for validator status until #6059

* Remove empty fetch.ts file

* Add a few todos

* Update builder client and server routes

* Update beacon exports

* Update api index exports

* Update builder index imports

* Improve type safety of schema definitions

* Add headers to fastify schema

* Fix schema definition type

* Add missing schemas to route definitions

* Fix response codec type

* Remove response codec type casts

* Fix casing in json only codec

* Reuse EmptyResponseCodec

* Update base rest api server

* Update keymanager routes, client and server

* Reuse data types in keymanager impl

* Do not await setting headers, not a promise

* Improve type safety of empty codecs

* Only require to implement supported req methods

* Handle requests that only support one format

* Handle responses that only support one format

* Add json / ssz only req codecs

* Update only support errors

* Fix assertion

* Set correct accept header if only supports one format

* Fix eslint / prettier issues

* More formatting fixes

* Fix fallback request retries in case of http errors

* Formatting of res.error

* Add add retry functionality to http client (from #6387)

* Update rewards routes and server (#6178 and #6260)

* Allow to omit body in ssz req if not defined

* Always set metadata headers in response

* Cache wire format in api response

* Only call raw body for json meta

* Update api package tests (wip)

* Test json and ssz format in generic server tests

* Add a bunch of todos

* Fix a few broken route definitions

* Fix partial config test

* Another todo note

* Stringify body of json requests

* Override default response json method

* Validate external consensus version headers in request

* Add error handling todo

* Skip body schema validation for ssz request bodies

* Clean up generic server tests

* Pass node, proof, events generic tests

* Use enum for media types

* Fix a bunch of route definitions

* Add justified to blockid type

* Properly handle booleans, remove block values codec

* Create Uint8Array test data without allocating Buffer

* Let fastify handle Buffer conversion

* Convert Buffer to Uint8Array in content type parser

* Fix build issues

* Fix fork type in builder routes

* Add some notes

* Properly parse request headers

* Fix incorrect type assumptions in transform

* Generic server tests are passing (except lightclient)

* Correctly handle APIs with empty responses

* Update getHeader return type to reflect no bid responses

* Do not append '?' to URL if query string is empty

* Let server handler set status code for parsing errors

* Remove unused import

* Rename function, request specific

* Completely drop ssz support from getSpec

* Spec tests are passing against latest releases

* Drop unused fastify route config

* Drop ssz request from builder routes, not yet supported

* Remove import

* Apply change from #6695

* Update execution optimistic meta

* Apply changes from #6645

* Add workaround to fix epoch committees type issue

* Add todo to fix inefficient state conversion

* Convert committee to normal array

* Apply changes from #6655

* Align args of validators endpoints

* Convert indices to str in rewards apis

* Update api spec version of README badges

* Revert table formatting changes

* Make this accessible for class-basd API implementations

* Throw err if metadata is accessed for failed response

* Add assertOk to api response

* Tweak api error message

* Update operationIds match spec value

* Add missing version to blob sidecars metadata

* Test headers and ssz bodies against spec

* Minor reordering of code in spec parsing

* submitBlindedBlock throws err if fork is not execution

* responseOk might be undefined

* Remove statusOk from route definition

* Remove stale comment

* Less build errors in beacon-node

* getBlobSidecars return version from server impl

* Update validator produce block impl

* More expressive pool method args

* Application methods might be undefined in mock implementations

* Adress open TODOs in server handler

* Api response methods are synchronous now

* Fix all remaining build issues

* Use more performant from/toHex in server api impls

* Clean up some TODOs

* Fix ApiError type

* Errors related to parsing return a 400 status code

* Simplify method binding

* Forward api context to application methods

* There is no easy way to make generic opts typesafe

* Better separation of server / client code

* Fix comment about missing builder bid

* Remove todo, not worth the change / extra indentation

* Rename route definitions functions

* Return 400 if data passed to keymanager is invalid

* Properly handle response metadata headers

* Fix lint issues

* Add header jsdoc

* Move metadata related code into separate file

* Remove ssz from POST requests without body

* Only set content-type header if body exists

* Fix headers extra

* POST requests without body are handled similar to GET requests

* Fix http client options tests

* Improve validation and type safety of JSON metadata

* Add type guard for request without body

* Differentiate based on body instead of GET vs POST

* More renaming

* Simplify RequestCode type

* Review routes, improve validation

* Remaining local diff

* Fix accept header handling if only support one wire format

* Update 406 error to more closely match spec example

* Enforce version header via custom check instead of schema

* Use ssz as default request wire format

* Log failure to receive head event to verbose

* Do not set default value for context

* Update getClient return type to better align with method name

* Consistent pattern to get route definitions

* Dedupe api client type for builder and keymanager

* Fix fallback logic if server returns http error

* Update head event error logging

* Retry 415 errors with JSON and cache SSZ not supported

* Use fetch spy to assert call times

* Update comment

* Update getLightClientUpdatesByRange endpoint meta

* Do not forward ssz bytes of blinded block to publishBlock

* Fix lightclient e2e tests

* Version header in publishBlock api is optional

* Reduce type duplication

* Add option to override request init in route definition

* Add JsonOnlyResp codec

* Validate boolean str value from headers

* Document default wire formats

* Simplify merging of inits in http client

* Remove type hacks from fetchBeaconHealth

* Reduce call stack in http client

* Add .ssz() equivalent method for json to api response

* More http client tests

* Ensure topics query is provided to eventstream api

* Validate request content type in handler

Fastify does not cover all edge cases

* Review routes, fix param docs, no empty comments

* Fix typo

* Add note about builder spec not supporting ssz

* Consistently move keymanager jsdoc to routes

* Sanitize user provided init values before merging

* Remove unused ssz only codec

* Allow passing wire formats as string literals

* chore: review proof routes (#6843)

Review proof routes

* chore: review lightclient routes (#6842)

Review lightclient routes

* chore: review node routes (#6844)

Review node routes

* feat: add cli flags to configure http wire format (#6840)

* Review PR, mostly cosmetic changes

* Fix event stream error handling

---------

Co-authored-by: Cayman <[email protected]>
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.

1 participant