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: set consensus version header in state and block response #6152

Merged
merged 1 commit into from
Dec 2, 2023

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Dec 2, 2023

Motivation

Beacon-API spec requires to set Eth-Consensus-Version in getStateV2 and getBlockV2 response.

image

Description

Set consensus version header in state and block response in both json and ssz response as per spec both require the header.

Confirmed results manually as current API client design does not allow to access header values in tests.

 curl -s -o /dev/null -D - http://beacon:9596/eth/v2/debug/beacon/states/head -H "Accept: application/octet-stream"
HTTP/1.1 200 OK
...
eth-consensus-version: capella
content-type: application/octet-stream
...

Note: This is not a long-term solution, all the code here will be removed in API refactoring done in #6080

Closes #6123
Closes #6124

@nflaig nflaig requested a review from a team as a code owner December 2, 2023 10:24
const response = await api.getBlockV2(...reqSerializers.getBlockV2.parseReq(req));
if (response instanceof Uint8Array) {
const slot = extractSlotFromBlockBytes(response);
const version = config.getForkName(slot);
void res.header("Eth-Consensus-Version", version);
Copy link
Member Author

@nflaig nflaig Dec 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The void is required here because eslint warns about floating promises due to header return value being thenable but it does not return a promise. Using await here will keep the process stuck when calling the API. This is a known issue, see fastify/fastify#4246 and fastify/help#775.

Copy link
Contributor

github-actions bot commented Dec 2, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 781e765 Previous: 6208e2d Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 690.82 us/op 497.94 us/op 1.39
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 78.932 us/op 82.949 us/op 0.95
BLS verify - blst-native 1.2513 ms/op 1.3092 ms/op 0.96
BLS verifyMultipleSignatures 3 - blst-native 2.6186 ms/op 2.7527 ms/op 0.95
BLS verifyMultipleSignatures 8 - blst-native 5.7400 ms/op 6.0332 ms/op 0.95
BLS verifyMultipleSignatures 32 - blst-native 20.985 ms/op 22.065 ms/op 0.95
BLS verifyMultipleSignatures 64 - blst-native 41.331 ms/op 43.645 ms/op 0.95
BLS verifyMultipleSignatures 128 - blst-native 82.110 ms/op 86.575 ms/op 0.95
BLS deserializing 10000 signatures 887.50 ms/op 921.44 ms/op 0.96
BLS deserializing 100000 signatures 8.8153 s/op 9.3025 s/op 0.95
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.3444 ms/op 1.3678 ms/op 0.98
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.4051 ms/op 1.5365 ms/op 0.91
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.1722 ms/op 2.7678 ms/op 0.78
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.4613 ms/op 4.2547 ms/op 0.81
BLS verifyMultipleSignatures - same message - 128 - blst-native 6.5640 ms/op 5.7933 ms/op 1.13
BLS aggregatePubkeys 32 - blst-native 26.606 us/op 26.494 us/op 1.00
BLS aggregatePubkeys 128 - blst-native 99.297 us/op 102.75 us/op 0.97
getAttestationsForBlock 40.824 ms/op 46.909 ms/op 0.87
isKnown best case - 1 super set check 291.00 ns/op 386.00 ns/op 0.75
isKnown normal case - 2 super set checks 288.00 ns/op 373.00 ns/op 0.77
isKnown worse case - 16 super set checks 292.00 ns/op 404.00 ns/op 0.72
CheckpointStateCache - add get delete 4.9400 us/op 5.9070 us/op 0.84
validate api signedAggregateAndProof - struct 2.7565 ms/op 2.8526 ms/op 0.97
validate gossip signedAggregateAndProof - struct 2.7567 ms/op 2.8508 ms/op 0.97
validate gossip attestation - vc 640000 1.3138 ms/op 1.3892 ms/op 0.95
batch validate gossip attestation - vc 640000 - chunk 32 159.25 us/op 171.12 us/op 0.93
batch validate gossip attestation - vc 640000 - chunk 64 140.61 us/op 150.43 us/op 0.93
batch validate gossip attestation - vc 640000 - chunk 128 131.94 us/op 148.74 us/op 0.89
batch validate gossip attestation - vc 640000 - chunk 256 122.09 us/op 142.60 us/op 0.86
pickEth1Vote - no votes 1.1523 ms/op 1.3681 ms/op 0.84
pickEth1Vote - max votes 9.4263 ms/op 12.372 ms/op 0.76
pickEth1Vote - Eth1Data hashTreeRoot value x2048 17.809 ms/op 20.087 ms/op 0.89
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 27.596 ms/op 36.650 ms/op 0.75
pickEth1Vote - Eth1Data fastSerialize value x2048 568.83 us/op 697.53 us/op 0.82
pickEth1Vote - Eth1Data fastSerialize tree x2048 6.3643 ms/op 6.6577 ms/op 0.96
bytes32 toHexString 463.00 ns/op 768.00 ns/op 0.60
bytes32 Buffer.toString(hex) 269.00 ns/op 309.00 ns/op 0.87
bytes32 Buffer.toString(hex) from Uint8Array 407.00 ns/op 550.00 ns/op 0.74
bytes32 Buffer.toString(hex) + 0x 267.00 ns/op 333.00 ns/op 0.80
Object access 1 prop 0.14500 ns/op 0.22100 ns/op 0.66
Map access 1 prop 0.13700 ns/op 0.18400 ns/op 0.74
Object get x1000 7.3930 ns/op 8.5300 ns/op 0.87
Map get x1000 0.70200 ns/op 1.0250 ns/op 0.68
Object set x1000 47.071 ns/op 73.333 ns/op 0.64
Map set x1000 36.976 ns/op 52.866 ns/op 0.70
Return object 10000 times 0.22600 ns/op 0.27020 ns/op 0.84
Throw Error 10000 times 3.6882 us/op 4.1256 us/op 0.89
fastMsgIdFn sha256 / 200 bytes 3.0940 us/op 3.5370 us/op 0.87
fastMsgIdFn h32 xxhash / 200 bytes 260.00 ns/op 345.00 ns/op 0.75
fastMsgIdFn h64 xxhash / 200 bytes 334.00 ns/op 412.00 ns/op 0.81
fastMsgIdFn sha256 / 1000 bytes 10.922 us/op 12.660 us/op 0.86
fastMsgIdFn h32 xxhash / 1000 bytes 377.00 ns/op 526.00 ns/op 0.72
fastMsgIdFn h64 xxhash / 1000 bytes 402.00 ns/op 519.00 ns/op 0.77
fastMsgIdFn sha256 / 10000 bytes 100.02 us/op 116.28 us/op 0.86
fastMsgIdFn h32 xxhash / 10000 bytes 1.8200 us/op 2.2660 us/op 0.80
fastMsgIdFn h64 xxhash / 10000 bytes 1.2570 us/op 1.5370 us/op 0.82
send data - 1000 256B messages 17.724 ms/op 24.005 ms/op 0.74
send data - 1000 512B messages 24.524 ms/op 31.513 ms/op 0.78
send data - 1000 1024B messages 38.580 ms/op 47.494 ms/op 0.81
send data - 1000 1200B messages 21.474 ms/op 41.016 ms/op 0.52
send data - 1000 2048B messages 38.731 ms/op 55.548 ms/op 0.70
send data - 1000 4096B messages 38.349 ms/op 53.349 ms/op 0.72
send data - 1000 16384B messages 107.22 ms/op 150.19 ms/op 0.71
send data - 1000 65536B messages 417.55 ms/op 546.82 ms/op 0.76
enrSubnets - fastDeserialize 64 bits 1.2300 us/op 2.6050 us/op 0.47
enrSubnets - ssz BitVector 64 bits 411.00 ns/op 745.00 ns/op 0.55
enrSubnets - fastDeserialize 4 bits 164.00 ns/op 287.00 ns/op 0.57
enrSubnets - ssz BitVector 4 bits 408.00 ns/op 649.00 ns/op 0.63
prioritizePeers score -10:0 att 32-0.1 sync 2-0 102.54 us/op 143.71 us/op 0.71
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 120.85 us/op 182.25 us/op 0.66
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 153.26 us/op 262.18 us/op 0.58
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 281.27 us/op 431.18 us/op 0.65
prioritizePeers score 0:0 att 64-1 sync 4-1 322.86 us/op 430.87 us/op 0.75
array of 16000 items push then shift 1.5460 us/op 1.8609 us/op 0.83
LinkedList of 16000 items push then shift 8.6370 ns/op 10.959 ns/op 0.79
array of 16000 items push then pop 71.694 ns/op 141.39 ns/op 0.51
LinkedList of 16000 items push then pop 8.3860 ns/op 9.9970 ns/op 0.84
array of 24000 items push then shift 2.2876 us/op 2.7287 us/op 0.84
LinkedList of 24000 items push then shift 8.7800 ns/op 12.101 ns/op 0.73
array of 24000 items push then pop 102.83 ns/op 171.20 ns/op 0.60
LinkedList of 24000 items push then pop 8.6210 ns/op 9.5620 ns/op 0.90
intersect bitArray bitLen 8 6.3540 ns/op 7.0340 ns/op 0.90
intersect array and set length 8 61.110 ns/op 95.251 ns/op 0.64
intersect bitArray bitLen 128 33.577 ns/op 38.367 ns/op 0.88
intersect array and set length 128 843.13 ns/op 1.1804 us/op 0.71
bitArray.getTrueBitIndexes() bitLen 128 1.4440 us/op 1.9790 us/op 0.73
bitArray.getTrueBitIndexes() bitLen 248 2.3970 us/op 3.2820 us/op 0.73
bitArray.getTrueBitIndexes() bitLen 512 4.7370 us/op 7.0970 us/op 0.67
Buffer.concat 32 items 1.0830 us/op 1.1530 us/op 0.94
Uint8Array.set 32 items 2.3950 us/op 2.1100 us/op 1.14
Set add up to 64 items then delete first 4.2977 us/op 5.1098 us/op 0.84
OrderedSet add up to 64 items then delete first 5.3836 us/op 6.8808 us/op 0.78
Set add up to 64 items then delete last 4.6225 us/op 5.7787 us/op 0.80
OrderedSet add up to 64 items then delete last 5.9964 us/op 7.6454 us/op 0.78
Set add up to 64 items then delete middle 4.5932 us/op 5.5910 us/op 0.82
OrderedSet add up to 64 items then delete middle 7.2965 us/op 8.6350 us/op 0.84
Set add up to 128 items then delete first 9.2876 us/op 11.295 us/op 0.82
OrderedSet add up to 128 items then delete first 12.890 us/op 14.787 us/op 0.87
Set add up to 128 items then delete last 9.2460 us/op 11.273 us/op 0.82
OrderedSet add up to 128 items then delete last 12.139 us/op 15.252 us/op 0.80
Set add up to 128 items then delete middle 9.1836 us/op 11.276 us/op 0.81
OrderedSet add up to 128 items then delete middle 17.482 us/op 21.341 us/op 0.82
Set add up to 256 items then delete first 18.972 us/op 22.482 us/op 0.84
OrderedSet add up to 256 items then delete first 26.110 us/op 30.390 us/op 0.86
Set add up to 256 items then delete last 18.276 us/op 22.853 us/op 0.80
OrderedSet add up to 256 items then delete last 24.173 us/op 32.348 us/op 0.75
Set add up to 256 items then delete middle 18.009 us/op 22.382 us/op 0.80
OrderedSet add up to 256 items then delete middle 45.426 us/op 54.532 us/op 0.83
transfer serialized Status (84 B) 1.8220 us/op 2.3060 us/op 0.79
copy serialized Status (84 B) 1.5080 us/op 1.8860 us/op 0.80
transfer serialized SignedVoluntaryExit (112 B) 2.1120 us/op 2.2230 us/op 0.95
copy serialized SignedVoluntaryExit (112 B) 1.6970 us/op 1.8990 us/op 0.89
transfer serialized ProposerSlashing (416 B) 3.1290 us/op 3.3540 us/op 0.93
copy serialized ProposerSlashing (416 B) 3.0050 us/op 3.8940 us/op 0.77
transfer serialized Attestation (485 B) 3.2780 us/op 3.7620 us/op 0.87
copy serialized Attestation (485 B) 3.0440 us/op 3.7920 us/op 0.80
transfer serialized AttesterSlashing (33232 B) 2.9890 us/op 3.1660 us/op 0.94
copy serialized AttesterSlashing (33232 B) 5.9230 us/op 11.532 us/op 0.51
transfer serialized Small SignedBeaconBlock (128000 B) 3.2440 us/op 3.8260 us/op 0.85
copy serialized Small SignedBeaconBlock (128000 B) 13.458 us/op 36.479 us/op 0.37
transfer serialized Avg SignedBeaconBlock (200000 B) 3.6660 us/op 4.7360 us/op 0.77
copy serialized Avg SignedBeaconBlock (200000 B) 19.919 us/op 64.109 us/op 0.31
transfer serialized BlobsSidecar (524380 B) 3.7090 us/op 5.0120 us/op 0.74
copy serialized BlobsSidecar (524380 B) 83.057 us/op 157.42 us/op 0.53
transfer serialized Big SignedBeaconBlock (1000000 B) 3.7150 us/op 6.9040 us/op 0.54
copy serialized Big SignedBeaconBlock (1000000 B) 160.46 us/op 330.14 us/op 0.49
pass gossip attestations to forkchoice per slot 4.1875 ms/op 5.0945 ms/op 0.82
forkChoice updateHead vc 100000 bc 64 eq 0 683.50 us/op 852.15 us/op 0.80
forkChoice updateHead vc 600000 bc 64 eq 0 4.4850 ms/op 10.322 ms/op 0.43
forkChoice updateHead vc 1000000 bc 64 eq 0 6.7900 ms/op 9.2129 ms/op 0.74
forkChoice updateHead vc 600000 bc 320 eq 0 4.1498 ms/op 6.1430 ms/op 0.68
forkChoice updateHead vc 600000 bc 1200 eq 0 4.2029 ms/op 5.4521 ms/op 0.77
forkChoice updateHead vc 600000 bc 7200 eq 0 5.3437 ms/op 7.3441 ms/op 0.73
forkChoice updateHead vc 600000 bc 64 eq 1000 10.745 ms/op 12.925 ms/op 0.83
forkChoice updateHead vc 600000 bc 64 eq 10000 11.554 ms/op 13.833 ms/op 0.84
forkChoice updateHead vc 600000 bc 64 eq 300000 15.417 ms/op 30.625 ms/op 0.50
computeDeltas 500000 validators 300 proto nodes 6.3885 ms/op 7.1993 ms/op 0.89
computeDeltas 500000 validators 1200 proto nodes 6.3062 ms/op 7.3540 ms/op 0.86
computeDeltas 500000 validators 7200 proto nodes 6.1795 ms/op 7.1720 ms/op 0.86
computeDeltas 750000 validators 300 proto nodes 9.4656 ms/op 10.504 ms/op 0.90
computeDeltas 750000 validators 1200 proto nodes 9.4917 ms/op 10.338 ms/op 0.92
computeDeltas 750000 validators 7200 proto nodes 9.6089 ms/op 9.9210 ms/op 0.97
computeDeltas 1400000 validators 300 proto nodes 17.775 ms/op 19.254 ms/op 0.92
computeDeltas 1400000 validators 1200 proto nodes 17.751 ms/op 18.452 ms/op 0.96
computeDeltas 1400000 validators 7200 proto nodes 17.462 ms/op 18.258 ms/op 0.96
computeDeltas 2100000 validators 300 proto nodes 27.227 ms/op 27.053 ms/op 1.01
computeDeltas 2100000 validators 1200 proto nodes 27.810 ms/op 27.397 ms/op 1.02
computeDeltas 2100000 validators 7200 proto nodes 27.804 ms/op 27.799 ms/op 1.00
computeProposerBoostScoreFromBalances 500000 validators 3.7260 ms/op 3.7275 ms/op 1.00
computeProposerBoostScoreFromBalances 750000 validators 3.7214 ms/op 3.7654 ms/op 0.99
computeProposerBoostScoreFromBalances 1400000 validators 3.6127 ms/op 3.7799 ms/op 0.96
computeProposerBoostScoreFromBalances 2100000 validators 3.7175 ms/op 3.7347 ms/op 1.00
altair processAttestation - 250000 vs - 7PWei normalcase 2.0851 ms/op 2.2321 ms/op 0.93
altair processAttestation - 250000 vs - 7PWei worstcase 3.0591 ms/op 3.3680 ms/op 0.91
altair processAttestation - setStatus - 1/6 committees join 151.83 us/op 180.43 us/op 0.84
altair processAttestation - setStatus - 1/3 committees join 292.77 us/op 348.77 us/op 0.84
altair processAttestation - setStatus - 1/2 committees join 382.65 us/op 466.54 us/op 0.82
altair processAttestation - setStatus - 2/3 committees join 473.10 us/op 606.04 us/op 0.78
altair processAttestation - setStatus - 4/5 committees join 697.20 us/op 787.79 us/op 0.89
altair processAttestation - setStatus - 100% committees join 808.03 us/op 936.60 us/op 0.86
altair processBlock - 250000 vs - 7PWei normalcase 10.209 ms/op 11.269 ms/op 0.91
altair processBlock - 250000 vs - 7PWei normalcase hashState 38.345 ms/op 34.887 ms/op 1.10
altair processBlock - 250000 vs - 7PWei worstcase 39.591 ms/op 38.548 ms/op 1.03
altair processBlock - 250000 vs - 7PWei worstcase hashState 87.824 ms/op 91.344 ms/op 0.96
phase0 processBlock - 250000 vs - 7PWei normalcase 2.8905 ms/op 3.1445 ms/op 0.92
phase0 processBlock - 250000 vs - 7PWei worstcase 30.454 ms/op 30.219 ms/op 1.01
altair processEth1Data - 250000 vs - 7PWei normalcase 497.02 us/op 631.12 us/op 0.79
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 7.5840 us/op 7.6950 us/op 0.99
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 60.257 us/op 72.440 us/op 0.83
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 15.586 us/op 10.451 us/op 1.49
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 6.9280 us/op 10.529 us/op 0.66
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 125.72 us/op 177.74 us/op 0.71
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.0432 ms/op 1.4026 ms/op 0.74
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.4948 ms/op 1.5607 ms/op 0.96
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.4800 ms/op 1.8666 ms/op 0.79
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.4222 ms/op 3.7541 ms/op 0.91
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.2987 ms/op 2.3373 ms/op 0.98
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 5.1165 ms/op 5.2319 ms/op 0.98
Tree 40 250000 create 340.99 ms/op 361.94 ms/op 0.94
Tree 40 250000 get(125000) 190.07 ns/op 195.32 ns/op 0.97
Tree 40 250000 set(125000) 976.51 ns/op 1.1853 us/op 0.82
Tree 40 250000 toArray() 18.686 ms/op 24.641 ms/op 0.76
Tree 40 250000 iterate all - toArray() + loop 18.579 ms/op 20.767 ms/op 0.89
Tree 40 250000 iterate all - get(i) 66.617 ms/op 68.907 ms/op 0.97
MutableVector 250000 create 13.712 ms/op 10.929 ms/op 1.25
MutableVector 250000 get(125000) 6.2180 ns/op 6.6810 ns/op 0.93
MutableVector 250000 set(125000) 266.08 ns/op 283.25 ns/op 0.94
MutableVector 250000 toArray() 3.5926 ms/op 3.5049 ms/op 1.03
MutableVector 250000 iterate all - toArray() + loop 3.3460 ms/op 3.3137 ms/op 1.01
MutableVector 250000 iterate all - get(i) 1.5238 ms/op 1.6132 ms/op 0.94
Array 250000 create 2.8969 ms/op 3.4333 ms/op 0.84
Array 250000 clone - spread 1.2167 ms/op 1.1732 ms/op 1.04
Array 250000 get(125000) 1.0120 ns/op 1.0060 ns/op 1.01
Array 250000 set(125000) 4.0730 ns/op 4.0300 ns/op 1.01
Array 250000 iterate all - loop 164.58 us/op 164.37 us/op 1.00
effectiveBalanceIncrements clone Uint8Array 300000 25.196 us/op 25.617 us/op 0.98
effectiveBalanceIncrements clone MutableVector 300000 346.00 ns/op 338.00 ns/op 1.02
effectiveBalanceIncrements rw all Uint8Array 300000 199.03 us/op 200.25 us/op 0.99
effectiveBalanceIncrements rw all MutableVector 300000 81.126 ms/op 81.062 ms/op 1.00
phase0 afterProcessEpoch - 250000 vs - 7PWei 113.19 ms/op 115.10 ms/op 0.98
phase0 beforeProcessEpoch - 250000 vs - 7PWei 46.851 ms/op 49.397 ms/op 0.95
altair processEpoch - mainnet_e81889 476.27 ms/op 481.02 ms/op 0.99
mainnet_e81889 - altair beforeProcessEpoch 75.938 ms/op 79.358 ms/op 0.96
mainnet_e81889 - altair processJustificationAndFinalization 13.023 us/op 14.427 us/op 0.90
mainnet_e81889 - altair processInactivityUpdates 5.8380 ms/op 6.2530 ms/op 0.93
mainnet_e81889 - altair processRewardsAndPenalties 63.232 ms/op 61.119 ms/op 1.03
mainnet_e81889 - altair processRegistryUpdates 2.5830 us/op 2.5200 us/op 1.02
mainnet_e81889 - altair processSlashings 458.00 ns/op 463.00 ns/op 0.99
mainnet_e81889 - altair processEth1DataReset 512.00 ns/op 491.00 ns/op 1.04
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.4532 ms/op 1.4490 ms/op 1.00
mainnet_e81889 - altair processSlashingsReset 3.6500 us/op 4.1210 us/op 0.89
mainnet_e81889 - altair processRandaoMixesReset 5.2280 us/op 5.5140 us/op 0.95
mainnet_e81889 - altair processHistoricalRootsUpdate 657.00 ns/op 744.00 ns/op 0.88
mainnet_e81889 - altair processParticipationFlagUpdates 1.9230 us/op 2.5720 us/op 0.75
mainnet_e81889 - altair processSyncCommitteeUpdates 605.00 ns/op 986.00 ns/op 0.61
mainnet_e81889 - altair afterProcessEpoch 118.26 ms/op 122.81 ms/op 0.96
capella processEpoch - mainnet_e217614 1.9894 s/op 2.1737 s/op 0.92
mainnet_e217614 - capella beforeProcessEpoch 449.33 ms/op 460.34 ms/op 0.98
mainnet_e217614 - capella processJustificationAndFinalization 12.696 us/op 14.480 us/op 0.88
mainnet_e217614 - capella processInactivityUpdates 16.740 ms/op 16.971 ms/op 0.99
mainnet_e217614 - capella processRewardsAndPenalties 419.44 ms/op 395.81 ms/op 1.06
mainnet_e217614 - capella processRegistryUpdates 15.574 us/op 23.507 us/op 0.66
mainnet_e217614 - capella processSlashings 426.00 ns/op 528.00 ns/op 0.81
mainnet_e217614 - capella processEth1DataReset 458.00 ns/op 523.00 ns/op 0.88
mainnet_e217614 - capella processEffectiveBalanceUpdates 6.9022 ms/op 5.0622 ms/op 1.36
mainnet_e217614 - capella processSlashingsReset 2.8790 us/op 3.6520 us/op 0.79
mainnet_e217614 - capella processRandaoMixesReset 4.3680 us/op 5.6050 us/op 0.78
mainnet_e217614 - capella processHistoricalRootsUpdate 453.00 ns/op 877.00 ns/op 0.52
mainnet_e217614 - capella processParticipationFlagUpdates 1.3630 us/op 1.9140 us/op 0.71
mainnet_e217614 - capella afterProcessEpoch 301.75 ms/op 312.80 ms/op 0.96
phase0 processEpoch - mainnet_e58758 428.83 ms/op 461.91 ms/op 0.93
mainnet_e58758 - phase0 beforeProcessEpoch 128.94 ms/op 144.13 ms/op 0.89
mainnet_e58758 - phase0 processJustificationAndFinalization 14.375 us/op 16.781 us/op 0.86
mainnet_e58758 - phase0 processRewardsAndPenalties 51.356 ms/op 58.177 ms/op 0.88
mainnet_e58758 - phase0 processRegistryUpdates 10.646 us/op 12.427 us/op 0.86
mainnet_e58758 - phase0 processSlashings 497.00 ns/op 550.00 ns/op 0.90
mainnet_e58758 - phase0 processEth1DataReset 398.00 ns/op 406.00 ns/op 0.98
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.1462 ms/op 1.2169 ms/op 0.94
mainnet_e58758 - phase0 processSlashingsReset 3.1880 us/op 4.6470 us/op 0.69
mainnet_e58758 - phase0 processRandaoMixesReset 3.8760 us/op 4.4100 us/op 0.88
mainnet_e58758 - phase0 processHistoricalRootsUpdate 408.00 ns/op 418.00 ns/op 0.98
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.7090 us/op 4.2160 us/op 0.88
mainnet_e58758 - phase0 afterProcessEpoch 95.491 ms/op 104.65 ms/op 0.91
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.4271 ms/op 1.4306 ms/op 1.00
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4435 ms/op 1.5780 ms/op 0.91
altair processInactivityUpdates - 250000 normalcase 26.965 ms/op 25.887 ms/op 1.04
altair processInactivityUpdates - 250000 worstcase 24.309 ms/op 26.984 ms/op 0.90
phase0 processRegistryUpdates - 250000 normalcase 7.5530 us/op 9.4680 us/op 0.80
phase0 processRegistryUpdates - 250000 badcase_full_deposits 342.24 us/op 445.41 us/op 0.77
phase0 processRegistryUpdates - 250000 worstcase 0.5 128.51 ms/op 157.18 ms/op 0.82
altair processRewardsAndPenalties - 250000 normalcase 56.871 ms/op 55.833 ms/op 1.02
altair processRewardsAndPenalties - 250000 worstcase 55.283 ms/op 57.806 ms/op 0.96
phase0 getAttestationDeltas - 250000 normalcase 8.7188 ms/op 11.950 ms/op 0.73
phase0 getAttestationDeltas - 250000 worstcase 9.0617 ms/op 12.745 ms/op 0.71
phase0 processSlashings - 250000 worstcase 83.974 us/op 108.54 us/op 0.77
altair processSyncCommitteeUpdates - 250000 153.80 ms/op 169.21 ms/op 0.91
BeaconState.hashTreeRoot - No change 240.00 ns/op 265.00 ns/op 0.91
BeaconState.hashTreeRoot - 1 full validator 159.13 us/op 162.69 us/op 0.98
BeaconState.hashTreeRoot - 32 full validator 1.7308 ms/op 1.5441 ms/op 1.12
BeaconState.hashTreeRoot - 512 full validator 15.040 ms/op 17.908 ms/op 0.84
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 166.21 us/op 196.24 us/op 0.85
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.2473 ms/op 2.5402 ms/op 0.88
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 24.398 ms/op 32.821 ms/op 0.74
BeaconState.hashTreeRoot - 1 balances 163.10 us/op 198.16 us/op 0.82
BeaconState.hashTreeRoot - 32 balances 1.3167 ms/op 1.6783 ms/op 0.78
BeaconState.hashTreeRoot - 512 balances 12.487 ms/op 13.739 ms/op 0.91
BeaconState.hashTreeRoot - 250000 balances 209.47 ms/op 199.66 ms/op 1.05
aggregationBits - 2048 els - zipIndexesInBitList 17.531 us/op 20.249 us/op 0.87
byteArrayEquals 32 75.286 ns/op 78.757 ns/op 0.96
Buffer.compare 32 55.823 ns/op 57.765 ns/op 0.97
byteArrayEquals 1024 2.0526 us/op 2.0992 us/op 0.98
Buffer.compare 1024 70.941 ns/op 71.980 ns/op 0.99
byteArrayEquals 16384 32.667 us/op 33.454 us/op 0.98
Buffer.compare 16384 267.55 ns/op 275.27 ns/op 0.97
byteArrayEquals 123687377 246.68 ms/op 243.94 ms/op 1.01
Buffer.compare 123687377 6.0835 ms/op 6.0887 ms/op 1.00
byteArrayEquals 32 - diff last byte 72.112 ns/op 71.947 ns/op 1.00
Buffer.compare 32 - diff last byte 67.950 ns/op 60.793 ns/op 1.12
byteArrayEquals 1024 - diff last byte 2.0913 us/op 2.0684 us/op 1.01
Buffer.compare 1024 - diff last byte 73.513 ns/op 73.798 ns/op 1.00
byteArrayEquals 16384 - diff last byte 32.570 us/op 32.852 us/op 0.99
Buffer.compare 16384 - diff last byte 273.01 ns/op 277.13 ns/op 0.99
byteArrayEquals 123687377 - diff last byte 245.25 ms/op 242.70 ms/op 1.01
Buffer.compare 123687377 - diff last byte 6.0517 ms/op 6.0065 ms/op 1.01
byteArrayEquals 32 - random bytes 5.2340 ns/op 5.2280 ns/op 1.00
Buffer.compare 32 - random bytes 60.263 ns/op 58.491 ns/op 1.03
byteArrayEquals 1024 - random bytes 5.1460 ns/op 4.9960 ns/op 1.03
Buffer.compare 1024 - random bytes 59.730 ns/op 58.235 ns/op 1.03
byteArrayEquals 16384 - random bytes 5.1450 ns/op 4.9940 ns/op 1.03
Buffer.compare 16384 - random bytes 59.606 ns/op 57.952 ns/op 1.03
byteArrayEquals 123687377 - random bytes 8.2200 ns/op 8.0000 ns/op 1.03
Buffer.compare 123687377 - random bytes 62.670 ns/op 61.520 ns/op 1.02
regular array get 100000 times 43.957 us/op 42.666 us/op 1.03
wrappedArray get 100000 times 44.028 us/op 42.748 us/op 1.03
arrayWithProxy get 100000 times 14.727 ms/op 13.674 ms/op 1.08
ssz.Root.equals 53.258 ns/op 51.768 ns/op 1.03
byteArrayEquals 50.583 ns/op 50.934 ns/op 0.99
Buffer.compare 10.960 ns/op 10.409 ns/op 1.05
shuffle list - 16384 els 6.7247 ms/op 6.8939 ms/op 0.98
shuffle list - 250000 els 98.770 ms/op 99.560 ms/op 0.99
processSlot - 1 slots 16.457 us/op 16.664 us/op 0.99
processSlot - 32 slots 3.8983 ms/op 3.0151 ms/op 1.29
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 60.041 ms/op 51.544 ms/op 1.16
getCommitteeAssignments - req 1 vs - 250000 vc 2.4527 ms/op 2.4448 ms/op 1.00
getCommitteeAssignments - req 100 vs - 250000 vc 3.6289 ms/op 3.6191 ms/op 1.00
getCommitteeAssignments - req 1000 vs - 250000 vc 4.0263 ms/op 3.9800 ms/op 1.01
findModifiedValidators - 10000 modified validators 516.76 ms/op 506.96 ms/op 1.02
findModifiedValidators - 1000 modified validators 386.69 ms/op 406.13 ms/op 0.95
findModifiedValidators - 100 modified validators 406.59 ms/op 402.22 ms/op 1.01
findModifiedValidators - 10 modified validators 408.15 ms/op 431.10 ms/op 0.95
findModifiedValidators - 1 modified validators 372.38 ms/op 414.19 ms/op 0.90
findModifiedValidators - no difference 383.64 ms/op 382.97 ms/op 1.00
compare ViewDUs 4.3183 s/op 4.4744 s/op 0.97
compare each validator Uint8Array 1.5317 s/op 1.6964 s/op 0.90
compare ViewDU to Uint8Array 1.1292 s/op 1.2863 s/op 0.88
migrate state 1000000 validators, 24 modified, 0 new 795.44 ms/op 844.06 ms/op 0.94
migrate state 1000000 validators, 1700 modified, 1000 new 1.0925 s/op 1.1796 s/op 0.93
migrate state 1000000 validators, 3400 modified, 2000 new 1.3170 s/op 1.3955 s/op 0.94
migrate state 1500000 validators, 24 modified, 0 new 783.43 ms/op 725.60 ms/op 1.08
migrate state 1500000 validators, 1700 modified, 1000 new 1.0886 s/op 1.1022 s/op 0.99
migrate state 1500000 validators, 3400 modified, 2000 new 1.3027 s/op 1.4015 s/op 0.93
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.4100 ns/op 4.8000 ns/op 0.92
state getBlockRootAtSlot - 250000 vs - 7PWei 819.55 ns/op 607.94 ns/op 1.35
computeProposers - vc 250000 8.9119 ms/op 9.6847 ms/op 0.92
computeEpochShuffling - vc 250000 100.04 ms/op 110.73 ms/op 0.90
getNextSyncCommittee - vc 250000 150.05 ms/op 161.91 ms/op 0.93
computeSigningRoot for AttestationData 26.963 us/op 24.803 us/op 1.09
hash AttestationData serialized data then Buffer.toString(base64) 2.2949 us/op 2.4611 us/op 0.93
toHexString serialized data 1.0555 us/op 1.1497 us/op 0.92
Buffer.toString(base64) 217.34 ns/op 231.09 ns/op 0.94

by benchmarkbot/action

Copy link
Contributor

@g11tech g11tech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@g11tech g11tech merged commit d5e47e1 into unstable Dec 2, 2023
15 checks passed
@g11tech g11tech deleted the nflaig/set-eth-consensus-version branch December 2, 2023 13:31
@philknows philknows added this to the v1.12.1 milestone Dec 2, 2023
@nflaig nflaig modified the milestones: v1.12.1, v1.13.0 Dec 13, 2023
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.13.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
4 participants