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: default to json if client accepts all media types #6950

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Jul 15, 2024

Motivation

This allows to query beacon api via browser URL input field.

By default chrome browser sets a header like this

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7

It does not explicitly state that it wants ssz or json but it adds */* with q=0.8, while this is handled correctly for a header that solely uses this value, it does not work in a quality weighted header right now.

Currently Lodestar returns the following error

{
"statusCode": 406,
"error": "Not Acceptable",
"message": "Accepted media types not supported: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"
}

Description

Default to json if client accepts all media types as part of quality weighted accept header.

Note: we will still return ssz data if application/octet-stream is part of the Accept header with a higher weight

@nflaig nflaig requested a review from a team as a code owner July 15, 2024 12:36
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 6eebbf4 Previous: 6ab2697 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 434.55 us/op 518.91 us/op 0.84
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 49.064 us/op 54.965 us/op 0.89
BLS verify - blst-native 1.2771 ms/op 1.2238 ms/op 1.04
BLS verifyMultipleSignatures 3 - blst-native 2.7142 ms/op 2.6068 ms/op 1.04
BLS verifyMultipleSignatures 8 - blst-native 6.0260 ms/op 5.7385 ms/op 1.05
BLS verifyMultipleSignatures 32 - blst-native 21.470 ms/op 21.080 ms/op 1.02
BLS verifyMultipleSignatures 64 - blst-native 42.348 ms/op 41.548 ms/op 1.02
BLS verifyMultipleSignatures 128 - blst-native 84.058 ms/op 82.586 ms/op 1.02
BLS deserializing 10000 signatures 870.25 ms/op 885.36 ms/op 0.98
BLS deserializing 100000 signatures 8.6630 s/op 8.5756 s/op 1.01
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.2446 ms/op 1.2246 ms/op 1.02
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.4821 ms/op 1.4011 ms/op 1.06
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.2173 ms/op 2.1983 ms/op 1.01
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.5616 ms/op 3.3846 ms/op 1.05
BLS verifyMultipleSignatures - same message - 128 - blst-native 6.0862 ms/op 5.9969 ms/op 1.01
BLS aggregatePubkeys 32 - blst-native 25.272 us/op 24.774 us/op 1.02
BLS aggregatePubkeys 128 - blst-native 96.675 us/op 97.276 us/op 0.99
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 53.534 ms/op 55.820 ms/op 0.96
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 61.738 ms/op 49.741 ms/op 1.24
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 33.827 ms/op 31.733 ms/op 1.07
getSlashingsAndExits - default max 102.87 us/op 92.110 us/op 1.12
getSlashingsAndExits - 2k 318.15 us/op 289.99 us/op 1.10
proposeBlockBody type=full, size=empty 5.7685 ms/op 5.7864 ms/op 1.00
isKnown best case - 1 super set check 310.00 ns/op 303.00 ns/op 1.02
isKnown normal case - 2 super set checks 298.00 ns/op 283.00 ns/op 1.05
isKnown worse case - 16 super set checks 290.00 ns/op 279.00 ns/op 1.04
InMemoryCheckpointStateCache - add get delete 6.0950 us/op 5.0600 us/op 1.20
validate api signedAggregateAndProof - struct 2.6652 ms/op 2.6356 ms/op 1.01
validate gossip signedAggregateAndProof - struct 2.7671 ms/op 2.6518 ms/op 1.04
validate gossip attestation - vc 640000 1.2937 ms/op 1.2797 ms/op 1.01
batch validate gossip attestation - vc 640000 - chunk 32 158.76 us/op 150.81 us/op 1.05
batch validate gossip attestation - vc 640000 - chunk 64 136.11 us/op 134.79 us/op 1.01
batch validate gossip attestation - vc 640000 - chunk 128 126.99 us/op 122.20 us/op 1.04
batch validate gossip attestation - vc 640000 - chunk 256 119.54 us/op 120.67 us/op 0.99
pickEth1Vote - no votes 1.1180 ms/op 1.0999 ms/op 1.02
pickEth1Vote - max votes 6.8046 ms/op 8.4193 ms/op 0.81
pickEth1Vote - Eth1Data hashTreeRoot value x2048 12.116 ms/op 12.868 ms/op 0.94
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 16.679 ms/op 17.388 ms/op 0.96
pickEth1Vote - Eth1Data fastSerialize value x2048 577.97 us/op 532.40 us/op 1.09
pickEth1Vote - Eth1Data fastSerialize tree x2048 3.8069 ms/op 3.7685 ms/op 1.01
bytes32 toHexString 461.00 ns/op 469.00 ns/op 0.98
bytes32 Buffer.toString(hex) 261.00 ns/op 260.00 ns/op 1.00
bytes32 Buffer.toString(hex) from Uint8Array 456.00 ns/op 368.00 ns/op 1.24
bytes32 Buffer.toString(hex) + 0x 256.00 ns/op 258.00 ns/op 0.99
Object access 1 prop 0.15200 ns/op 0.13500 ns/op 1.13
Map access 1 prop 0.13300 ns/op 0.13800 ns/op 0.96
Object get x1000 6.2050 ns/op 6.0670 ns/op 1.02
Map get x1000 6.7050 ns/op 6.5280 ns/op 1.03
Object set x1000 34.357 ns/op 35.641 ns/op 0.96
Map set x1000 24.614 ns/op 26.327 ns/op 0.93
Return object 10000 times 0.29810 ns/op 0.30100 ns/op 0.99
Throw Error 10000 times 3.4368 us/op 3.4539 us/op 1.00
fastMsgIdFn sha256 / 200 bytes 2.2580 us/op 2.3120 us/op 0.98
fastMsgIdFn h32 xxhash / 200 bytes 240.00 ns/op 256.00 ns/op 0.94
fastMsgIdFn h64 xxhash / 200 bytes 273.00 ns/op 286.00 ns/op 0.95
fastMsgIdFn sha256 / 1000 bytes 7.3160 us/op 7.7180 us/op 0.95
fastMsgIdFn h32 xxhash / 1000 bytes 373.00 ns/op 422.00 ns/op 0.88
fastMsgIdFn h64 xxhash / 1000 bytes 349.00 ns/op 382.00 ns/op 0.91
fastMsgIdFn sha256 / 10000 bytes 66.106 us/op 64.852 us/op 1.02
fastMsgIdFn h32 xxhash / 10000 bytes 1.9250 us/op 1.9180 us/op 1.00
fastMsgIdFn h64 xxhash / 10000 bytes 1.2500 us/op 1.2570 us/op 0.99
send data - 1000 256B messages 13.991 ms/op 12.429 ms/op 1.13
send data - 1000 512B messages 18.803 ms/op 16.949 ms/op 1.11
send data - 1000 1024B messages 30.437 ms/op 28.131 ms/op 1.08
send data - 1000 1200B messages 28.529 ms/op 26.033 ms/op 1.10
send data - 1000 2048B messages 32.293 ms/op 33.181 ms/op 0.97
send data - 1000 4096B messages 29.932 ms/op 32.264 ms/op 0.93
send data - 1000 16384B messages 72.822 ms/op 74.794 ms/op 0.97
send data - 1000 65536B messages 225.91 ms/op 214.29 ms/op 1.05
enrSubnets - fastDeserialize 64 bits 1.1650 us/op 1.0770 us/op 1.08
enrSubnets - ssz BitVector 64 bits 401.00 ns/op 358.00 ns/op 1.12
enrSubnets - fastDeserialize 4 bits 167.00 ns/op 161.00 ns/op 1.04
enrSubnets - ssz BitVector 4 bits 376.00 ns/op 362.00 ns/op 1.04
prioritizePeers score -10:0 att 32-0.1 sync 2-0 176.72 us/op 148.56 us/op 1.19
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 186.09 us/op 165.16 us/op 1.13
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 289.57 us/op 236.93 us/op 1.22
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 411.55 us/op 409.70 us/op 1.00
prioritizePeers score 0:0 att 64-1 sync 4-1 689.76 us/op 585.00 us/op 1.18
array of 16000 items push then shift 1.7200 us/op 1.6668 us/op 1.03
LinkedList of 16000 items push then shift 7.9920 ns/op 7.9150 ns/op 1.01
array of 16000 items push then pop 143.34 ns/op 125.54 ns/op 1.14
LinkedList of 16000 items push then pop 7.9260 ns/op 7.5740 ns/op 1.05
array of 24000 items push then shift 2.5639 us/op 2.4831 us/op 1.03
LinkedList of 24000 items push then shift 7.9420 ns/op 7.1990 ns/op 1.10
array of 24000 items push then pop 169.84 ns/op 141.14 ns/op 1.20
LinkedList of 24000 items push then pop 7.0830 ns/op 7.0670 ns/op 1.00
intersect bitArray bitLen 8 6.6570 ns/op 9.8180 ns/op 0.68
intersect array and set length 8 49.646 ns/op 45.301 ns/op 1.10
intersect bitArray bitLen 128 30.963 ns/op 32.617 ns/op 0.95
intersect array and set length 128 718.97 ns/op 767.35 ns/op 0.94
bitArray.getTrueBitIndexes() bitLen 128 1.9210 us/op 1.9520 us/op 0.98
bitArray.getTrueBitIndexes() bitLen 248 3.2840 us/op 3.5120 us/op 0.94
bitArray.getTrueBitIndexes() bitLen 512 7.4550 us/op 9.7140 us/op 0.77
Buffer.concat 32 items 988.00 ns/op 1.0670 us/op 0.93
Uint8Array.set 32 items 1.7520 us/op 1.8270 us/op 0.96
Buffer.copy 1.7990 us/op 1.7100 us/op 1.05
Uint8Array.set - with subarray 2.9400 us/op 2.8090 us/op 1.05
Uint8Array.set - without subarray 1.6240 us/op 1.3750 us/op 1.18
getUint32 - dataview 236.00 ns/op 277.00 ns/op 0.85
getUint32 - manual 161.00 ns/op 203.00 ns/op 0.79
Set add up to 64 items then delete first 2.2232 us/op 2.7639 us/op 0.80
OrderedSet add up to 64 items then delete first 3.3421 us/op 4.0149 us/op 0.83
Set add up to 64 items then delete last 2.6434 us/op 3.0501 us/op 0.87
OrderedSet add up to 64 items then delete last 4.0079 us/op 4.8644 us/op 0.82
Set add up to 64 items then delete middle 2.7514 us/op 3.8259 us/op 0.72
OrderedSet add up to 64 items then delete middle 5.5814 us/op 7.4127 us/op 0.75
Set add up to 128 items then delete first 5.7282 us/op 7.2724 us/op 0.79
OrderedSet add up to 128 items then delete first 9.2573 us/op 10.860 us/op 0.85
Set add up to 128 items then delete last 5.5612 us/op 6.2012 us/op 0.90
OrderedSet add up to 128 items then delete last 7.8367 us/op 10.818 us/op 0.72
Set add up to 128 items then delete middle 6.1138 us/op 8.0648 us/op 0.76
OrderedSet add up to 128 items then delete middle 17.113 us/op 18.096 us/op 0.95
Set add up to 256 items then delete first 13.060 us/op 13.567 us/op 0.96
OrderedSet add up to 256 items then delete first 20.914 us/op 20.642 us/op 1.01
Set add up to 256 items then delete last 10.985 us/op 11.637 us/op 0.94
OrderedSet add up to 256 items then delete last 18.066 us/op 19.221 us/op 0.94
Set add up to 256 items then delete middle 10.603 us/op 12.614 us/op 0.84
OrderedSet add up to 256 items then delete middle 43.415 us/op 50.380 us/op 0.86
transfer serialized Status (84 B) 1.3790 us/op 1.4990 us/op 0.92
copy serialized Status (84 B) 1.1820 us/op 1.4060 us/op 0.84
transfer serialized SignedVoluntaryExit (112 B) 1.4850 us/op 1.8010 us/op 0.82
copy serialized SignedVoluntaryExit (112 B) 1.2950 us/op 1.4670 us/op 0.88
transfer serialized ProposerSlashing (416 B) 1.6460 us/op 2.2540 us/op 0.73
copy serialized ProposerSlashing (416 B) 1.6430 us/op 1.9810 us/op 0.83
transfer serialized Attestation (485 B) 1.6950 us/op 2.7350 us/op 0.62
copy serialized Attestation (485 B) 1.6420 us/op 2.9920 us/op 0.55
transfer serialized AttesterSlashing (33232 B) 1.8870 us/op 3.3000 us/op 0.57
copy serialized AttesterSlashing (33232 B) 5.4620 us/op 12.267 us/op 0.45
transfer serialized Small SignedBeaconBlock (128000 B) 2.7210 us/op 4.4260 us/op 0.61
copy serialized Small SignedBeaconBlock (128000 B) 16.628 us/op 30.308 us/op 0.55
transfer serialized Avg SignedBeaconBlock (200000 B) 3.2540 us/op 4.1160 us/op 0.79
copy serialized Avg SignedBeaconBlock (200000 B) 24.855 us/op 38.166 us/op 0.65
transfer serialized BlobsSidecar (524380 B) 3.3570 us/op 3.9580 us/op 0.85
copy serialized BlobsSidecar (524380 B) 230.86 us/op 132.94 us/op 1.74
transfer serialized Big SignedBeaconBlock (1000000 B) 3.4560 us/op 3.8840 us/op 0.89
copy serialized Big SignedBeaconBlock (1000000 B) 155.89 us/op 277.03 us/op 0.56
pass gossip attestations to forkchoice per slot 3.4195 ms/op 3.4718 ms/op 0.98
forkChoice updateHead vc 100000 bc 64 eq 0 624.01 us/op 501.49 us/op 1.24
forkChoice updateHead vc 600000 bc 64 eq 0 3.1805 ms/op 3.4180 ms/op 0.93
forkChoice updateHead vc 1000000 bc 64 eq 0 5.7073 ms/op 5.7096 ms/op 1.00
forkChoice updateHead vc 600000 bc 320 eq 0 3.3649 ms/op 3.2031 ms/op 1.05
forkChoice updateHead vc 600000 bc 1200 eq 0 3.2957 ms/op 3.2316 ms/op 1.02
forkChoice updateHead vc 600000 bc 7200 eq 0 4.6069 ms/op 3.8087 ms/op 1.21
forkChoice updateHead vc 600000 bc 64 eq 1000 11.045 ms/op 10.881 ms/op 1.02
forkChoice updateHead vc 600000 bc 64 eq 10000 11.103 ms/op 10.899 ms/op 1.02
forkChoice updateHead vc 600000 bc 64 eq 300000 15.836 ms/op 16.617 ms/op 0.95
computeDeltas 500000 validators 300 proto nodes 4.6077 ms/op 3.8475 ms/op 1.20
computeDeltas 500000 validators 1200 proto nodes 4.6103 ms/op 4.3051 ms/op 1.07
computeDeltas 500000 validators 7200 proto nodes 4.4195 ms/op 4.3346 ms/op 1.02
computeDeltas 750000 validators 300 proto nodes 6.4611 ms/op 5.3784 ms/op 1.20
computeDeltas 750000 validators 1200 proto nodes 6.1803 ms/op 5.1419 ms/op 1.20
computeDeltas 750000 validators 7200 proto nodes 6.5774 ms/op 5.0829 ms/op 1.29
computeDeltas 1400000 validators 300 proto nodes 11.884 ms/op 9.8479 ms/op 1.21
computeDeltas 1400000 validators 1200 proto nodes 11.374 ms/op 9.4734 ms/op 1.20
computeDeltas 1400000 validators 7200 proto nodes 11.919 ms/op 9.8064 ms/op 1.22
computeDeltas 2100000 validators 300 proto nodes 17.108 ms/op 15.664 ms/op 1.09
computeDeltas 2100000 validators 1200 proto nodes 15.886 ms/op 15.715 ms/op 1.01
computeDeltas 2100000 validators 7200 proto nodes 16.931 ms/op 16.380 ms/op 1.03
altair processAttestation - 250000 vs - 7PWei normalcase 1.7663 ms/op 2.1560 ms/op 0.82
altair processAttestation - 250000 vs - 7PWei worstcase 2.5984 ms/op 3.0342 ms/op 0.86
altair processAttestation - setStatus - 1/6 committees join 89.734 us/op 105.28 us/op 0.85
altair processAttestation - setStatus - 1/3 committees join 196.22 us/op 204.94 us/op 0.96
altair processAttestation - setStatus - 1/2 committees join 280.14 us/op 273.37 us/op 1.02
altair processAttestation - setStatus - 2/3 committees join 356.56 us/op 350.41 us/op 1.02
altair processAttestation - setStatus - 4/5 committees join 500.24 us/op 510.23 us/op 0.98
altair processAttestation - setStatus - 100% committees join 603.66 us/op 623.04 us/op 0.97
altair processBlock - 250000 vs - 7PWei normalcase 8.3960 ms/op 4.7356 ms/op 1.77
altair processBlock - 250000 vs - 7PWei normalcase hashState 39.600 ms/op 25.252 ms/op 1.57
altair processBlock - 250000 vs - 7PWei worstcase 44.764 ms/op 42.758 ms/op 1.05
altair processBlock - 250000 vs - 7PWei worstcase hashState 89.217 ms/op 75.708 ms/op 1.18
phase0 processBlock - 250000 vs - 7PWei normalcase 2.5496 ms/op 2.1613 ms/op 1.18
phase0 processBlock - 250000 vs - 7PWei worstcase 27.704 ms/op 29.612 ms/op 0.94
altair processEth1Data - 250000 vs - 7PWei normalcase 311.44 us/op 427.18 us/op 0.73
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 5.4980 us/op 6.6730 us/op 0.82
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 25.437 us/op 33.012 us/op 0.77
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 8.8510 us/op 9.5980 us/op 0.92
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 6.1440 us/op 6.2720 us/op 0.98
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 104.73 us/op 117.82 us/op 0.89
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 668.12 us/op 747.56 us/op 0.89
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 924.29 us/op 917.62 us/op 1.01
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 900.68 us/op 944.30 us/op 0.95
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.5263 ms/op 2.6030 ms/op 0.97
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.6769 ms/op 1.6317 ms/op 1.03
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.9001 ms/op 3.9186 ms/op 1.00
Tree 40 250000 create 222.66 ms/op 222.55 ms/op 1.00
Tree 40 250000 get(125000) 150.96 ns/op 149.44 ns/op 1.01
Tree 40 250000 set(125000) 706.17 ns/op 636.50 ns/op 1.11
Tree 40 250000 toArray() 18.223 ms/op 19.160 ms/op 0.95
Tree 40 250000 iterate all - toArray() + loop 16.984 ms/op 18.434 ms/op 0.92
Tree 40 250000 iterate all - get(i) 51.612 ms/op 54.716 ms/op 0.94
MutableVector 250000 create 9.2438 ms/op 7.9821 ms/op 1.16
MutableVector 250000 get(125000) 7.1140 ns/op 6.2720 ns/op 1.13
MutableVector 250000 set(125000) 224.48 ns/op 194.93 ns/op 1.15
MutableVector 250000 toArray() 3.9370 ms/op 3.4138 ms/op 1.15
MutableVector 250000 iterate all - toArray() + loop 4.0926 ms/op 3.3611 ms/op 1.22
MutableVector 250000 iterate all - get(i) 1.7507 ms/op 1.5728 ms/op 1.11
Array 250000 create 3.0568 ms/op 2.9976 ms/op 1.02
Array 250000 clone - spread 1.5590 ms/op 1.4375 ms/op 1.08
Array 250000 get(125000) 0.41700 ns/op 0.42700 ns/op 0.98
Array 250000 set(125000) 0.44000 ns/op 0.44700 ns/op 0.98
Array 250000 iterate all - loop 83.366 us/op 92.220 us/op 0.90
effectiveBalanceIncrements clone Uint8Array 300000 31.403 us/op 26.729 us/op 1.17
effectiveBalanceIncrements clone MutableVector 300000 127.00 ns/op 131.00 ns/op 0.97
effectiveBalanceIncrements rw all Uint8Array 300000 202.32 us/op 200.41 us/op 1.01
effectiveBalanceIncrements rw all MutableVector 300000 71.051 ms/op 63.890 ms/op 1.11
phase0 afterProcessEpoch - 250000 vs - 7PWei 87.797 ms/op 86.740 ms/op 1.01
phase0 beforeProcessEpoch - 250000 vs - 7PWei 32.928 ms/op 41.110 ms/op 0.80
altair processEpoch - mainnet_e81889 380.98 ms/op 375.20 ms/op 1.02
mainnet_e81889 - altair beforeProcessEpoch 64.330 ms/op 66.430 ms/op 0.97
mainnet_e81889 - altair processJustificationAndFinalization 11.601 us/op 19.044 us/op 0.61
mainnet_e81889 - altair processInactivityUpdates 6.0211 ms/op 7.1404 ms/op 0.84
mainnet_e81889 - altair processRewardsAndPenalties 45.676 ms/op 38.237 ms/op 1.19
mainnet_e81889 - altair processRegistryUpdates 1.9670 us/op 2.6490 us/op 0.74
mainnet_e81889 - altair processSlashings 342.00 ns/op 354.00 ns/op 0.97
mainnet_e81889 - altair processEth1DataReset 283.00 ns/op 631.00 ns/op 0.45
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.0457 ms/op 1.1853 ms/op 0.88
mainnet_e81889 - altair processSlashingsReset 2.8430 us/op 3.4800 us/op 0.82
mainnet_e81889 - altair processRandaoMixesReset 3.4620 us/op 5.5550 us/op 0.62
mainnet_e81889 - altair processHistoricalRootsUpdate 587.00 ns/op 618.00 ns/op 0.95
mainnet_e81889 - altair processParticipationFlagUpdates 1.8290 us/op 1.8210 us/op 1.00
mainnet_e81889 - altair processSyncCommitteeUpdates 454.00 ns/op 411.00 ns/op 1.10
mainnet_e81889 - altair afterProcessEpoch 93.758 ms/op 93.571 ms/op 1.00
capella processEpoch - mainnet_e217614 1.3560 s/op 1.2878 s/op 1.05
mainnet_e217614 - capella beforeProcessEpoch 307.96 ms/op 275.82 ms/op 1.12
mainnet_e217614 - capella processJustificationAndFinalization 30.591 us/op 14.360 us/op 2.13
mainnet_e217614 - capella processInactivityUpdates 23.507 ms/op 18.515 ms/op 1.27
mainnet_e217614 - capella processRewardsAndPenalties 281.83 ms/op 242.18 ms/op 1.16
mainnet_e217614 - capella processRegistryUpdates 23.357 us/op 17.576 us/op 1.33
mainnet_e217614 - capella processSlashings 622.00 ns/op 513.00 ns/op 1.21
mainnet_e217614 - capella processEth1DataReset 544.00 ns/op 433.00 ns/op 1.26
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.0392 ms/op 16.891 ms/op 0.24
mainnet_e217614 - capella processSlashingsReset 6.8820 us/op 3.9440 us/op 1.74
mainnet_e217614 - capella processRandaoMixesReset 7.3600 us/op 4.3050 us/op 1.71
mainnet_e217614 - capella processHistoricalRootsUpdate 1.0720 us/op 1.2000 us/op 0.89
mainnet_e217614 - capella processParticipationFlagUpdates 2.9970 us/op 1.9940 us/op 1.50
mainnet_e217614 - capella afterProcessEpoch 303.12 ms/op 286.32 ms/op 1.06
phase0 processEpoch - mainnet_e58758 390.67 ms/op 409.84 ms/op 0.95
mainnet_e58758 - phase0 beforeProcessEpoch 110.15 ms/op 123.02 ms/op 0.90
mainnet_e58758 - phase0 processJustificationAndFinalization 24.078 us/op 15.710 us/op 1.53
mainnet_e58758 - phase0 processRewardsAndPenalties 32.914 ms/op 22.266 ms/op 1.48
mainnet_e58758 - phase0 processRegistryUpdates 8.4860 us/op 9.0780 us/op 0.93
mainnet_e58758 - phase0 processSlashings 400.00 ns/op 492.00 ns/op 0.81
mainnet_e58758 - phase0 processEth1DataReset 400.00 ns/op 427.00 ns/op 0.94
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 945.75 us/op 977.78 us/op 0.97
mainnet_e58758 - phase0 processSlashingsReset 6.0750 us/op 4.1170 us/op 1.48
mainnet_e58758 - phase0 processRandaoMixesReset 5.5200 us/op 6.6170 us/op 0.83
mainnet_e58758 - phase0 processHistoricalRootsUpdate 508.00 ns/op 492.00 ns/op 1.03
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.8250 us/op 2.8050 us/op 1.72
mainnet_e58758 - phase0 afterProcessEpoch 79.898 ms/op 80.045 ms/op 1.00
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2477 ms/op 1.2360 ms/op 1.01
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.3207 ms/op 2.3864 ms/op 0.97
altair processInactivityUpdates - 250000 normalcase 17.584 ms/op 20.073 ms/op 0.88
altair processInactivityUpdates - 250000 worstcase 19.336 ms/op 18.647 ms/op 1.04
phase0 processRegistryUpdates - 250000 normalcase 7.7000 us/op 6.5920 us/op 1.17
phase0 processRegistryUpdates - 250000 badcase_full_deposits 315.42 us/op 282.00 us/op 1.12
phase0 processRegistryUpdates - 250000 worstcase 0.5 119.92 ms/op 116.69 ms/op 1.03
altair processRewardsAndPenalties - 250000 normalcase 30.040 ms/op 43.376 ms/op 0.69
altair processRewardsAndPenalties - 250000 worstcase 42.671 ms/op 42.948 ms/op 0.99
phase0 getAttestationDeltas - 250000 normalcase 8.0206 ms/op 7.9645 ms/op 1.01
phase0 getAttestationDeltas - 250000 worstcase 7.7600 ms/op 8.8043 ms/op 0.88
phase0 processSlashings - 250000 worstcase 96.818 us/op 106.11 us/op 0.91
altair processSyncCommitteeUpdates - 250000 137.36 ms/op 136.89 ms/op 1.00
BeaconState.hashTreeRoot - No change 347.00 ns/op 425.00 ns/op 0.82
BeaconState.hashTreeRoot - 1 full validator 154.88 us/op 122.61 us/op 1.26
BeaconState.hashTreeRoot - 32 full validator 1.5739 ms/op 1.1437 ms/op 1.38
BeaconState.hashTreeRoot - 512 full validator 15.907 ms/op 12.707 ms/op 1.25
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 185.41 us/op 124.68 us/op 1.49
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.3992 ms/op 2.3156 ms/op 1.04
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 29.038 ms/op 31.595 ms/op 0.92
BeaconState.hashTreeRoot - 1 balances 112.75 us/op 122.28 us/op 0.92
BeaconState.hashTreeRoot - 32 balances 1.2509 ms/op 1.3544 ms/op 0.92
BeaconState.hashTreeRoot - 512 balances 8.4623 ms/op 14.037 ms/op 0.60
BeaconState.hashTreeRoot - 250000 balances 173.60 ms/op 189.25 ms/op 0.92
aggregationBits - 2048 els - zipIndexesInBitList 29.178 us/op 38.120 us/op 0.77
byteArrayEquals 32 56.079 ns/op 57.394 ns/op 0.98
Buffer.compare 32 18.980 ns/op 18.855 ns/op 1.01
byteArrayEquals 1024 1.6848 us/op 1.6299 us/op 1.03
Buffer.compare 1024 26.886 ns/op 27.372 ns/op 0.98
byteArrayEquals 16384 25.764 us/op 26.258 us/op 0.98
Buffer.compare 16384 194.18 ns/op 203.25 ns/op 0.96
byteArrayEquals 123687377 198.80 ms/op 194.16 ms/op 1.02
Buffer.compare 123687377 7.6012 ms/op 8.1771 ms/op 0.93
byteArrayEquals 32 - diff last byte 54.432 ns/op 52.391 ns/op 1.04
Buffer.compare 32 - diff last byte 18.167 ns/op 17.750 ns/op 1.02
byteArrayEquals 1024 - diff last byte 1.7020 us/op 1.5766 us/op 1.08
Buffer.compare 1024 - diff last byte 26.660 ns/op 26.493 ns/op 1.01
byteArrayEquals 16384 - diff last byte 26.601 us/op 25.081 us/op 1.06
Buffer.compare 16384 - diff last byte 202.40 ns/op 190.36 ns/op 1.06
byteArrayEquals 123687377 - diff last byte 196.92 ms/op 192.55 ms/op 1.02
Buffer.compare 123687377 - diff last byte 7.2843 ms/op 6.3036 ms/op 1.16
byteArrayEquals 32 - random bytes 5.2840 ns/op 5.1430 ns/op 1.03
Buffer.compare 32 - random bytes 17.859 ns/op 17.781 ns/op 1.00
byteArrayEquals 1024 - random bytes 5.3070 ns/op 5.1250 ns/op 1.04
Buffer.compare 1024 - random bytes 17.857 ns/op 17.675 ns/op 1.01
byteArrayEquals 16384 - random bytes 5.3180 ns/op 5.1190 ns/op 1.04
Buffer.compare 16384 - random bytes 18.058 ns/op 17.691 ns/op 1.02
byteArrayEquals 123687377 - random bytes 6.6300 ns/op 6.5300 ns/op 1.02
Buffer.compare 123687377 - random bytes 19.120 ns/op 19.120 ns/op 1.00
regular array get 100000 times 33.413 us/op 33.213 us/op 1.01
wrappedArray get 100000 times 33.600 us/op 32.709 us/op 1.03
arrayWithProxy get 100000 times 14.244 ms/op 13.189 ms/op 1.08
ssz.Root.equals 47.910 ns/op 45.640 ns/op 1.05
byteArrayEquals 47.066 ns/op 45.031 ns/op 1.05
Buffer.compare 10.910 ns/op 10.425 ns/op 1.05
shuffle list - 16384 els 6.6845 ms/op 6.2550 ms/op 1.07
shuffle list - 250000 els 95.000 ms/op 91.230 ms/op 1.04
processSlot - 1 slots 13.243 us/op 12.869 us/op 1.03
processSlot - 32 slots 2.7550 ms/op 2.8433 ms/op 0.97
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 37.140 ms/op 36.244 ms/op 1.02
getCommitteeAssignments - req 1 vs - 250000 vc 2.2150 ms/op 2.1460 ms/op 1.03
getCommitteeAssignments - req 100 vs - 250000 vc 4.2480 ms/op 4.2215 ms/op 1.01
getCommitteeAssignments - req 1000 vs - 250000 vc 4.5646 ms/op 4.5269 ms/op 1.01
findModifiedValidators - 10000 modified validators 231.78 ms/op 251.79 ms/op 0.92
findModifiedValidators - 1000 modified validators 180.17 ms/op 196.34 ms/op 0.92
findModifiedValidators - 100 modified validators 165.25 ms/op 171.40 ms/op 0.96
findModifiedValidators - 10 modified validators 186.13 ms/op 202.65 ms/op 0.92
findModifiedValidators - 1 modified validators 172.19 ms/op 179.11 ms/op 0.96
findModifiedValidators - no difference 162.36 ms/op 167.62 ms/op 0.97
compare ViewDUs 2.9668 s/op 3.0496 s/op 0.97
compare each validator Uint8Array 1.2959 s/op 996.62 ms/op 1.30
compare ViewDU to Uint8Array 1.0910 s/op 1.0236 s/op 1.07
migrate state 1000000 validators, 24 modified, 0 new 497.63 ms/op 579.08 ms/op 0.86
migrate state 1000000 validators, 1700 modified, 1000 new 745.48 ms/op 835.89 ms/op 0.89
migrate state 1000000 validators, 3400 modified, 2000 new 908.86 ms/op 995.84 ms/op 0.91
migrate state 1500000 validators, 24 modified, 0 new 512.33 ms/op 566.09 ms/op 0.91
migrate state 1500000 validators, 1700 modified, 1000 new 746.60 ms/op 771.57 ms/op 0.97
migrate state 1500000 validators, 3400 modified, 2000 new 945.88 ms/op 952.64 ms/op 0.99
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.5200 ns/op 4.7700 ns/op 1.16
state getBlockRootAtSlot - 250000 vs - 7PWei 455.51 ns/op 640.17 ns/op 0.71
computeProposers - vc 250000 6.7583 ms/op 8.2538 ms/op 0.82
computeEpochShuffling - vc 250000 93.941 ms/op 94.202 ms/op 1.00
getNextSyncCommittee - vc 250000 115.79 ms/op 137.29 ms/op 0.84
computeSigningRoot for AttestationData 16.513 us/op 22.041 us/op 0.75
hash AttestationData serialized data then Buffer.toString(base64) 1.5394 us/op 1.5252 us/op 1.01
toHexString serialized data 913.44 ns/op 891.44 ns/op 1.02
Buffer.toString(base64) 189.47 ns/op 198.65 ns/op 0.95

by benchmarkbot/action

Copy link

codecov bot commented Jul 15, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Project coverage is 62.51%. Comparing base (6ab2697) to head (bc04b83).
Report is 1 commits behind head on unstable.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #6950   +/-   ##
=========================================
  Coverage     62.51%   62.51%           
=========================================
  Files           575      575           
  Lines         61015    61020    +5     
  Branches       2120     2124    +4     
=========================================
+ Hits          38141    38147    +6     
+ Misses        22835    22834    -1     
  Partials         39       39           

@wemeetagain wemeetagain merged commit 9103f56 into unstable Jul 15, 2024
19 of 20 checks passed
@wemeetagain wemeetagain deleted the nflaig/browser-api-queries branch July 15, 2024 15:19
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.20.1 🎉

@wemeetagain
Copy link
Member

🎉 This PR is included in v1.21.0 🎉

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