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: expose metadata headers to scripts running in the browser #6952

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Jul 15, 2024

Motivation

When returning data from light client api to the browser in SSZ format we rely on the metadata headers to determine the fork version. Those are not exposed by default so we need explicitly list them in Access-Control-Expose-Headers header.

This currently causes issues in our browser tests and to users running light client in browser as we return SSZ by default, whereas in JSON responses the version was part of the payload (not header).

Description

Expose metadata headers to scripts running in the browser by setting a corresponding Access-Control-Expose-Headers header

Copy link

codecov bot commented Jul 15, 2024

Codecov Report

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

Project coverage is 62.52%. Comparing base (9103f56) to head (0dc5ff5).

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #6952   +/-   ##
=========================================
  Coverage     62.52%   62.52%           
=========================================
  Files           575      575           
  Lines         61055    61068   +13     
  Branches       2129     2129           
=========================================
+ Hits          38173    38185   +12     
- Misses        22843    22844    +1     
  Partials         39       39           

Copy link
Contributor

github-actions bot commented Jul 15, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 6b70e79 Previous: 9103f56 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 929.39 us/op 726.84 us/op 1.28
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 100.33 us/op 65.644 us/op 1.53
BLS verify - blst-native 1.5854 ms/op 1.1570 ms/op 1.37
BLS verifyMultipleSignatures 3 - blst-native 3.2631 ms/op 2.3534 ms/op 1.39
BLS verifyMultipleSignatures 8 - blst-native 6.3799 ms/op 5.2446 ms/op 1.22
BLS verifyMultipleSignatures 32 - blst-native 25.362 ms/op 19.196 ms/op 1.32
BLS verifyMultipleSignatures 64 - blst-native 53.405 ms/op 37.928 ms/op 1.41
BLS verifyMultipleSignatures 128 - blst-native 92.896 ms/op 76.258 ms/op 1.22
BLS deserializing 10000 signatures 1.0165 s/op 815.41 ms/op 1.25
BLS deserializing 100000 signatures 9.1836 s/op 8.6567 s/op 1.06
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.3112 ms/op 1.3691 ms/op 0.96
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.4914 ms/op 1.3959 ms/op 1.07
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.4001 ms/op 2.1752 ms/op 1.10
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.3606 ms/op 3.1444 ms/op 1.07
BLS verifyMultipleSignatures - same message - 128 - blst-native 5.6812 ms/op 6.0149 ms/op 0.94
BLS aggregatePubkeys 32 - blst-native 25.899 us/op 23.137 us/op 1.12
BLS aggregatePubkeys 128 - blst-native 99.946 us/op 91.061 us/op 1.10
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 71.545 ms/op 57.235 ms/op 1.25
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 85.154 ms/op 52.488 ms/op 1.62
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 53.500 ms/op 30.794 ms/op 1.74
getSlashingsAndExits - default max 140.13 us/op 94.818 us/op 1.48
getSlashingsAndExits - 2k 402.34 us/op 283.44 us/op 1.42
proposeBlockBody type=full, size=empty 7.2669 ms/op 4.6666 ms/op 1.56
isKnown best case - 1 super set check 529.00 ns/op 488.00 ns/op 1.08
isKnown normal case - 2 super set checks 500.00 ns/op 485.00 ns/op 1.03
isKnown worse case - 16 super set checks 431.00 ns/op 499.00 ns/op 0.86
InMemoryCheckpointStateCache - add get delete 6.6470 us/op 4.6470 us/op 1.43
validate api signedAggregateAndProof - struct 2.7734 ms/op 2.4201 ms/op 1.15
validate gossip signedAggregateAndProof - struct 2.7614 ms/op 2.4172 ms/op 1.14
validate gossip attestation - vc 640000 1.3723 ms/op 1.1617 ms/op 1.18
batch validate gossip attestation - vc 640000 - chunk 32 172.95 us/op 135.24 us/op 1.28
batch validate gossip attestation - vc 640000 - chunk 64 156.95 us/op 127.25 us/op 1.23
batch validate gossip attestation - vc 640000 - chunk 128 152.06 us/op 117.19 us/op 1.30
batch validate gossip attestation - vc 640000 - chunk 256 141.19 us/op 115.15 us/op 1.23
pickEth1Vote - no votes 1.3737 ms/op 914.13 us/op 1.50
pickEth1Vote - max votes 13.911 ms/op 7.0579 ms/op 1.97
pickEth1Vote - Eth1Data hashTreeRoot value x2048 16.696 ms/op 12.904 ms/op 1.29
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 29.031 ms/op 31.670 ms/op 0.92
pickEth1Vote - Eth1Data fastSerialize value x2048 730.14 us/op 515.57 us/op 1.42
pickEth1Vote - Eth1Data fastSerialize tree x2048 5.6817 ms/op 10.408 ms/op 0.55
bytes32 toHexString 775.00 ns/op 1.0980 us/op 0.71
bytes32 Buffer.toString(hex) 319.00 ns/op 606.00 ns/op 0.53
bytes32 Buffer.toString(hex) from Uint8Array 525.00 ns/op 775.00 ns/op 0.68
bytes32 Buffer.toString(hex) + 0x 324.00 ns/op 519.00 ns/op 0.62
Object access 1 prop 0.22300 ns/op 0.44400 ns/op 0.50
Map access 1 prop 0.14900 ns/op 0.36600 ns/op 0.41
Object get x1000 6.8610 ns/op 7.5800 ns/op 0.91
Map get x1000 7.2010 ns/op 6.6840 ns/op 1.08
Object set x1000 62.944 ns/op 48.936 ns/op 1.29
Map set x1000 33.347 ns/op 32.555 ns/op 1.02
Return object 10000 times 0.34490 ns/op 0.31720 ns/op 1.09
Throw Error 10000 times 4.3976 us/op 2.9032 us/op 1.51
fastMsgIdFn sha256 / 200 bytes 2.6670 us/op 2.4090 us/op 1.11
fastMsgIdFn h32 xxhash / 200 bytes 338.00 ns/op 530.00 ns/op 0.64
fastMsgIdFn h64 xxhash / 200 bytes 318.00 ns/op 525.00 ns/op 0.61
fastMsgIdFn sha256 / 1000 bytes 8.3310 us/op 6.6380 us/op 1.26
fastMsgIdFn h32 xxhash / 1000 bytes 498.00 ns/op 731.00 ns/op 0.68
fastMsgIdFn h64 xxhash / 1000 bytes 414.00 ns/op 673.00 ns/op 0.62
fastMsgIdFn sha256 / 10000 bytes 71.135 us/op 55.957 us/op 1.27
fastMsgIdFn h32 xxhash / 10000 bytes 2.0440 us/op 3.5580 us/op 0.57
fastMsgIdFn h64 xxhash / 10000 bytes 1.3260 us/op 1.6310 us/op 0.81
send data - 1000 256B messages 16.679 ms/op 23.384 ms/op 0.71
send data - 1000 512B messages 25.810 ms/op 21.323 ms/op 1.21
send data - 1000 1024B messages 38.496 ms/op 27.336 ms/op 1.41
send data - 1000 1200B messages 31.275 ms/op 34.398 ms/op 0.91
send data - 1000 2048B messages 38.921 ms/op 50.547 ms/op 0.77
send data - 1000 4096B messages 42.363 ms/op 36.683 ms/op 1.15
send data - 1000 16384B messages 90.816 ms/op 76.973 ms/op 1.18
send data - 1000 65536B messages 234.93 ms/op 273.69 ms/op 0.86
enrSubnets - fastDeserialize 64 bits 1.6810 us/op 1.4430 us/op 1.16
enrSubnets - ssz BitVector 64 bits 518.00 ns/op 655.00 ns/op 0.79
enrSubnets - fastDeserialize 4 bits 230.00 ns/op 412.00 ns/op 0.56
enrSubnets - ssz BitVector 4 bits 463.00 ns/op 646.00 ns/op 0.72
prioritizePeers score -10:0 att 32-0.1 sync 2-0 226.82 us/op 204.30 us/op 1.11
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 187.03 us/op 130.42 us/op 1.43
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 359.30 us/op 367.58 us/op 0.98
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 555.71 us/op 400.70 us/op 1.39
prioritizePeers score 0:0 att 64-1 sync 4-1 745.34 us/op 637.28 us/op 1.17
array of 16000 items push then shift 1.7077 us/op 1.3732 us/op 1.24
LinkedList of 16000 items push then shift 7.6530 ns/op 7.6920 ns/op 0.99
array of 16000 items push then pop 140.89 ns/op 112.66 ns/op 1.25
LinkedList of 16000 items push then pop 8.1770 ns/op 6.4880 ns/op 1.26
array of 24000 items push then shift 2.6429 us/op 1.9833 us/op 1.33
LinkedList of 24000 items push then shift 8.2120 ns/op 6.7180 ns/op 1.22
array of 24000 items push then pop 205.75 ns/op 120.48 ns/op 1.71
LinkedList of 24000 items push then pop 8.3860 ns/op 6.4930 ns/op 1.29
intersect bitArray bitLen 8 6.8690 ns/op 5.8370 ns/op 1.18
intersect array and set length 8 60.936 ns/op 40.817 ns/op 1.49
intersect bitArray bitLen 128 30.924 ns/op 27.721 ns/op 1.12
intersect array and set length 128 858.35 ns/op 606.56 ns/op 1.42
bitArray.getTrueBitIndexes() bitLen 128 2.2380 us/op 2.1490 us/op 1.04
bitArray.getTrueBitIndexes() bitLen 248 4.2180 us/op 4.0600 us/op 1.04
bitArray.getTrueBitIndexes() bitLen 512 9.3440 us/op 7.1380 us/op 1.31
Buffer.concat 32 items 1.0910 us/op 1.1020 us/op 0.99
Uint8Array.set 32 items 1.8960 us/op 1.5500 us/op 1.22
Buffer.copy 1.9140 us/op 2.0620 us/op 0.93
Uint8Array.set - with subarray 2.9420 us/op 3.3090 us/op 0.89
Uint8Array.set - without subarray 1.9550 us/op 2.1050 us/op 0.93
getUint32 - dataview 295.00 ns/op 520.00 ns/op 0.57
getUint32 - manual 203.00 ns/op 453.00 ns/op 0.45
Set add up to 64 items then delete first 2.9026 us/op 1.8766 us/op 1.55
OrderedSet add up to 64 items then delete first 4.7020 us/op 2.9299 us/op 1.60
Set add up to 64 items then delete last 3.2389 us/op 2.3350 us/op 1.39
OrderedSet add up to 64 items then delete last 4.1891 us/op 3.7768 us/op 1.11
Set add up to 64 items then delete middle 3.3446 us/op 2.4534 us/op 1.36
OrderedSet add up to 64 items then delete middle 6.6477 us/op 4.8650 us/op 1.37
Set add up to 128 items then delete first 6.6164 us/op 4.0541 us/op 1.63
OrderedSet add up to 128 items then delete first 9.7234 us/op 6.1424 us/op 1.58
Set add up to 128 items then delete last 6.2630 us/op 4.0747 us/op 1.54
OrderedSet add up to 128 items then delete last 8.6763 us/op 6.4014 us/op 1.36
Set add up to 128 items then delete middle 6.3160 us/op 5.0730 us/op 1.25
OrderedSet add up to 128 items then delete middle 16.128 us/op 14.455 us/op 1.12
Set add up to 256 items then delete first 12.066 us/op 11.129 us/op 1.08
OrderedSet add up to 256 items then delete first 20.725 us/op 22.951 us/op 0.90
Set add up to 256 items then delete last 10.560 us/op 14.706 us/op 0.72
OrderedSet add up to 256 items then delete last 15.149 us/op 20.775 us/op 0.73
Set add up to 256 items then delete middle 10.268 us/op 15.965 us/op 0.64
OrderedSet add up to 256 items then delete middle 43.595 us/op 49.056 us/op 0.89
transfer serialized Status (84 B) 1.4350 us/op 2.9880 us/op 0.48
copy serialized Status (84 B) 1.2130 us/op 2.3780 us/op 0.51
transfer serialized SignedVoluntaryExit (112 B) 1.4810 us/op 2.8360 us/op 0.52
copy serialized SignedVoluntaryExit (112 B) 1.2300 us/op 2.4360 us/op 0.50
transfer serialized ProposerSlashing (416 B) 2.1210 us/op 3.0110 us/op 0.70
copy serialized ProposerSlashing (416 B) 1.8840 us/op 2.5040 us/op 0.75
transfer serialized Attestation (485 B) 2.7150 us/op 2.2820 us/op 1.19
copy serialized Attestation (485 B) 1.8180 us/op 2.3080 us/op 0.79
transfer serialized AttesterSlashing (33232 B) 2.4110 us/op 2.7740 us/op 0.87
copy serialized AttesterSlashing (33232 B) 5.6780 us/op 9.2630 us/op 0.61
transfer serialized Small SignedBeaconBlock (128000 B) 3.2550 us/op 2.9050 us/op 1.12
copy serialized Small SignedBeaconBlock (128000 B) 14.999 us/op 24.375 us/op 0.62
transfer serialized Avg SignedBeaconBlock (200000 B) 3.4880 us/op 2.6740 us/op 1.30
copy serialized Avg SignedBeaconBlock (200000 B) 22.088 us/op 39.721 us/op 0.56
transfer serialized BlobsSidecar (524380 B) 3.0170 us/op 4.6250 us/op 0.65
copy serialized BlobsSidecar (524380 B) 91.960 us/op 171.44 us/op 0.54
transfer serialized Big SignedBeaconBlock (1000000 B) 3.0410 us/op 4.8660 us/op 0.62
copy serialized Big SignedBeaconBlock (1000000 B) 148.67 us/op 179.01 us/op 0.83
pass gossip attestations to forkchoice per slot 4.0213 ms/op 3.6315 ms/op 1.11
forkChoice updateHead vc 100000 bc 64 eq 0 613.82 us/op 562.07 us/op 1.09
forkChoice updateHead vc 600000 bc 64 eq 0 3.8901 ms/op 2.7472 ms/op 1.42
forkChoice updateHead vc 1000000 bc 64 eq 0 6.0885 ms/op 4.5715 ms/op 1.33
forkChoice updateHead vc 600000 bc 320 eq 0 3.7188 ms/op 2.6593 ms/op 1.40
forkChoice updateHead vc 600000 bc 1200 eq 0 3.6699 ms/op 3.0365 ms/op 1.21
forkChoice updateHead vc 600000 bc 7200 eq 0 4.2522 ms/op 3.1463 ms/op 1.35
forkChoice updateHead vc 600000 bc 64 eq 1000 11.790 ms/op 10.060 ms/op 1.17
forkChoice updateHead vc 600000 bc 64 eq 10000 11.854 ms/op 9.9470 ms/op 1.19
forkChoice updateHead vc 600000 bc 64 eq 300000 20.497 ms/op 12.600 ms/op 1.63
computeDeltas 500000 validators 300 proto nodes 4.2807 ms/op 3.1917 ms/op 1.34
computeDeltas 500000 validators 1200 proto nodes 4.4709 ms/op 3.1464 ms/op 1.42
computeDeltas 500000 validators 7200 proto nodes 4.0628 ms/op 3.0307 ms/op 1.34
computeDeltas 750000 validators 300 proto nodes 6.9799 ms/op 4.5297 ms/op 1.54
computeDeltas 750000 validators 1200 proto nodes 5.6201 ms/op 4.5650 ms/op 1.23
computeDeltas 750000 validators 7200 proto nodes 5.6268 ms/op 4.6650 ms/op 1.21
computeDeltas 1400000 validators 300 proto nodes 10.817 ms/op 9.0280 ms/op 1.20
computeDeltas 1400000 validators 1200 proto nodes 13.123 ms/op 8.7418 ms/op 1.50
computeDeltas 1400000 validators 7200 proto nodes 10.606 ms/op 9.0916 ms/op 1.17
computeDeltas 2100000 validators 300 proto nodes 16.428 ms/op 12.914 ms/op 1.27
computeDeltas 2100000 validators 1200 proto nodes 15.741 ms/op 13.358 ms/op 1.18
computeDeltas 2100000 validators 7200 proto nodes 16.094 ms/op 13.112 ms/op 1.23
altair processAttestation - 250000 vs - 7PWei normalcase 1.6512 ms/op 2.4588 ms/op 0.67
altair processAttestation - 250000 vs - 7PWei worstcase 2.6769 ms/op 2.2802 ms/op 1.17
altair processAttestation - setStatus - 1/6 committees join 99.029 us/op 106.29 us/op 0.93
altair processAttestation - setStatus - 1/3 committees join 183.05 us/op 170.45 us/op 1.07
altair processAttestation - setStatus - 1/2 committees join 257.12 us/op 214.84 us/op 1.20
altair processAttestation - setStatus - 2/3 committees join 330.53 us/op 334.41 us/op 0.99
altair processAttestation - setStatus - 4/5 committees join 457.95 us/op 456.07 us/op 1.00
altair processAttestation - setStatus - 100% committees join 546.02 us/op 521.34 us/op 1.05
altair processBlock - 250000 vs - 7PWei normalcase 6.2049 ms/op 5.0599 ms/op 1.23
altair processBlock - 250000 vs - 7PWei normalcase hashState 27.663 ms/op 25.336 ms/op 1.09
altair processBlock - 250000 vs - 7PWei worstcase 51.185 ms/op 42.618 ms/op 1.20
altair processBlock - 250000 vs - 7PWei worstcase hashState 87.263 ms/op 76.367 ms/op 1.14
phase0 processBlock - 250000 vs - 7PWei normalcase 2.5888 ms/op 1.6163 ms/op 1.60
phase0 processBlock - 250000 vs - 7PWei worstcase 29.841 ms/op 26.984 ms/op 1.11
altair processEth1Data - 250000 vs - 7PWei normalcase 397.37 us/op 481.58 us/op 0.83
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 8.4190 us/op 5.9580 us/op 1.41
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 28.565 us/op 18.884 us/op 1.51
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 9.1410 us/op 8.7360 us/op 1.05
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 6.5940 us/op 5.6360 us/op 1.17
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 115.83 us/op 96.927 us/op 1.20
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 853.71 us/op 690.58 us/op 1.24
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.1787 ms/op 780.25 us/op 1.51
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.3857 ms/op 766.14 us/op 1.81
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.6236 ms/op 2.5502 ms/op 1.03
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.6413 ms/op 1.3261 ms/op 1.24
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.9756 ms/op 3.2601 ms/op 1.22
Tree 40 250000 create 237.19 ms/op 199.95 ms/op 1.19
Tree 40 250000 get(125000) 150.76 ns/op 122.29 ns/op 1.23
Tree 40 250000 set(125000) 686.26 ns/op 536.62 ns/op 1.28
Tree 40 250000 toArray() 18.700 ms/op 13.337 ms/op 1.40
Tree 40 250000 iterate all - toArray() + loop 21.933 ms/op 15.853 ms/op 1.38
Tree 40 250000 iterate all - get(i) 59.664 ms/op 51.663 ms/op 1.15
MutableVector 250000 create 10.425 ms/op 8.3584 ms/op 1.25
MutableVector 250000 get(125000) 6.3050 ns/op 5.9560 ns/op 1.06
MutableVector 250000 set(125000) 264.48 ns/op 181.40 ns/op 1.46
MutableVector 250000 toArray() 4.8368 ms/op 3.6846 ms/op 1.31
MutableVector 250000 iterate all - toArray() + loop 5.0122 ms/op 4.0628 ms/op 1.23
MutableVector 250000 iterate all - get(i) 1.8065 ms/op 1.5580 ms/op 1.16
Array 250000 create 4.1998 ms/op 2.5611 ms/op 1.64
Array 250000 clone - spread 1.7411 ms/op 1.5616 ms/op 1.11
Array 250000 get(125000) 0.44800 ns/op 0.61000 ns/op 0.73
Array 250000 set(125000) 0.47200 ns/op 0.61800 ns/op 0.76
Array 250000 iterate all - loop 115.15 us/op 80.042 us/op 1.44
effectiveBalanceIncrements clone Uint8Array 300000 120.03 us/op 17.457 us/op 6.88
effectiveBalanceIncrements clone MutableVector 300000 136.00 ns/op 327.00 ns/op 0.42
effectiveBalanceIncrements rw all Uint8Array 300000 217.56 us/op 170.35 us/op 1.28
effectiveBalanceIncrements rw all MutableVector 300000 71.245 ms/op 66.335 ms/op 1.07
phase0 afterProcessEpoch - 250000 vs - 7PWei 90.600 ms/op 84.812 ms/op 1.07
phase0 beforeProcessEpoch - 250000 vs - 7PWei 47.604 ms/op 49.614 ms/op 0.96
altair processEpoch - mainnet_e81889 442.48 ms/op 340.99 ms/op 1.30
mainnet_e81889 - altair beforeProcessEpoch 63.805 ms/op 68.213 ms/op 0.94
mainnet_e81889 - altair processJustificationAndFinalization 20.009 us/op 15.596 us/op 1.28
mainnet_e81889 - altair processInactivityUpdates 7.3863 ms/op 6.8583 ms/op 1.08
mainnet_e81889 - altair processRewardsAndPenalties 47.987 ms/op 45.653 ms/op 1.05
mainnet_e81889 - altair processRegistryUpdates 2.5210 us/op 3.5720 us/op 0.71
mainnet_e81889 - altair processSlashings 452.00 ns/op 1.2510 us/op 0.36
mainnet_e81889 - altair processEth1DataReset 418.00 ns/op 903.00 ns/op 0.46
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.6045 ms/op 960.18 us/op 1.67
mainnet_e81889 - altair processSlashingsReset 3.6010 us/op 4.9820 us/op 0.72
mainnet_e81889 - altair processRandaoMixesReset 4.6200 us/op 10.451 us/op 0.44
mainnet_e81889 - altair processHistoricalRootsUpdate 904.00 ns/op 1.1480 us/op 0.79
mainnet_e81889 - altair processParticipationFlagUpdates 2.7260 us/op 4.0300 us/op 0.68
mainnet_e81889 - altair processSyncCommitteeUpdates 548.00 ns/op 1.0200 us/op 0.54
mainnet_e81889 - altair afterProcessEpoch 93.497 ms/op 82.384 ms/op 1.13
capella processEpoch - mainnet_e217614 1.4153 s/op 1.3545 s/op 1.04
mainnet_e217614 - capella beforeProcessEpoch 291.55 ms/op 363.18 ms/op 0.80
mainnet_e217614 - capella processJustificationAndFinalization 14.391 us/op 41.420 us/op 0.35
mainnet_e217614 - capella processInactivityUpdates 19.443 ms/op 45.036 ms/op 0.43
mainnet_e217614 - capella processRewardsAndPenalties 255.00 ms/op 315.74 ms/op 0.81
mainnet_e217614 - capella processRegistryUpdates 15.908 us/op 17.136 us/op 0.93
mainnet_e217614 - capella processSlashings 854.00 ns/op 1.2470 us/op 0.68
mainnet_e217614 - capella processEth1DataReset 530.00 ns/op 964.00 ns/op 0.55
mainnet_e217614 - capella processEffectiveBalanceUpdates 16.192 ms/op 19.217 ms/op 0.84
mainnet_e217614 - capella processSlashingsReset 8.1830 us/op 5.2640 us/op 1.55
mainnet_e217614 - capella processRandaoMixesReset 7.0470 us/op 7.4210 us/op 0.95
mainnet_e217614 - capella processHistoricalRootsUpdate 945.00 ns/op 1.1880 us/op 0.80
mainnet_e217614 - capella processParticipationFlagUpdates 2.0760 us/op 3.0290 us/op 0.69
mainnet_e217614 - capella afterProcessEpoch 284.47 ms/op 271.44 ms/op 1.05
phase0 processEpoch - mainnet_e58758 394.04 ms/op 342.15 ms/op 1.15
mainnet_e58758 - phase0 beforeProcessEpoch 120.76 ms/op 97.122 ms/op 1.24
mainnet_e58758 - phase0 processJustificationAndFinalization 19.335 us/op 12.029 us/op 1.61
mainnet_e58758 - phase0 processRewardsAndPenalties 41.479 ms/op 33.558 ms/op 1.24
mainnet_e58758 - phase0 processRegistryUpdates 8.7110 us/op 9.0740 us/op 0.96
mainnet_e58758 - phase0 processSlashings 373.00 ns/op 835.00 ns/op 0.45
mainnet_e58758 - phase0 processEth1DataReset 387.00 ns/op 741.00 ns/op 0.52
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.3560 ms/op 740.53 us/op 1.83
mainnet_e58758 - phase0 processSlashingsReset 3.4170 us/op 5.1420 us/op 0.66
mainnet_e58758 - phase0 processRandaoMixesReset 5.0350 us/op 6.6120 us/op 0.76
mainnet_e58758 - phase0 processHistoricalRootsUpdate 474.00 ns/op 1.1000 us/op 0.43
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.0050 us/op 5.8290 us/op 0.69
mainnet_e58758 - phase0 afterProcessEpoch 81.428 ms/op 71.464 ms/op 1.14
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.6582 ms/op 850.66 us/op 1.95
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.8457 ms/op 1.4921 ms/op 1.91
altair processInactivityUpdates - 250000 normalcase 22.899 ms/op 21.759 ms/op 1.05
altair processInactivityUpdates - 250000 worstcase 20.230 ms/op 18.399 ms/op 1.10
phase0 processRegistryUpdates - 250000 normalcase 9.1290 us/op 11.465 us/op 0.80
phase0 processRegistryUpdates - 250000 badcase_full_deposits 352.07 us/op 322.95 us/op 1.09
phase0 processRegistryUpdates - 250000 worstcase 0.5 135.67 ms/op 122.45 ms/op 1.11
altair processRewardsAndPenalties - 250000 normalcase 45.902 ms/op 45.780 ms/op 1.00
altair processRewardsAndPenalties - 250000 worstcase 46.627 ms/op 44.627 ms/op 1.04
phase0 getAttestationDeltas - 250000 normalcase 7.9018 ms/op 6.4608 ms/op 1.22
phase0 getAttestationDeltas - 250000 worstcase 10.834 ms/op 6.0966 ms/op 1.78
phase0 processSlashings - 250000 worstcase 125.72 us/op 85.778 us/op 1.47
altair processSyncCommitteeUpdates - 250000 135.81 ms/op 119.19 ms/op 1.14
BeaconState.hashTreeRoot - No change 354.00 ns/op 559.00 ns/op 0.63
BeaconState.hashTreeRoot - 1 full validator 146.33 us/op 137.49 us/op 1.06
BeaconState.hashTreeRoot - 32 full validator 1.7331 ms/op 1.2128 ms/op 1.43
BeaconState.hashTreeRoot - 512 full validator 13.050 ms/op 11.256 ms/op 1.16
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 146.84 us/op 119.04 us/op 1.23
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.1447 ms/op 1.7922 ms/op 1.20
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 30.399 ms/op 19.149 ms/op 1.59
BeaconState.hashTreeRoot - 1 balances 126.64 us/op 121.76 us/op 1.04
BeaconState.hashTreeRoot - 32 balances 1.0702 ms/op 1.0548 ms/op 1.01
BeaconState.hashTreeRoot - 512 balances 10.702 ms/op 7.3786 ms/op 1.45
BeaconState.hashTreeRoot - 250000 balances 168.29 ms/op 170.21 ms/op 0.99
aggregationBits - 2048 els - zipIndexesInBitList 24.470 us/op 22.400 us/op 1.09
byteArrayEquals 32 53.980 ns/op 50.490 ns/op 1.07
Buffer.compare 32 17.400 ns/op 15.987 ns/op 1.09
byteArrayEquals 1024 1.5982 us/op 1.3084 us/op 1.22
Buffer.compare 1024 24.755 ns/op 24.670 ns/op 1.00
byteArrayEquals 16384 25.602 us/op 20.754 us/op 1.23
Buffer.compare 16384 209.18 ns/op 210.47 ns/op 0.99
byteArrayEquals 123687377 195.03 ms/op 153.85 ms/op 1.27
Buffer.compare 123687377 7.1033 ms/op 6.2665 ms/op 1.13
byteArrayEquals 32 - diff last byte 53.046 ns/op 48.515 ns/op 1.09
Buffer.compare 32 - diff last byte 17.249 ns/op 16.095 ns/op 1.07
byteArrayEquals 1024 - diff last byte 1.5911 us/op 1.2802 us/op 1.24
Buffer.compare 1024 - diff last byte 26.296 ns/op 24.450 ns/op 1.08
byteArrayEquals 16384 - diff last byte 25.334 us/op 20.354 us/op 1.24
Buffer.compare 16384 - diff last byte 187.37 ns/op 202.43 ns/op 0.93
byteArrayEquals 123687377 - diff last byte 198.41 ms/op 153.93 ms/op 1.29
Buffer.compare 123687377 - diff last byte 7.6527 ms/op 5.0095 ms/op 1.53
byteArrayEquals 32 - random bytes 5.2920 ns/op 5.0010 ns/op 1.06
Buffer.compare 32 - random bytes 17.875 ns/op 16.024 ns/op 1.12
byteArrayEquals 1024 - random bytes 5.5950 ns/op 4.9790 ns/op 1.12
Buffer.compare 1024 - random bytes 17.478 ns/op 15.932 ns/op 1.10
byteArrayEquals 16384 - random bytes 5.2340 ns/op 5.0770 ns/op 1.03
Buffer.compare 16384 - random bytes 17.431 ns/op 15.798 ns/op 1.10
byteArrayEquals 123687377 - random bytes 6.5300 ns/op 8.2300 ns/op 0.79
Buffer.compare 123687377 - random bytes 18.570 ns/op 19.410 ns/op 0.96
regular array get 100000 times 44.913 us/op 31.376 us/op 1.43
wrappedArray get 100000 times 33.547 us/op 31.546 us/op 1.06
arrayWithProxy get 100000 times 13.881 ms/op 11.574 ms/op 1.20
ssz.Root.equals 48.845 ns/op 46.485 ns/op 1.05
byteArrayEquals 46.850 ns/op 44.970 ns/op 1.04
Buffer.compare 10.879 ns/op 9.4240 ns/op 1.15
shuffle list - 16384 els 6.6115 ms/op 5.9284 ms/op 1.12
shuffle list - 250000 els 96.043 ms/op 86.157 ms/op 1.11
processSlot - 1 slots 15.294 us/op 10.210 us/op 1.50
processSlot - 32 slots 2.6011 ms/op 2.5771 ms/op 1.01
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 38.092 ms/op 37.446 ms/op 1.02
getCommitteeAssignments - req 1 vs - 250000 vc 2.2505 ms/op 1.7987 ms/op 1.25
getCommitteeAssignments - req 100 vs - 250000 vc 4.2095 ms/op 3.5306 ms/op 1.19
getCommitteeAssignments - req 1000 vs - 250000 vc 4.7760 ms/op 3.8154 ms/op 1.25
findModifiedValidators - 10000 modified validators 298.98 ms/op 260.89 ms/op 1.15
findModifiedValidators - 1000 modified validators 197.16 ms/op 183.65 ms/op 1.07
findModifiedValidators - 100 modified validators 193.46 ms/op 198.36 ms/op 0.98
findModifiedValidators - 10 modified validators 180.54 ms/op 157.97 ms/op 1.14
findModifiedValidators - 1 modified validators 170.14 ms/op 160.46 ms/op 1.06
findModifiedValidators - no difference 162.51 ms/op 164.46 ms/op 0.99
compare ViewDUs 3.2160 s/op 3.5775 s/op 0.90
compare each validator Uint8Array 1.5916 s/op 1.5300 s/op 1.04
compare ViewDU to Uint8Array 1.1324 s/op 780.10 ms/op 1.45
migrate state 1000000 validators, 24 modified, 0 new 667.07 ms/op 538.03 ms/op 1.24
migrate state 1000000 validators, 1700 modified, 1000 new 836.80 ms/op 860.71 ms/op 0.97
migrate state 1000000 validators, 3400 modified, 2000 new 1.0371 s/op 1.0212 s/op 1.02
migrate state 1500000 validators, 24 modified, 0 new 600.19 ms/op 579.47 ms/op 1.04
migrate state 1500000 validators, 1700 modified, 1000 new 842.06 ms/op 826.17 ms/op 1.02
migrate state 1500000 validators, 3400 modified, 2000 new 1.1192 s/op 1.1811 s/op 0.95
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.2100 ns/op 7.2400 ns/op 0.58
state getBlockRootAtSlot - 250000 vs - 7PWei 719.70 ns/op 663.82 ns/op 1.08
computeProposers - vc 250000 6.8758 ms/op 6.3308 ms/op 1.09
computeEpochShuffling - vc 250000 91.987 ms/op 89.022 ms/op 1.03
getNextSyncCommittee - vc 250000 123.53 ms/op 114.58 ms/op 1.08
computeSigningRoot for AttestationData 22.831 us/op 17.265 us/op 1.32
hash AttestationData serialized data then Buffer.toString(base64) 1.4812 us/op 1.3353 us/op 1.11
toHexString serialized data 867.17 ns/op 824.84 ns/op 1.05
Buffer.toString(base64) 168.97 ns/op 160.09 ns/op 1.06

by benchmarkbot/action

@philknows philknows added this to the v1.21.0 milestone Jul 15, 2024
@nflaig nflaig marked this pull request as ready for review July 15, 2024 19:59
@nflaig nflaig requested a review from a team as a code owner July 15, 2024 19:59
@wemeetagain wemeetagain merged commit f66aae4 into unstable Jul 15, 2024
21 checks passed
@wemeetagain wemeetagain deleted the nflaig/expose-headers branch July 15, 2024 20:01
@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.

3 participants