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: use POST variant to get validators from state #6897

Merged
merged 4 commits into from
Sep 26, 2024

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Jun 19, 2024

Motivation

The getStateValidators api has the limitation to only fetch up to 64 pubkeys per request without causing potential issues due URI limits enforced by the server (as pubkeys are sent as part of query).

This means the request either fails due to an error by the server if attempting to send too many keys (see #6830) or in case of our indices service, we have to chunk the request in batches with only up 64 keys, this can be really inefficient for nodes running a lot of keys.

Description

Use POST variant to get validators from state, we can send up to ~10k pubkeys per request which for most setups means only a single request. This also reduces the load on the beacon node as it does not have to apply the same filtering logic multiple times.

TODO

Closes #6831

Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 50.89%. Comparing base (2fcecd6) to head (37bcdcb).
Report is 16 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #6897      +/-   ##
============================================
- Coverage     50.90%   50.89%   -0.01%     
============================================
  Files           594      594              
  Lines         39611    39613       +2     
  Branches       2248     2248              
============================================
  Hits          20163    20163              
- Misses        19448    19450       +2     

Copy link
Contributor

github-actions bot commented Jun 19, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 23c66c3 Previous: 8da003e Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.0985 ms/op 2.5841 ms/op 0.81
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 54.563 us/op 101.02 us/op 0.54
BLS verify - blst 866.02 us/op 1.3320 ms/op 0.65
BLS verifyMultipleSignatures 3 - blst 1.2496 ms/op 2.2068 ms/op 0.57
BLS verifyMultipleSignatures 8 - blst 1.7023 ms/op 3.4488 ms/op 0.49
BLS verifyMultipleSignatures 32 - blst 5.0097 ms/op 9.4462 ms/op 0.53
BLS verifyMultipleSignatures 64 - blst 9.1873 ms/op 18.164 ms/op 0.51
BLS verifyMultipleSignatures 128 - blst 17.608 ms/op 30.790 ms/op 0.57
BLS deserializing 10000 signatures 689.68 ms/op 1.0342 s/op 0.67
BLS deserializing 100000 signatures 6.9905 s/op 10.218 s/op 0.68
BLS verifyMultipleSignatures - same message - 3 - blst 1.0183 ms/op 1.2822 ms/op 0.79
BLS verifyMultipleSignatures - same message - 8 - blst 1.1114 ms/op 1.1921 ms/op 0.93
BLS verifyMultipleSignatures - same message - 32 - blst 1.8372 ms/op 2.1086 ms/op 0.87
BLS verifyMultipleSignatures - same message - 64 - blst 2.6810 ms/op 3.5417 ms/op 0.76
BLS verifyMultipleSignatures - same message - 128 - blst 4.4665 ms/op 5.5125 ms/op 0.81
BLS aggregatePubkeys 32 - blst 20.254 us/op 26.404 us/op 0.77
BLS aggregatePubkeys 128 - blst 72.738 us/op 90.495 us/op 0.80
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 79.504 ms/op 65.648 ms/op 1.21
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 70.034 ms/op 95.562 ms/op 0.73
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 35.615 ms/op 54.941 ms/op 0.65
getSlashingsAndExits - default max 107.63 us/op 122.57 us/op 0.88
getSlashingsAndExits - 2k 365.38 us/op 373.08 us/op 0.98
proposeBlockBody type=full, size=empty 6.2776 ms/op 7.9526 ms/op 0.79
isKnown best case - 1 super set check 320.00 ns/op 542.00 ns/op 0.59
isKnown normal case - 2 super set checks 461.00 ns/op 532.00 ns/op 0.87
isKnown worse case - 16 super set checks 372.00 ns/op 586.00 ns/op 0.63
InMemoryCheckpointStateCache - add get delete 4.4080 us/op 5.1900 us/op 0.85
updateUnfinalizedPubkeys - updating 10 pubkeys 1.8388 ms/op 1.7262 ms/op 1.07
updateUnfinalizedPubkeys - updating 100 pubkeys 5.1826 ms/op 4.6085 ms/op 1.12
updateUnfinalizedPubkeys - updating 1000 pubkeys 60.963 ms/op 65.126 ms/op 0.94
validate api signedAggregateAndProof - struct 1.5815 ms/op 2.0146 ms/op 0.79
validate gossip signedAggregateAndProof - struct 1.5984 ms/op 2.3253 ms/op 0.69
validate gossip attestation - vc 640000 1.0983 ms/op 1.2264 ms/op 0.90
batch validate gossip attestation - vc 640000 - chunk 32 154.26 us/op 179.55 us/op 0.86
batch validate gossip attestation - vc 640000 - chunk 64 135.75 us/op 155.49 us/op 0.87
batch validate gossip attestation - vc 640000 - chunk 128 131.94 us/op 140.50 us/op 0.94
batch validate gossip attestation - vc 640000 - chunk 256 123.58 us/op 134.28 us/op 0.92
pickEth1Vote - no votes 1.3416 ms/op 1.4645 ms/op 0.92
pickEth1Vote - max votes 9.1068 ms/op 8.7918 ms/op 1.04
pickEth1Vote - Eth1Data hashTreeRoot value x2048 19.594 ms/op 20.018 ms/op 0.98
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 30.259 ms/op 26.976 ms/op 1.12
pickEth1Vote - Eth1Data fastSerialize value x2048 621.15 us/op 718.32 us/op 0.86
pickEth1Vote - Eth1Data fastSerialize tree x2048 4.9679 ms/op 3.2106 ms/op 1.55
bytes32 toHexString 761.00 ns/op 529.00 ns/op 1.44
bytes32 Buffer.toString(hex) 279.00 ns/op 310.00 ns/op 0.90
bytes32 Buffer.toString(hex) from Uint8Array 524.00 ns/op 515.00 ns/op 1.02
bytes32 Buffer.toString(hex) + 0x 275.00 ns/op 319.00 ns/op 0.86
Object access 1 prop 0.20200 ns/op 0.23000 ns/op 0.88
Map access 1 prop 0.14100 ns/op 0.20400 ns/op 0.69
Object get x1000 6.2050 ns/op 13.229 ns/op 0.47
Map get x1000 6.5920 ns/op 13.784 ns/op 0.48
Object set x1000 58.299 ns/op 42.790 ns/op 1.36
Map set x1000 38.450 ns/op 33.003 ns/op 1.17
Return object 10000 times 0.31480 ns/op 0.39220 ns/op 0.80
Throw Error 10000 times 3.6870 us/op 4.9361 us/op 0.75
toHex 177.18 ns/op 198.35 ns/op 0.89
Buffer.from 154.54 ns/op 168.50 ns/op 0.92
shared Buffer 96.522 ns/op 116.59 ns/op 0.83
fastMsgIdFn sha256 / 200 bytes 2.3700 us/op 2.9700 us/op 0.80
fastMsgIdFn h32 xxhash / 200 bytes 311.00 ns/op 332.00 ns/op 0.94
fastMsgIdFn h64 xxhash / 200 bytes 296.00 ns/op 322.00 ns/op 0.92
fastMsgIdFn sha256 / 1000 bytes 7.5980 us/op 9.3320 us/op 0.81
fastMsgIdFn h32 xxhash / 1000 bytes 447.00 ns/op 465.00 ns/op 0.96
fastMsgIdFn h64 xxhash / 1000 bytes 390.00 ns/op 421.00 ns/op 0.93
fastMsgIdFn sha256 / 10000 bytes 66.999 us/op 78.591 us/op 0.85
fastMsgIdFn h32 xxhash / 10000 bytes 2.0040 us/op 2.3030 us/op 0.87
fastMsgIdFn h64 xxhash / 10000 bytes 1.3010 us/op 1.4210 us/op 0.92
send data - 1000 256B messages 14.623 ms/op 18.375 ms/op 0.80
send data - 1000 512B messages 18.833 ms/op 24.147 ms/op 0.78
send data - 1000 1024B messages 29.014 ms/op 37.320 ms/op 0.78
send data - 1000 1200B messages 27.439 ms/op 34.158 ms/op 0.80
send data - 1000 2048B messages 38.299 ms/op 44.049 ms/op 0.87
send data - 1000 4096B messages 34.248 ms/op 45.756 ms/op 0.75
send data - 1000 16384B messages 81.094 ms/op 88.863 ms/op 0.91
send data - 1000 65536B messages 290.03 ms/op 310.48 ms/op 0.93
enrSubnets - fastDeserialize 64 bits 1.1990 us/op 1.5750 us/op 0.76
enrSubnets - ssz BitVector 64 bits 360.00 ns/op 517.00 ns/op 0.70
enrSubnets - fastDeserialize 4 bits 153.00 ns/op 224.00 ns/op 0.68
enrSubnets - ssz BitVector 4 bits 368.00 ns/op 538.00 ns/op 0.68
prioritizePeers score -10:0 att 32-0.1 sync 2-0 149.48 us/op 212.95 us/op 0.70
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 174.96 us/op 200.00 us/op 0.87
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 275.89 us/op 423.32 us/op 0.65
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 411.88 us/op 514.00 us/op 0.80
prioritizePeers score 0:0 att 64-1 sync 4-1 605.07 us/op 896.65 us/op 0.67
array of 16000 items push then shift 1.6551 us/op 2.1122 us/op 0.78
LinkedList of 16000 items push then shift 7.6080 ns/op 8.4250 ns/op 0.90
array of 16000 items push then pop 99.097 ns/op 188.44 ns/op 0.53
LinkedList of 16000 items push then pop 7.3000 ns/op 8.9740 ns/op 0.81
array of 24000 items push then shift 2.4023 us/op 2.8975 us/op 0.83
LinkedList of 24000 items push then shift 7.5800 ns/op 8.3400 ns/op 0.91
array of 24000 items push then pop 174.20 ns/op 281.09 ns/op 0.62
LinkedList of 24000 items push then pop 7.3210 ns/op 9.4290 ns/op 0.78
intersect bitArray bitLen 8 6.4650 ns/op 8.0530 ns/op 0.80
intersect array and set length 8 47.949 ns/op 51.852 ns/op 0.92
intersect bitArray bitLen 128 29.746 ns/op 34.287 ns/op 0.87
intersect array and set length 128 693.23 ns/op 795.13 ns/op 0.87
bitArray.getTrueBitIndexes() bitLen 128 2.1100 us/op 2.5200 us/op 0.84
bitArray.getTrueBitIndexes() bitLen 248 3.0310 us/op 3.7250 us/op 0.81
bitArray.getTrueBitIndexes() bitLen 512 6.5890 us/op 9.2370 us/op 0.71
Buffer.concat 32 items 968.00 ns/op 1.0850 us/op 0.89
Uint8Array.set 32 items 1.5720 us/op 1.8750 us/op 0.84
Buffer.copy 1.8010 us/op 2.7050 us/op 0.67
Uint8Array.set - with subarray 2.6550 us/op 4.2270 us/op 0.63
Uint8Array.set - without subarray 1.3770 us/op 2.1640 us/op 0.64
getUint32 - dataview 242.00 ns/op 257.00 ns/op 0.94
getUint32 - manual 165.00 ns/op 172.00 ns/op 0.96
Set add up to 64 items then delete first 2.2265 us/op 2.4498 us/op 0.91
OrderedSet add up to 64 items then delete first 3.4535 us/op 3.7593 us/op 0.92
Set add up to 64 items then delete last 2.5811 us/op 3.1067 us/op 0.83
OrderedSet add up to 64 items then delete last 4.0078 us/op 4.3920 us/op 0.91
Set add up to 64 items then delete middle 2.5958 us/op 2.9863 us/op 0.87
OrderedSet add up to 64 items then delete middle 5.4864 us/op 6.9345 us/op 0.79
Set add up to 128 items then delete first 5.0393 us/op 6.3213 us/op 0.80
OrderedSet add up to 128 items then delete first 8.4674 us/op 8.5711 us/op 0.99
Set add up to 128 items then delete last 6.4167 us/op 5.4214 us/op 1.18
OrderedSet add up to 128 items then delete last 9.3922 us/op 8.9016 us/op 1.06
Set add up to 128 items then delete middle 5.8222 us/op 5.7092 us/op 1.02
OrderedSet add up to 128 items then delete middle 15.818 us/op 19.221 us/op 0.82
Set add up to 256 items then delete first 13.730 us/op 12.252 us/op 1.12
OrderedSet add up to 256 items then delete first 17.110 us/op 17.386 us/op 0.98
Set add up to 256 items then delete last 12.138 us/op 11.754 us/op 1.03
OrderedSet add up to 256 items then delete last 18.437 us/op 17.404 us/op 1.06
Set add up to 256 items then delete middle 12.299 us/op 12.109 us/op 1.02
OrderedSet add up to 256 items then delete middle 46.469 us/op 54.543 us/op 0.85
transfer serialized Status (84 B) 1.4730 us/op 1.6440 us/op 0.90
copy serialized Status (84 B) 1.3490 us/op 1.3520 us/op 1.00
transfer serialized SignedVoluntaryExit (112 B) 1.4790 us/op 1.5800 us/op 0.94
copy serialized SignedVoluntaryExit (112 B) 1.2320 us/op 1.3060 us/op 0.94
transfer serialized ProposerSlashing (416 B) 1.7580 us/op 1.9270 us/op 0.91
copy serialized ProposerSlashing (416 B) 1.8220 us/op 2.1070 us/op 0.86
transfer serialized Attestation (485 B) 1.8680 us/op 2.0470 us/op 0.91
copy serialized Attestation (485 B) 1.6480 us/op 1.8960 us/op 0.87
transfer serialized AttesterSlashing (33232 B) 1.9530 us/op 1.8830 us/op 1.04
copy serialized AttesterSlashing (33232 B) 5.5480 us/op 5.1220 us/op 1.08
transfer serialized Small SignedBeaconBlock (128000 B) 3.0700 us/op 2.4480 us/op 1.25
copy serialized Small SignedBeaconBlock (128000 B) 17.983 us/op 15.155 us/op 1.19
transfer serialized Avg SignedBeaconBlock (200000 B) 3.9150 us/op 2.9000 us/op 1.35
copy serialized Avg SignedBeaconBlock (200000 B) 28.004 us/op 24.448 us/op 1.15
transfer serialized BlobsSidecar (524380 B) 3.8090 us/op 3.5630 us/op 1.07
copy serialized BlobsSidecar (524380 B) 90.519 us/op 88.221 us/op 1.03
transfer serialized Big SignedBeaconBlock (1000000 B) 3.9700 us/op 3.4820 us/op 1.14
copy serialized Big SignedBeaconBlock (1000000 B) 179.35 us/op 158.94 us/op 1.13
pass gossip attestations to forkchoice per slot 2.9882 ms/op 3.6671 ms/op 0.81
forkChoice updateHead vc 100000 bc 64 eq 0 502.13 us/op 675.76 us/op 0.74
forkChoice updateHead vc 600000 bc 64 eq 0 3.2580 ms/op 4.7724 ms/op 0.68
forkChoice updateHead vc 1000000 bc 64 eq 0 5.4897 ms/op 6.7527 ms/op 0.81
forkChoice updateHead vc 600000 bc 320 eq 0 3.2380 ms/op 3.7954 ms/op 0.85
forkChoice updateHead vc 600000 bc 1200 eq 0 3.7555 ms/op 4.3144 ms/op 0.87
forkChoice updateHead vc 600000 bc 7200 eq 0 4.3413 ms/op 4.1437 ms/op 1.05
forkChoice updateHead vc 600000 bc 64 eq 1000 11.040 ms/op 12.787 ms/op 0.86
forkChoice updateHead vc 600000 bc 64 eq 10000 11.584 ms/op 12.635 ms/op 0.92
forkChoice updateHead vc 600000 bc 64 eq 300000 14.773 ms/op 16.943 ms/op 0.87
computeDeltas 500000 validators 300 proto nodes 3.9893 ms/op 4.8954 ms/op 0.81
computeDeltas 500000 validators 1200 proto nodes 4.7417 ms/op 5.1782 ms/op 0.92
computeDeltas 500000 validators 7200 proto nodes 4.8118 ms/op 5.1868 ms/op 0.93
computeDeltas 750000 validators 300 proto nodes 9.1329 ms/op 8.5074 ms/op 1.07
computeDeltas 750000 validators 1200 proto nodes 9.1675 ms/op 7.9842 ms/op 1.15
computeDeltas 750000 validators 7200 proto nodes 7.6292 ms/op 7.2881 ms/op 1.05
computeDeltas 1400000 validators 300 proto nodes 13.991 ms/op 13.205 ms/op 1.06
computeDeltas 1400000 validators 1200 proto nodes 12.483 ms/op 12.636 ms/op 0.99
computeDeltas 1400000 validators 7200 proto nodes 13.598 ms/op 13.870 ms/op 0.98
computeDeltas 2100000 validators 300 proto nodes 27.033 ms/op 18.873 ms/op 1.43
computeDeltas 2100000 validators 1200 proto nodes 21.862 ms/op 17.331 ms/op 1.26
computeDeltas 2100000 validators 7200 proto nodes 19.737 ms/op 19.470 ms/op 1.01
altair processAttestation - 250000 vs - 7PWei normalcase 2.8494 ms/op 1.8383 ms/op 1.55
altair processAttestation - 250000 vs - 7PWei worstcase 4.3360 ms/op 2.9069 ms/op 1.49
altair processAttestation - setStatus - 1/6 committees join 155.77 us/op 112.04 us/op 1.39
altair processAttestation - setStatus - 1/3 committees join 232.44 us/op 192.83 us/op 1.21
altair processAttestation - setStatus - 1/2 committees join 359.30 us/op 307.73 us/op 1.17
altair processAttestation - setStatus - 2/3 committees join 451.11 us/op 360.35 us/op 1.25
altair processAttestation - setStatus - 4/5 committees join 689.17 us/op 514.66 us/op 1.34
altair processAttestation - setStatus - 100% committees join 804.91 us/op 618.81 us/op 1.30
altair processBlock - 250000 vs - 7PWei normalcase 5.5468 ms/op 6.6557 ms/op 0.83
altair processBlock - 250000 vs - 7PWei normalcase hashState 37.770 ms/op 27.199 ms/op 1.39
altair processBlock - 250000 vs - 7PWei worstcase 54.152 ms/op 39.900 ms/op 1.36
altair processBlock - 250000 vs - 7PWei worstcase hashState 102.41 ms/op 84.008 ms/op 1.22
phase0 processBlock - 250000 vs - 7PWei normalcase 3.4896 ms/op 2.5345 ms/op 1.38
phase0 processBlock - 250000 vs - 7PWei worstcase 34.875 ms/op 26.424 ms/op 1.32
altair processEth1Data - 250000 vs - 7PWei normalcase 735.88 us/op 311.38 us/op 2.36
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 12.283 us/op 8.3150 us/op 1.48
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 64.584 us/op 46.593 us/op 1.39
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 20.048 us/op 9.1630 us/op 2.19
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 13.344 us/op 6.1110 us/op 2.18
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 242.79 us/op 152.84 us/op 1.59
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.6599 ms/op 1.4166 ms/op 1.17
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.3513 ms/op 2.1139 ms/op 1.11
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.2767 ms/op 2.5628 ms/op 0.89
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 5.0859 ms/op 3.5066 ms/op 1.45
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.9700 ms/op 2.7326 ms/op 0.72
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 5.3464 ms/op 3.5210 ms/op 1.52
Tree 40 250000 create 412.98 ms/op 243.28 ms/op 1.70
Tree 40 250000 get(125000) 177.96 ns/op 165.65 ns/op 1.07
Tree 40 250000 set(125000) 905.07 ns/op 656.50 ns/op 1.38
Tree 40 250000 toArray() 22.909 ms/op 15.688 ms/op 1.46
Tree 40 250000 iterate all - toArray() + loop 25.000 ms/op 16.615 ms/op 1.50
Tree 40 250000 iterate all - get(i) 75.836 ms/op 51.608 ms/op 1.47
Array 250000 create 4.6837 ms/op 2.8580 ms/op 1.64
Array 250000 clone - spread 1.8809 ms/op 1.3408 ms/op 1.40
Array 250000 get(125000) 0.48300 ns/op 0.41900 ns/op 1.15
Array 250000 set(125000) 0.52200 ns/op 0.43700 ns/op 1.19
Array 250000 iterate all - loop 90.976 us/op 104.65 us/op 0.87
phase0 afterProcessEpoch - 250000 vs - 7PWei 109.19 ms/op 89.092 ms/op 1.23
Array.fill - length 1000000 6.8025 ms/op 3.4606 ms/op 1.97
Array push - length 1000000 27.504 ms/op 22.746 ms/op 1.21
Array.get 0.39718 ns/op 0.28418 ns/op 1.40
Uint8Array.get 0.51248 ns/op 0.45459 ns/op 1.13
phase0 beforeProcessEpoch - 250000 vs - 7PWei 23.330 ms/op 15.694 ms/op 1.49
altair processEpoch - mainnet_e81889 400.52 ms/op 336.35 ms/op 1.19
mainnet_e81889 - altair beforeProcessEpoch 27.634 ms/op 18.095 ms/op 1.53
mainnet_e81889 - altair processJustificationAndFinalization 25.904 us/op 13.643 us/op 1.90
mainnet_e81889 - altair processInactivityUpdates 7.9428 ms/op 5.4718 ms/op 1.45
mainnet_e81889 - altair processRewardsAndPenalties 64.932 ms/op 62.628 ms/op 1.04
mainnet_e81889 - altair processRegistryUpdates 5.1420 us/op 2.2620 us/op 2.27
mainnet_e81889 - altair processSlashings 1.0480 us/op 486.00 ns/op 2.16
mainnet_e81889 - altair processEth1DataReset 725.00 ns/op 367.00 ns/op 1.98
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.3531 ms/op 3.6899 ms/op 0.64
mainnet_e81889 - altair processSlashingsReset 6.2850 us/op 4.7350 us/op 1.33
mainnet_e81889 - altair processRandaoMixesReset 10.275 us/op 3.2360 us/op 3.18
mainnet_e81889 - altair processHistoricalRootsUpdate 1.2600 us/op 443.00 ns/op 2.84
mainnet_e81889 - altair processParticipationFlagUpdates 3.4030 us/op 1.5660 us/op 2.17
mainnet_e81889 - altair processSyncCommitteeUpdates 1.1000 us/op 303.00 ns/op 3.63
mainnet_e81889 - altair afterProcessEpoch 119.71 ms/op 103.05 ms/op 1.16
capella processEpoch - mainnet_e217614 1.5481 s/op 1.1976 s/op 1.29
mainnet_e217614 - capella beforeProcessEpoch 92.282 ms/op 79.200 ms/op 1.17
mainnet_e217614 - capella processJustificationAndFinalization 29.436 us/op 19.025 us/op 1.55
mainnet_e217614 - capella processInactivityUpdates 24.523 ms/op 17.861 ms/op 1.37
mainnet_e217614 - capella processRewardsAndPenalties 300.53 ms/op 277.85 ms/op 1.08
mainnet_e217614 - capella processRegistryUpdates 17.357 us/op 18.868 us/op 0.92
mainnet_e217614 - capella processSlashings 623.00 ns/op 818.00 ns/op 0.76
mainnet_e217614 - capella processEth1DataReset 412.00 ns/op 543.00 ns/op 0.76
mainnet_e217614 - capella processEffectiveBalanceUpdates 15.715 ms/op 7.6289 ms/op 2.06
mainnet_e217614 - capella processSlashingsReset 11.162 us/op 4.3280 us/op 2.58
mainnet_e217614 - capella processRandaoMixesReset 8.4900 us/op 5.3230 us/op 1.59
mainnet_e217614 - capella processHistoricalRootsUpdate 904.00 ns/op 612.00 ns/op 1.48
mainnet_e217614 - capella processParticipationFlagUpdates 2.5650 us/op 2.5170 us/op 1.02
mainnet_e217614 - capella afterProcessEpoch 255.20 ms/op 254.84 ms/op 1.00
phase0 processEpoch - mainnet_e58758 445.47 ms/op 399.63 ms/op 1.11
mainnet_e58758 - phase0 beforeProcessEpoch 106.05 ms/op 87.243 ms/op 1.22
mainnet_e58758 - phase0 processJustificationAndFinalization 24.245 us/op 16.578 us/op 1.46
mainnet_e58758 - phase0 processRewardsAndPenalties 42.232 ms/op 33.795 ms/op 1.25
mainnet_e58758 - phase0 processRegistryUpdates 14.480 us/op 7.7160 us/op 1.88
mainnet_e58758 - phase0 processSlashings 566.00 ns/op 545.00 ns/op 1.04
mainnet_e58758 - phase0 processEth1DataReset 623.00 ns/op 1.1170 us/op 0.56
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 3.6683 ms/op 2.9744 ms/op 1.23
mainnet_e58758 - phase0 processSlashingsReset 4.3440 us/op 5.3850 us/op 0.81
mainnet_e58758 - phase0 processRandaoMixesReset 8.2210 us/op 7.6700 us/op 1.07
mainnet_e58758 - phase0 processHistoricalRootsUpdate 588.00 ns/op 889.00 ns/op 0.66
mainnet_e58758 - phase0 processParticipationRecordUpdates 5.0190 us/op 4.8840 us/op 1.03
mainnet_e58758 - phase0 afterProcessEpoch 88.354 ms/op 77.449 ms/op 1.14
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.4277 ms/op 1.3821 ms/op 1.76
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 6.2318 ms/op 2.2754 ms/op 2.74
altair processInactivityUpdates - 250000 normalcase 20.739 ms/op 24.815 ms/op 0.84
altair processInactivityUpdates - 250000 worstcase 16.494 ms/op 20.795 ms/op 0.79
phase0 processRegistryUpdates - 250000 normalcase 7.7310 us/op 9.3900 us/op 0.82
phase0 processRegistryUpdates - 250000 badcase_full_deposits 306.54 us/op 468.27 us/op 0.65
phase0 processRegistryUpdates - 250000 worstcase 0.5 127.20 ms/op 145.45 ms/op 0.87
altair processRewardsAndPenalties - 250000 normalcase 46.555 ms/op 55.382 ms/op 0.84
altair processRewardsAndPenalties - 250000 worstcase 48.319 ms/op 53.445 ms/op 0.90
phase0 getAttestationDeltas - 250000 normalcase 9.5490 ms/op 6.7848 ms/op 1.41
phase0 getAttestationDeltas - 250000 worstcase 9.6870 ms/op 6.4486 ms/op 1.50
phase0 processSlashings - 250000 worstcase 114.01 us/op 121.22 us/op 0.94
altair processSyncCommitteeUpdates - 250000 133.13 ms/op 120.38 ms/op 1.11
BeaconState.hashTreeRoot - No change 440.00 ns/op 263.00 ns/op 1.67
BeaconState.hashTreeRoot - 1 full validator 125.87 us/op 147.89 us/op 0.85
BeaconState.hashTreeRoot - 32 full validator 1.2054 ms/op 1.5804 ms/op 0.76
BeaconState.hashTreeRoot - 512 full validator 14.058 ms/op 15.863 ms/op 0.89
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 179.42 us/op 141.47 us/op 1.27
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.2400 ms/op 2.2454 ms/op 1.00
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 23.912 ms/op 29.879 ms/op 0.80
BeaconState.hashTreeRoot - 1 balances 92.862 us/op 121.62 us/op 0.76
BeaconState.hashTreeRoot - 32 balances 909.31 us/op 1.2302 ms/op 0.74
BeaconState.hashTreeRoot - 512 balances 8.5209 ms/op 12.540 ms/op 0.68
BeaconState.hashTreeRoot - 250000 balances 176.44 ms/op 195.47 ms/op 0.90
aggregationBits - 2048 els - zipIndexesInBitList 28.749 us/op 26.441 us/op 1.09
byteArrayEquals 32 55.361 ns/op 54.895 ns/op 1.01
Buffer.compare 32 17.290 ns/op 18.222 ns/op 0.95
byteArrayEquals 1024 1.6851 us/op 1.6026 us/op 1.05
Buffer.compare 1024 26.090 ns/op 26.608 ns/op 0.98
byteArrayEquals 16384 25.668 us/op 25.567 us/op 1.00
Buffer.compare 16384 195.18 ns/op 194.57 ns/op 1.00
byteArrayEquals 123687377 214.11 ms/op 197.16 ms/op 1.09
Buffer.compare 123687377 7.8252 ms/op 6.2707 ms/op 1.25
byteArrayEquals 32 - diff last byte 53.656 ns/op 55.429 ns/op 0.97
Buffer.compare 32 - diff last byte 17.415 ns/op 19.018 ns/op 0.92
byteArrayEquals 1024 - diff last byte 1.6258 us/op 1.6509 us/op 0.98
Buffer.compare 1024 - diff last byte 26.026 ns/op 31.334 ns/op 0.83
byteArrayEquals 16384 - diff last byte 26.339 us/op 26.207 us/op 1.01
Buffer.compare 16384 - diff last byte 185.54 ns/op 192.90 ns/op 0.96
byteArrayEquals 123687377 - diff last byte 199.82 ms/op 198.58 ms/op 1.01
Buffer.compare 123687377 - diff last byte 10.029 ms/op 6.1690 ms/op 1.63
byteArrayEquals 32 - random bytes 5.6420 ns/op 5.7260 ns/op 0.99
Buffer.compare 32 - random bytes 19.800 ns/op 18.467 ns/op 1.07
byteArrayEquals 1024 - random bytes 5.5400 ns/op 5.2350 ns/op 1.06
Buffer.compare 1024 - random bytes 19.612 ns/op 17.770 ns/op 1.10
byteArrayEquals 16384 - random bytes 5.4350 ns/op 5.2610 ns/op 1.03
Buffer.compare 16384 - random bytes 19.388 ns/op 17.934 ns/op 1.08
byteArrayEquals 123687377 - random bytes 6.9800 ns/op 6.5100 ns/op 1.07
Buffer.compare 123687377 - random bytes 21.310 ns/op 19.120 ns/op 1.11
regular array get 100000 times 35.282 us/op 39.504 us/op 0.89
wrappedArray get 100000 times 40.011 us/op 43.048 us/op 0.93
arrayWithProxy get 100000 times 14.475 ms/op 14.586 ms/op 0.99
ssz.Root.equals 47.866 ns/op 47.207 ns/op 1.01
byteArrayEquals 48.283 ns/op 46.208 ns/op 1.04
Buffer.compare 13.063 ns/op 11.271 ns/op 1.16
shuffle list - 16384 els 6.5977 ms/op 6.9603 ms/op 0.95
shuffle list - 250000 els 98.832 ms/op 94.178 ms/op 1.05
processSlot - 1 slots 14.268 us/op 11.911 us/op 1.20
processSlot - 32 slots 2.9515 ms/op 2.7789 ms/op 1.06
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 38.642 ms/op 43.308 ms/op 0.89
getCommitteeAssignments - req 1 vs - 250000 vc 2.2305 ms/op 2.2761 ms/op 0.98
getCommitteeAssignments - req 100 vs - 250000 vc 4.2923 ms/op 4.3763 ms/op 0.98
getCommitteeAssignments - req 1000 vs - 250000 vc 4.5837 ms/op 4.6677 ms/op 0.98
findModifiedValidators - 10000 modified validators 364.61 ms/op 276.92 ms/op 1.32
findModifiedValidators - 1000 modified validators 197.68 ms/op 200.54 ms/op 0.99
findModifiedValidators - 100 modified validators 191.35 ms/op 195.41 ms/op 0.98
findModifiedValidators - 10 modified validators 199.28 ms/op 174.01 ms/op 1.15
findModifiedValidators - 1 modified validators 185.47 ms/op 189.02 ms/op 0.98
findModifiedValidators - no difference 183.80 ms/op 185.37 ms/op 0.99
compare ViewDUs 3.5594 s/op 3.2527 s/op 1.09
compare each validator Uint8Array 1.2885 s/op 1.6199 s/op 0.80
compare ViewDU to Uint8Array 1.1010 s/op 1.1882 s/op 0.93
migrate state 1000000 validators, 24 modified, 0 new 603.83 ms/op 587.86 ms/op 1.03
migrate state 1000000 validators, 1700 modified, 1000 new 777.49 ms/op 806.82 ms/op 0.96
migrate state 1000000 validators, 3400 modified, 2000 new 1.0186 s/op 1.0981 s/op 0.93
migrate state 1500000 validators, 24 modified, 0 new 606.84 ms/op 719.56 ms/op 0.84
migrate state 1500000 validators, 1700 modified, 1000 new 829.78 ms/op 816.87 ms/op 1.02
migrate state 1500000 validators, 3400 modified, 2000 new 978.24 ms/op 1.1795 s/op 0.83
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.7400 ns/op 6.5600 ns/op 0.72
state getBlockRootAtSlot - 250000 vs - 7PWei 719.01 ns/op 882.35 ns/op 0.81
computeProposers - vc 250000 7.9509 ms/op 9.8232 ms/op 0.81
computeEpochShuffling - vc 250000 94.420 ms/op 128.28 ms/op 0.74
getNextSyncCommittee - vc 250000 128.17 ms/op 188.02 ms/op 0.68
computeSigningRoot for AttestationData 20.276 us/op 33.902 us/op 0.60
hash AttestationData serialized data then Buffer.toString(base64) 1.6701 us/op 2.1470 us/op 0.78
toHexString serialized data 1.0140 us/op 1.2543 us/op 0.81
Buffer.toString(base64) 199.89 ns/op 253.94 ns/op 0.79
nodejs block root to RootHex using toHex 168.58 ns/op 183.00 ns/op 0.92
nodejs block root to RootHex using toRootHex 107.20 ns/op 138.50 ns/op 0.77
browser block root to RootHex using the deprecated toHexString 250.62 ns/op 299.19 ns/op 0.84
browser block root to RootHex using toHex 194.56 ns/op 296.01 ns/op 0.66
browser block root to RootHex using toRootHex 177.20 ns/op 220.47 ns/op 0.80

by benchmarkbot/action

@nflaig nflaig marked this pull request as ready for review September 17, 2024 14:38
@nflaig nflaig requested a review from a team as a code owner September 17, 2024 14:38
@nflaig nflaig added this to the v1.23.0 milestone Sep 18, 2024
@nflaig nflaig merged commit 58dea75 into unstable Sep 26, 2024
20 checks passed
@nflaig nflaig deleted the nflaig/use-postStateValidators branch September 26, 2024 20:59
philknows pushed a commit that referenced this pull request Sep 27, 2024
* feat: use POST variant to get validators from state

* Fix api handler used during testing

* Update more calls to use POST variant
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.

Replace GET validators api calls with POST api where possible
2 participants