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: clone attestations for block inclusion #6174

Merged
merged 1 commit into from
Dec 9, 2023

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Dec 9, 2023

Motivation

After attestations are included for block, they could be modified by gossip, see

aggregateInto(prevAttestation, attestation);

This lead to the produced block and the published block (the block we received in publishBlock api) could be different

Description

Clone attestations to include for block

@twoeths twoeths requested a review from a team as a code owner December 9, 2023 08:04
Copy link

codecov bot commented Dec 9, 2023

Codecov Report

Merging #6174 (3ae7cd9) into unstable (8bd19f4) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #6174   +/-   ##
=========================================
  Coverage     80.02%   80.02%           
=========================================
  Files            19       19           
  Lines          1717     1717           
  Branches        155      155           
=========================================
  Hits           1374     1374           
  Misses          341      341           
  Partials          2        2           

if (i >= MAX_ATTESTATIONS) {
break;
}
// attestations could be modified in this op pool, so we need to clone for block
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice one! I'm wondering if this could be tested somehow?

Also immutable data structure (à la immutable.js) could be considered if the cloning is identified as a perf issue (here or elsewhere).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice one! I'm wondering if this could be tested somehow?

testing this requires setting up the pool and add attestations and produce blocks at the same time, I think it's not worth it. We do have a lot of unit tests for this file https://github.com/ChainSafe/lodestar/blob/unstable/packages/beacon-node/test/unit/chain/opPools/aggregatedAttestationPool.test.ts

Also immutable data structure (à la immutable.js) could be considered if the cloning is identified as a perf issue (here or elsewhere).

we only need to do the clone in this specific scenario, we do use immutable.js in this PR #6042 where it's really needed

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense!

Also might be clearer to just add the cloning part in the existing map, as map already returns a new array anyway. A matter of taste probably.

Copy link
Member

Choose a reason for hiding this comment

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

Also might be clearer to just add the cloning part in the existing map

Yes I agree there. No need to be so much more verbose with named intermediate variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

clone() made the code a little bit slower, so I just want to use a single for loop to hopefully keep the same performance. There was already an issue with producing slow beacon block body #5793

Copy link
Contributor

github-actions bot commented Dec 9, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 23cc705 Previous: 8bd19f4 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 738.12 us/op 616.24 us/op 1.20
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 78.932 us/op 84.140 us/op 0.94
BLS verify - blst-native 1.2651 ms/op 1.3026 ms/op 0.97
BLS verifyMultipleSignatures 3 - blst-native 2.6537 ms/op 2.7568 ms/op 0.96
BLS verifyMultipleSignatures 8 - blst-native 5.8296 ms/op 5.9848 ms/op 0.97
BLS verifyMultipleSignatures 32 - blst-native 21.308 ms/op 21.986 ms/op 0.97
BLS verifyMultipleSignatures 64 - blst-native 41.984 ms/op 43.289 ms/op 0.97
BLS verifyMultipleSignatures 128 - blst-native 83.277 ms/op 86.666 ms/op 0.96
BLS deserializing 10000 signatures 911.46 ms/op 935.46 ms/op 0.97
BLS deserializing 100000 signatures 8.9701 s/op 9.4444 s/op 0.95
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.2868 ms/op 1.3564 ms/op 0.95
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.4517 ms/op 1.5296 ms/op 0.95
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.8368 ms/op 3.0100 ms/op 0.94
BLS verifyMultipleSignatures - same message - 64 - blst-native 4.4384 ms/op 4.2856 ms/op 1.04
BLS verifyMultipleSignatures - same message - 128 - blst-native 5.4381 ms/op 8.0464 ms/op 0.68
BLS aggregatePubkeys 32 - blst-native 25.135 us/op 25.945 us/op 0.97
BLS aggregatePubkeys 128 - blst-native 97.499 us/op 105.55 us/op 0.92
getAttestationsForBlock 41.432 ms/op 56.744 ms/op 0.73
getSlashingsAndExits - default max 136.97 us/op 191.04 us/op 0.72
getSlashingsAndExits - 2k 399.42 us/op 585.25 us/op 0.68
proposeBlockBody type=full, size=empty 4.8936 ms/op 5.5220 ms/op 0.89
isKnown best case - 1 super set check 293.00 ns/op 479.00 ns/op 0.61
isKnown normal case - 2 super set checks 276.00 ns/op 591.00 ns/op 0.47
isKnown worse case - 16 super set checks 273.00 ns/op 570.00 ns/op 0.48
CheckpointStateCache - add get delete 4.8550 us/op 5.8800 us/op 0.83
validate api signedAggregateAndProof - struct 2.6838 ms/op 2.7748 ms/op 0.97
validate gossip signedAggregateAndProof - struct 2.6801 ms/op 2.7717 ms/op 0.97
validate gossip attestation - vc 640000 1.3120 ms/op 1.3731 ms/op 0.96
batch validate gossip attestation - vc 640000 - chunk 32 151.42 us/op 166.82 us/op 0.91
batch validate gossip attestation - vc 640000 - chunk 64 133.38 us/op 150.37 us/op 0.89
batch validate gossip attestation - vc 640000 - chunk 128 128.66 us/op 153.23 us/op 0.84
batch validate gossip attestation - vc 640000 - chunk 256 123.45 us/op 139.16 us/op 0.89
pickEth1Vote - no votes 1.1127 ms/op 1.3071 ms/op 0.85
pickEth1Vote - max votes 9.9634 ms/op 11.322 ms/op 0.88
pickEth1Vote - Eth1Data hashTreeRoot value x2048 20.444 ms/op 19.850 ms/op 1.03
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 25.794 ms/op 27.742 ms/op 0.93
pickEth1Vote - Eth1Data fastSerialize value x2048 535.76 us/op 708.86 us/op 0.76
pickEth1Vote - Eth1Data fastSerialize tree x2048 6.8307 ms/op 8.8782 ms/op 0.77
bytes32 toHexString 461.00 ns/op 804.00 ns/op 0.57
bytes32 Buffer.toString(hex) 270.00 ns/op 331.00 ns/op 0.82
bytes32 Buffer.toString(hex) from Uint8Array 397.00 ns/op 591.00 ns/op 0.67
bytes32 Buffer.toString(hex) + 0x 299.00 ns/op 330.00 ns/op 0.91
Object access 1 prop 0.14400 ns/op 0.23200 ns/op 0.62
Map access 1 prop 0.13400 ns/op 0.15200 ns/op 0.88
Object get x1000 7.4370 ns/op 7.7730 ns/op 0.96
Map get x1000 0.71700 ns/op 0.87700 ns/op 0.82
Object set x1000 48.580 ns/op 77.891 ns/op 0.62
Map set x1000 38.211 ns/op 55.332 ns/op 0.69
Return object 10000 times 0.23060 ns/op 0.26470 ns/op 0.87
Throw Error 10000 times 3.7933 us/op 4.0775 us/op 0.93
fastMsgIdFn sha256 / 200 bytes 3.1980 us/op 3.5420 us/op 0.90
fastMsgIdFn h32 xxhash / 200 bytes 267.00 ns/op 376.00 ns/op 0.71
fastMsgIdFn h64 xxhash / 200 bytes 334.00 ns/op 403.00 ns/op 0.83
fastMsgIdFn sha256 / 1000 bytes 11.043 us/op 11.715 us/op 0.94
fastMsgIdFn h32 xxhash / 1000 bytes 392.00 ns/op 496.00 ns/op 0.79
fastMsgIdFn h64 xxhash / 1000 bytes 403.00 ns/op 480.00 ns/op 0.84
fastMsgIdFn sha256 / 10000 bytes 100.70 us/op 105.94 us/op 0.95
fastMsgIdFn h32 xxhash / 10000 bytes 1.8800 us/op 2.0910 us/op 0.90
fastMsgIdFn h64 xxhash / 10000 bytes 1.2740 us/op 1.4630 us/op 0.87
send data - 1000 256B messages 18.448 ms/op 25.024 ms/op 0.74
send data - 1000 512B messages 25.389 ms/op 30.774 ms/op 0.83
send data - 1000 1024B messages 39.266 ms/op 47.006 ms/op 0.84
send data - 1000 1200B messages 36.093 ms/op 44.339 ms/op 0.81
send data - 1000 2048B messages 41.926 ms/op 46.938 ms/op 0.89
send data - 1000 4096B messages 25.373 ms/op 43.277 ms/op 0.59
send data - 1000 16384B messages 116.75 ms/op 130.87 ms/op 0.89
send data - 1000 65536B messages 410.98 ms/op 473.61 ms/op 0.87
enrSubnets - fastDeserialize 64 bits 1.1960 us/op 1.3370 us/op 0.89
enrSubnets - ssz BitVector 64 bits 406.00 ns/op 462.00 ns/op 0.88
enrSubnets - fastDeserialize 4 bits 158.00 ns/op 190.00 ns/op 0.83
enrSubnets - ssz BitVector 4 bits 403.00 ns/op 418.00 ns/op 0.96
prioritizePeers score -10:0 att 32-0.1 sync 2-0 95.596 us/op 113.58 us/op 0.84
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 119.63 us/op 148.69 us/op 0.80
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 155.47 us/op 201.74 us/op 0.77
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 277.09 us/op 329.89 us/op 0.84
prioritizePeers score 0:0 att 64-1 sync 4-1 322.11 us/op 379.20 us/op 0.85
array of 16000 items push then shift 1.5921 us/op 1.6896 us/op 0.94
LinkedList of 16000 items push then shift 8.6910 ns/op 9.8170 ns/op 0.89
array of 16000 items push then pop 66.175 ns/op 125.99 ns/op 0.53
LinkedList of 16000 items push then pop 8.5960 ns/op 9.1650 ns/op 0.94
array of 24000 items push then shift 2.3739 us/op 2.6026 us/op 0.91
LinkedList of 24000 items push then shift 8.7600 ns/op 10.364 ns/op 0.85
array of 24000 items push then pop 87.485 ns/op 158.17 ns/op 0.55
LinkedList of 24000 items push then pop 8.5470 ns/op 8.9940 ns/op 0.95
intersect bitArray bitLen 8 6.2890 ns/op 6.4970 ns/op 0.97
intersect array and set length 8 60.819 ns/op 74.864 ns/op 0.81
intersect bitArray bitLen 128 33.257 ns/op 34.106 ns/op 0.98
intersect array and set length 128 836.45 ns/op 1.0502 us/op 0.80
bitArray.getTrueBitIndexes() bitLen 128 1.3780 us/op 1.9050 us/op 0.72
bitArray.getTrueBitIndexes() bitLen 248 2.3270 us/op 3.0520 us/op 0.76
bitArray.getTrueBitIndexes() bitLen 512 4.5830 us/op 5.7910 us/op 0.79
Buffer.concat 32 items 1.0590 us/op 1.0280 us/op 1.03
Uint8Array.set 32 items 1.8580 us/op 2.1930 us/op 0.85
Set add up to 64 items then delete first 4.1816 us/op 4.7783 us/op 0.88
OrderedSet add up to 64 items then delete first 5.2550 us/op 6.3724 us/op 0.82
Set add up to 64 items then delete last 4.4600 us/op 5.3995 us/op 0.83
OrderedSet add up to 64 items then delete last 5.5535 us/op 7.1348 us/op 0.78
Set add up to 64 items then delete middle 4.4138 us/op 5.4457 us/op 0.81
OrderedSet add up to 64 items then delete middle 6.7768 us/op 8.4173 us/op 0.81
Set add up to 128 items then delete first 8.9690 us/op 10.787 us/op 0.83
OrderedSet add up to 128 items then delete first 11.951 us/op 14.932 us/op 0.80
Set add up to 128 items then delete last 8.8412 us/op 10.742 us/op 0.82
OrderedSet add up to 128 items then delete last 11.190 us/op 14.803 us/op 0.76
Set add up to 128 items then delete middle 8.7925 us/op 10.896 us/op 0.81
OrderedSet add up to 128 items then delete middle 16.318 us/op 19.496 us/op 0.84
Set add up to 256 items then delete first 17.925 us/op 21.066 us/op 0.85
OrderedSet add up to 256 items then delete first 24.402 us/op 29.414 us/op 0.83
Set add up to 256 items then delete last 17.564 us/op 20.390 us/op 0.86
OrderedSet add up to 256 items then delete last 22.497 us/op 25.005 us/op 0.90
Set add up to 256 items then delete middle 17.584 us/op 19.070 us/op 0.92
OrderedSet add up to 256 items then delete middle 43.503 us/op 48.135 us/op 0.90
transfer serialized Status (84 B) 1.7700 us/op 2.1140 us/op 0.84
copy serialized Status (84 B) 1.4410 us/op 1.7040 us/op 0.85
transfer serialized SignedVoluntaryExit (112 B) 1.8680 us/op 2.0290 us/op 0.92
copy serialized SignedVoluntaryExit (112 B) 1.5060 us/op 1.7070 us/op 0.88
transfer serialized ProposerSlashing (416 B) 2.2910 us/op 3.1700 us/op 0.72
copy serialized ProposerSlashing (416 B) 1.9850 us/op 3.1270 us/op 0.63
transfer serialized Attestation (485 B) 2.4260 us/op 3.4010 us/op 0.71
copy serialized Attestation (485 B) 2.0040 us/op 3.0530 us/op 0.66
transfer serialized AttesterSlashing (33232 B) 2.1320 us/op 3.3690 us/op 0.63
copy serialized AttesterSlashing (33232 B) 4.7870 us/op 9.8960 us/op 0.48
transfer serialized Small SignedBeaconBlock (128000 B) 2.5670 us/op 3.2890 us/op 0.78
copy serialized Small SignedBeaconBlock (128000 B) 13.484 us/op 21.887 us/op 0.62
transfer serialized Avg SignedBeaconBlock (200000 B) 2.8910 us/op 3.3290 us/op 0.87
copy serialized Avg SignedBeaconBlock (200000 B) 19.839 us/op 31.291 us/op 0.63
transfer serialized BlobsSidecar (524380 B) 2.8040 us/op 3.3160 us/op 0.85
copy serialized BlobsSidecar (524380 B) 90.345 us/op 87.938 us/op 1.03
transfer serialized Big SignedBeaconBlock (1000000 B) 2.9220 us/op 3.4660 us/op 0.84
copy serialized Big SignedBeaconBlock (1000000 B) 186.72 us/op 165.68 us/op 1.13
pass gossip attestations to forkchoice per slot 4.1333 ms/op 3.9561 ms/op 1.04
forkChoice updateHead vc 100000 bc 64 eq 0 722.60 us/op 697.22 us/op 1.04
forkChoice updateHead vc 600000 bc 64 eq 0 4.6267 ms/op 5.1786 ms/op 0.89
forkChoice updateHead vc 1000000 bc 64 eq 0 7.1137 ms/op 7.8128 ms/op 0.91
forkChoice updateHead vc 600000 bc 320 eq 0 4.1356 ms/op 4.3810 ms/op 0.94
forkChoice updateHead vc 600000 bc 1200 eq 0 4.3425 ms/op 4.4481 ms/op 0.98
forkChoice updateHead vc 600000 bc 7200 eq 0 5.0377 ms/op 5.7954 ms/op 0.87
forkChoice updateHead vc 600000 bc 64 eq 1000 11.196 ms/op 11.326 ms/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 10000 11.736 ms/op 12.034 ms/op 0.98
forkChoice updateHead vc 600000 bc 64 eq 300000 15.759 ms/op 16.794 ms/op 0.94
computeDeltas 500000 validators 300 proto nodes 6.3821 ms/op 6.6801 ms/op 0.96
computeDeltas 500000 validators 1200 proto nodes 6.2861 ms/op 6.5981 ms/op 0.95
computeDeltas 500000 validators 7200 proto nodes 6.2084 ms/op 6.4675 ms/op 0.96
computeDeltas 750000 validators 300 proto nodes 9.4230 ms/op 9.6748 ms/op 0.97
computeDeltas 750000 validators 1200 proto nodes 9.5436 ms/op 9.6197 ms/op 0.99
computeDeltas 750000 validators 7200 proto nodes 9.1224 ms/op 9.5846 ms/op 0.95
computeDeltas 1400000 validators 300 proto nodes 18.356 ms/op 19.243 ms/op 0.95
computeDeltas 1400000 validators 1200 proto nodes 18.187 ms/op 18.847 ms/op 0.96
computeDeltas 1400000 validators 7200 proto nodes 18.607 ms/op 19.348 ms/op 0.96
computeDeltas 2100000 validators 300 proto nodes 27.581 ms/op 28.117 ms/op 0.98
computeDeltas 2100000 validators 1200 proto nodes 27.340 ms/op 28.048 ms/op 0.97
computeDeltas 2100000 validators 7200 proto nodes 27.942 ms/op 28.436 ms/op 0.98
computeProposerBoostScoreFromBalances 500000 validators 3.5957 ms/op 3.7921 ms/op 0.95
computeProposerBoostScoreFromBalances 750000 validators 3.5951 ms/op 3.7162 ms/op 0.97
computeProposerBoostScoreFromBalances 1400000 validators 3.5233 ms/op 3.7402 ms/op 0.94
computeProposerBoostScoreFromBalances 2100000 validators 3.5064 ms/op 3.7642 ms/op 0.93
altair processAttestation - 250000 vs - 7PWei normalcase 2.1430 ms/op 2.6703 ms/op 0.80
altair processAttestation - 250000 vs - 7PWei worstcase 3.1889 ms/op 3.8455 ms/op 0.83
altair processAttestation - setStatus - 1/6 committees join 162.31 us/op 188.34 us/op 0.86
altair processAttestation - setStatus - 1/3 committees join 322.46 us/op 356.25 us/op 0.91
altair processAttestation - setStatus - 1/2 committees join 437.10 us/op 482.60 us/op 0.91
altair processAttestation - setStatus - 2/3 committees join 548.71 us/op 628.00 us/op 0.87
altair processAttestation - setStatus - 4/5 committees join 745.88 us/op 831.40 us/op 0.90
altair processAttestation - setStatus - 100% committees join 875.76 us/op 941.98 us/op 0.93
altair processBlock - 250000 vs - 7PWei normalcase 10.530 ms/op 10.233 ms/op 1.03
altair processBlock - 250000 vs - 7PWei normalcase hashState 40.441 ms/op 39.305 ms/op 1.03
altair processBlock - 250000 vs - 7PWei worstcase 39.770 ms/op 38.715 ms/op 1.03
altair processBlock - 250000 vs - 7PWei worstcase hashState 97.677 ms/op 93.972 ms/op 1.04
phase0 processBlock - 250000 vs - 7PWei normalcase 2.4158 ms/op 3.1438 ms/op 0.77
phase0 processBlock - 250000 vs - 7PWei worstcase 29.208 ms/op 32.885 ms/op 0.89
altair processEth1Data - 250000 vs - 7PWei normalcase 481.25 us/op 642.79 us/op 0.75
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 10.639 us/op 14.003 us/op 0.76
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 56.844 us/op 73.412 us/op 0.77
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 16.563 us/op 19.691 us/op 0.84
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 12.261 us/op 12.459 us/op 0.98
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 155.66 us/op 200.84 us/op 0.78
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.0246 ms/op 1.5726 ms/op 0.65
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.7903 ms/op 1.9899 ms/op 0.90
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.8299 ms/op 1.6750 ms/op 1.09
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.0974 ms/op 4.3508 ms/op 0.71
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.3292 ms/op 3.1592 ms/op 0.74
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.4723 ms/op 5.6997 ms/op 0.78
Tree 40 250000 create 370.05 ms/op 501.10 ms/op 0.74
Tree 40 250000 get(125000) 191.01 ns/op 211.43 ns/op 0.90
Tree 40 250000 set(125000) 909.58 ns/op 1.1197 us/op 0.81
Tree 40 250000 toArray() 17.526 ms/op 23.088 ms/op 0.76
Tree 40 250000 iterate all - toArray() + loop 17.605 ms/op 21.148 ms/op 0.83
Tree 40 250000 iterate all - get(i) 63.271 ms/op 74.734 ms/op 0.85
MutableVector 250000 create 10.845 ms/op 17.931 ms/op 0.60
MutableVector 250000 get(125000) 7.0430 ns/op 6.7010 ns/op 1.05
MutableVector 250000 set(125000) 247.09 ns/op 303.20 ns/op 0.81
MutableVector 250000 toArray() 3.1561 ms/op 4.3309 ms/op 0.73
MutableVector 250000 iterate all - toArray() + loop 3.2669 ms/op 4.1871 ms/op 0.78
MutableVector 250000 iterate all - get(i) 1.5080 ms/op 1.5542 ms/op 0.97
Array 250000 create 2.7578 ms/op 4.2125 ms/op 0.65
Array 250000 clone - spread 1.2147 ms/op 1.4264 ms/op 0.85
Array 250000 get(125000) 1.0080 ns/op 1.1610 ns/op 0.87
Array 250000 set(125000) 4.0480 ns/op 4.3220 ns/op 0.94
Array 250000 iterate all - loop 162.21 us/op 172.76 us/op 0.94
effectiveBalanceIncrements clone Uint8Array 300000 25.882 us/op 45.603 us/op 0.57
effectiveBalanceIncrements clone MutableVector 300000 349.00 ns/op 440.00 ns/op 0.79
effectiveBalanceIncrements rw all Uint8Array 300000 196.08 us/op 201.72 us/op 0.97
effectiveBalanceIncrements rw all MutableVector 300000 80.258 ms/op 118.20 ms/op 0.68
phase0 afterProcessEpoch - 250000 vs - 7PWei 110.28 ms/op 120.27 ms/op 0.92
phase0 beforeProcessEpoch - 250000 vs - 7PWei 52.070 ms/op 52.271 ms/op 1.00
altair processEpoch - mainnet_e81889 469.74 ms/op 523.23 ms/op 0.90
mainnet_e81889 - altair beforeProcessEpoch 85.682 ms/op 86.689 ms/op 0.99
mainnet_e81889 - altair processJustificationAndFinalization 14.285 us/op 15.270 us/op 0.94
mainnet_e81889 - altair processInactivityUpdates 5.8237 ms/op 6.2586 ms/op 0.93
mainnet_e81889 - altair processRewardsAndPenalties 61.086 ms/op 44.693 ms/op 1.37
mainnet_e81889 - altair processRegistryUpdates 2.4290 us/op 2.1220 us/op 1.14
mainnet_e81889 - altair processSlashings 548.00 ns/op 424.00 ns/op 1.29
mainnet_e81889 - altair processEth1DataReset 811.00 ns/op 463.00 ns/op 1.75
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.8269 ms/op 1.4289 ms/op 1.28
mainnet_e81889 - altair processSlashingsReset 4.4230 us/op 3.5100 us/op 1.26
mainnet_e81889 - altair processRandaoMixesReset 5.0840 us/op 4.1500 us/op 1.23
mainnet_e81889 - altair processHistoricalRootsUpdate 859.00 ns/op 914.00 ns/op 0.94
mainnet_e81889 - altair processParticipationFlagUpdates 1.8430 us/op 1.9940 us/op 0.92
mainnet_e81889 - altair processSyncCommitteeUpdates 535.00 ns/op 622.00 ns/op 0.86
mainnet_e81889 - altair afterProcessEpoch 112.72 ms/op 118.07 ms/op 0.95
capella processEpoch - mainnet_e217614 2.0371 s/op 2.2025 s/op 0.92
mainnet_e217614 - capella beforeProcessEpoch 475.95 ms/op 486.58 ms/op 0.98
mainnet_e217614 - capella processJustificationAndFinalization 14.126 us/op 19.495 us/op 0.72
mainnet_e217614 - capella processInactivityUpdates 19.287 ms/op 20.044 ms/op 0.96
mainnet_e217614 - capella processRewardsAndPenalties 423.41 ms/op 412.23 ms/op 1.03
mainnet_e217614 - capella processRegistryUpdates 15.809 us/op 15.228 us/op 1.04
mainnet_e217614 - capella processSlashings 503.00 ns/op 434.00 ns/op 1.16
mainnet_e217614 - capella processEth1DataReset 376.00 ns/op 392.00 ns/op 0.96
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.5054 ms/op 4.3895 ms/op 1.03
mainnet_e217614 - capella processSlashingsReset 3.3770 us/op 3.3280 us/op 1.01
mainnet_e217614 - capella processRandaoMixesReset 4.3430 us/op 6.9330 us/op 0.63
mainnet_e217614 - capella processHistoricalRootsUpdate 580.00 ns/op 545.00 ns/op 1.06
mainnet_e217614 - capella processParticipationFlagUpdates 1.9550 us/op 1.8360 us/op 1.06
mainnet_e217614 - capella afterProcessEpoch 287.51 ms/op 330.21 ms/op 0.87
phase0 processEpoch - mainnet_e58758 426.77 ms/op 455.50 ms/op 0.94
mainnet_e58758 - phase0 beforeProcessEpoch 124.93 ms/op 110.56 ms/op 1.13
mainnet_e58758 - phase0 processJustificationAndFinalization 14.861 us/op 14.962 us/op 0.99
mainnet_e58758 - phase0 processRewardsAndPenalties 54.590 ms/op 53.591 ms/op 1.02
mainnet_e58758 - phase0 processRegistryUpdates 11.487 us/op 9.6060 us/op 1.20
mainnet_e58758 - phase0 processSlashings 405.00 ns/op 436.00 ns/op 0.93
mainnet_e58758 - phase0 processEth1DataReset 409.00 ns/op 424.00 ns/op 0.96
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.0850 ms/op 1.1889 ms/op 0.91
mainnet_e58758 - phase0 processSlashingsReset 4.1470 us/op 3.1910 us/op 1.30
mainnet_e58758 - phase0 processRandaoMixesReset 4.8240 us/op 4.0530 us/op 1.19
mainnet_e58758 - phase0 processHistoricalRootsUpdate 578.00 ns/op 543.00 ns/op 1.06
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.8050 us/op 3.9220 us/op 0.97
mainnet_e58758 - phase0 afterProcessEpoch 93.481 ms/op 102.40 ms/op 0.91
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.3589 ms/op 1.3843 ms/op 0.98
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.9422 ms/op 1.5871 ms/op 1.22
altair processInactivityUpdates - 250000 normalcase 31.761 ms/op 21.848 ms/op 1.45
altair processInactivityUpdates - 250000 worstcase 29.832 ms/op 26.050 ms/op 1.15
phase0 processRegistryUpdates - 250000 normalcase 7.4980 us/op 9.9810 us/op 0.75
phase0 processRegistryUpdates - 250000 badcase_full_deposits 313.19 us/op 500.73 us/op 0.63
phase0 processRegistryUpdates - 250000 worstcase 0.5 121.20 ms/op 137.97 ms/op 0.88
altair processRewardsAndPenalties - 250000 normalcase 59.085 ms/op 73.174 ms/op 0.81
altair processRewardsAndPenalties - 250000 worstcase 60.540 ms/op 69.406 ms/op 0.87
phase0 getAttestationDeltas - 250000 normalcase 8.1340 ms/op 13.582 ms/op 0.60
phase0 getAttestationDeltas - 250000 worstcase 8.6994 ms/op 13.995 ms/op 0.62
phase0 processSlashings - 250000 worstcase 82.798 us/op 146.86 us/op 0.56
altair processSyncCommitteeUpdates - 250000 148.91 ms/op 173.10 ms/op 0.86
BeaconState.hashTreeRoot - No change 248.00 ns/op 279.00 ns/op 0.89
BeaconState.hashTreeRoot - 1 full validator 142.42 us/op 190.94 us/op 0.75
BeaconState.hashTreeRoot - 32 full validator 1.3939 ms/op 2.2831 ms/op 0.61
BeaconState.hashTreeRoot - 512 full validator 17.536 ms/op 18.867 ms/op 0.93
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 158.20 us/op 208.34 us/op 0.76
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.1650 ms/op 2.6738 ms/op 0.81
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 27.900 ms/op 33.438 ms/op 0.83
BeaconState.hashTreeRoot - 1 balances 147.84 us/op 168.11 us/op 0.88
BeaconState.hashTreeRoot - 32 balances 1.2906 ms/op 1.8072 ms/op 0.71
BeaconState.hashTreeRoot - 512 balances 14.570 ms/op 15.221 ms/op 0.96
BeaconState.hashTreeRoot - 250000 balances 202.89 ms/op 234.57 ms/op 0.86
aggregationBits - 2048 els - zipIndexesInBitList 16.213 us/op 33.804 us/op 0.48
byteArrayEquals 32 72.316 ns/op 82.578 ns/op 0.88
Buffer.compare 32 53.724 ns/op 60.676 ns/op 0.89
byteArrayEquals 1024 2.0159 us/op 2.4503 us/op 0.82
Buffer.compare 1024 68.913 ns/op 74.599 ns/op 0.92
byteArrayEquals 16384 31.042 us/op 35.821 us/op 0.87
Buffer.compare 16384 267.01 ns/op 321.46 ns/op 0.83
byteArrayEquals 123687377 241.69 ms/op 273.30 ms/op 0.88
Buffer.compare 123687377 6.0555 ms/op 10.545 ms/op 0.57
byteArrayEquals 32 - diff last byte 68.218 ns/op 80.863 ns/op 0.84
Buffer.compare 32 - diff last byte 53.121 ns/op 60.521 ns/op 0.88
byteArrayEquals 1024 - diff last byte 1.9381 us/op 2.1861 us/op 0.89
Buffer.compare 1024 - diff last byte 67.237 ns/op 76.955 ns/op 0.87
byteArrayEquals 16384 - diff last byte 30.885 us/op 34.880 us/op 0.89
Buffer.compare 16384 - diff last byte 233.73 ns/op 272.57 ns/op 0.86
byteArrayEquals 123687377 - diff last byte 235.26 ms/op 245.92 ms/op 0.96
Buffer.compare 123687377 - diff last byte 6.2927 ms/op 7.7457 ms/op 0.81
byteArrayEquals 32 - random bytes 5.1740 ns/op 5.6620 ns/op 0.91
Buffer.compare 32 - random bytes 59.102 ns/op 62.226 ns/op 0.95
byteArrayEquals 1024 - random bytes 5.0970 ns/op 5.6210 ns/op 0.91
Buffer.compare 1024 - random bytes 58.673 ns/op 62.140 ns/op 0.94
byteArrayEquals 16384 - random bytes 5.0950 ns/op 6.0590 ns/op 0.84
Buffer.compare 16384 - random bytes 58.597 ns/op 61.369 ns/op 0.95
byteArrayEquals 123687377 - random bytes 8.5100 ns/op 8.6800 ns/op 0.98
Buffer.compare 123687377 - random bytes 66.320 ns/op 65.560 ns/op 1.01
regular array get 100000 times 43.105 us/op 43.879 us/op 0.98
wrappedArray get 100000 times 43.196 us/op 44.399 us/op 0.97
arrayWithProxy get 100000 times 14.490 ms/op 14.594 ms/op 0.99
ssz.Root.equals 52.250 ns/op 54.507 ns/op 0.96
byteArrayEquals 51.350 ns/op 56.398 ns/op 0.91
Buffer.compare 10.506 ns/op 11.776 ns/op 0.89
shuffle list - 16384 els 6.7653 ms/op 7.0236 ms/op 0.96
shuffle list - 250000 els 99.179 ms/op 102.24 ms/op 0.97
processSlot - 1 slots 18.975 us/op 18.204 us/op 1.04
processSlot - 32 slots 3.3464 ms/op 3.6405 ms/op 0.92
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 60.954 ms/op 61.569 ms/op 0.99
getCommitteeAssignments - req 1 vs - 250000 vc 2.5953 ms/op 2.5383 ms/op 1.02
getCommitteeAssignments - req 100 vs - 250000 vc 3.6215 ms/op 3.7439 ms/op 0.97
getCommitteeAssignments - req 1000 vs - 250000 vc 3.9778 ms/op 4.2035 ms/op 0.95
findModifiedValidators - 10000 modified validators 510.73 ms/op 558.87 ms/op 0.91
findModifiedValidators - 1000 modified validators 429.33 ms/op 442.18 ms/op 0.97
findModifiedValidators - 100 modified validators 385.11 ms/op 437.03 ms/op 0.88
findModifiedValidators - 10 modified validators 374.64 ms/op 433.03 ms/op 0.87
findModifiedValidators - 1 modified validators 409.03 ms/op 412.20 ms/op 0.99
findModifiedValidators - no difference 392.49 ms/op 415.23 ms/op 0.95
compare ViewDUs 4.2892 s/op 4.6325 s/op 0.93
compare each validator Uint8Array 1.5552 s/op 1.4017 s/op 1.11
compare ViewDU to Uint8Array 1.0869 s/op 1.2983 s/op 0.84
migrate state 1000000 validators, 24 modified, 0 new 786.40 ms/op 833.19 ms/op 0.94
migrate state 1000000 validators, 1700 modified, 1000 new 1.0700 s/op 1.1048 s/op 0.97
migrate state 1000000 validators, 3400 modified, 2000 new 1.3208 s/op 1.3241 s/op 1.00
migrate state 1500000 validators, 24 modified, 0 new 781.40 ms/op 777.39 ms/op 1.01
migrate state 1500000 validators, 1700 modified, 1000 new 1.0906 s/op 1.1451 s/op 0.95
migrate state 1500000 validators, 3400 modified, 2000 new 1.3173 s/op 1.4565 s/op 0.90
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.0400 ns/op 4.6000 ns/op 0.88
state getBlockRootAtSlot - 250000 vs - 7PWei 731.23 ns/op 692.98 ns/op 1.06
computeProposers - vc 250000 8.5839 ms/op 10.524 ms/op 0.82
computeEpochShuffling - vc 250000 96.862 ms/op 106.90 ms/op 0.91
getNextSyncCommittee - vc 250000 151.53 ms/op 173.29 ms/op 0.87
computeSigningRoot for AttestationData 30.858 us/op 28.650 us/op 1.08
hash AttestationData serialized data then Buffer.toString(base64) 2.2502 us/op 2.3570 us/op 0.95
toHexString serialized data 1.0345 us/op 1.1994 us/op 0.86
Buffer.toString(base64) 213.55 ns/op 238.04 ns/op 0.90

by benchmarkbot/action

@twoeths twoeths merged commit 1a63b07 into unstable Dec 9, 2023
14 of 15 checks passed
@twoeths twoeths deleted the tuyen/clone_attestations_for_block branch December 9, 2023 08:49
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.12.1 🎉

@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
Development

Successfully merging this pull request may close these issues.

4 participants