Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: switch to compounding from consolidation requests #7122

Merged
merged 8 commits into from
Oct 11, 2024

Conversation

ensi321
Copy link
Contributor

@ensi321 ensi321 commented Oct 2, 2024

Spec changes

  • A consolidation request where source == target will now be considered as a "switch to compounding" request. The related validator will have its withdrawal credential switched to compounding in processConsolidationRequest
  • processConsolidationRequest will also switch the request's target validator to compounding instead of waiting until processPendingConsolidations in epoch processing.
  • Compound switching no longer applied during applyDeposit.
  • Related spec PR: eip7251: Switch to compounding when consolidating with source==target ethereum/consensus-specs#3918

Engineering changes

Copy link

codecov bot commented Oct 2, 2024

Codecov Report

Attention: Patch coverage is 3.84615% with 50 lines in your changes missing coverage. Please review.

Please upload report for BASE (nc/devnet-4@1331994). Learn more about missing BASE report.

Additional details and impacted files
@@              Coverage Diff               @@
##             nc/devnet-4    #7122   +/-   ##
==============================================
  Coverage               ?   48.97%           
==============================================
  Files                  ?      596           
  Lines                  ?    39825           
  Branches               ?     2059           
==============================================
  Hits                   ?    19504           
  Misses                 ?    20280           
  Partials               ?       41           

Copy link
Contributor

github-actions bot commented Oct 2, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: d96be18 Previous: a19655d Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.0505 ms/op 2.2748 ms/op 0.90
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 47.765 us/op 52.887 us/op 0.90
BLS verify - blst 846.55 us/op 885.81 us/op 0.96
BLS verifyMultipleSignatures 3 - blst 1.2706 ms/op 1.4859 ms/op 0.86
BLS verifyMultipleSignatures 8 - blst 2.5591 ms/op 2.2318 ms/op 1.15
BLS verifyMultipleSignatures 32 - blst 7.2736 ms/op 5.3675 ms/op 1.36
BLS verifyMultipleSignatures 64 - blst 11.043 ms/op 9.7549 ms/op 1.13
BLS verifyMultipleSignatures 128 - blst 17.383 ms/op 18.336 ms/op 0.95
BLS deserializing 10000 signatures 688.04 ms/op 642.94 ms/op 1.07
BLS deserializing 100000 signatures 6.9762 s/op 6.3988 s/op 1.09
BLS verifyMultipleSignatures - same message - 3 - blst 1.4446 ms/op 963.10 us/op 1.50
BLS verifyMultipleSignatures - same message - 8 - blst 1.0649 ms/op 1.0757 ms/op 0.99
BLS verifyMultipleSignatures - same message - 32 - blst 1.7183 ms/op 1.6893 ms/op 1.02
BLS verifyMultipleSignatures - same message - 64 - blst 2.5929 ms/op 2.6155 ms/op 0.99
BLS verifyMultipleSignatures - same message - 128 - blst 4.4050 ms/op 4.1571 ms/op 1.06
BLS aggregatePubkeys 32 - blst 19.971 us/op 18.410 us/op 1.08
BLS aggregatePubkeys 128 - blst 71.378 us/op 62.711 us/op 1.14
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 80.854 ms/op 51.423 ms/op 1.57
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 78.821 ms/op 44.541 ms/op 1.77
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 40.965 ms/op 31.810 ms/op 1.29
getSlashingsAndExits - default max 91.927 us/op 100.53 us/op 0.91
getSlashingsAndExits - 2k 362.82 us/op 337.67 us/op 1.07
proposeBlockBody type=full, size=empty 5.8278 ms/op 5.1889 ms/op 1.12
isKnown best case - 1 super set check 318.00 ns/op 674.00 ns/op 0.47
isKnown normal case - 2 super set checks 305.00 ns/op 522.00 ns/op 0.58
isKnown worse case - 16 super set checks 295.00 ns/op 472.00 ns/op 0.63
InMemoryCheckpointStateCache - add get delete 2.8390 us/op 3.2860 us/op 0.86
updateUnfinalizedPubkeys - updating 10 pubkeys 1.0035 ms/op 891.29 us/op 1.13
updateUnfinalizedPubkeys - updating 100 pubkeys 3.4927 ms/op 2.6858 ms/op 1.30
updateUnfinalizedPubkeys - updating 1000 pubkeys 50.807 ms/op 38.929 ms/op 1.31
validate api signedAggregateAndProof - struct 2.5373 ms/op 1.5936 ms/op 1.59
validate gossip signedAggregateAndProof - struct 2.5847 ms/op 1.6634 ms/op 1.55
validate gossip attestation - vc 640000 1.2980 ms/op 999.60 us/op 1.30
batch validate gossip attestation - vc 640000 - chunk 32 137.01 us/op 126.66 us/op 1.08
batch validate gossip attestation - vc 640000 - chunk 64 119.06 us/op 109.57 us/op 1.09
batch validate gossip attestation - vc 640000 - chunk 128 111.13 us/op 104.47 us/op 1.06
batch validate gossip attestation - vc 640000 - chunk 256 109.05 us/op 100.48 us/op 1.09
pickEth1Vote - no votes 1.1647 ms/op 853.80 us/op 1.36
pickEth1Vote - max votes 7.0518 ms/op 4.3216 ms/op 1.63
pickEth1Vote - Eth1Data hashTreeRoot value x2048 19.127 ms/op 9.7258 ms/op 1.97
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 21.302 ms/op 13.323 ms/op 1.60
pickEth1Vote - Eth1Data fastSerialize value x2048 509.29 us/op 372.63 us/op 1.37
pickEth1Vote - Eth1Data fastSerialize tree x2048 2.5822 ms/op 2.5148 ms/op 1.03
bytes32 toHexString 461.00 ns/op 606.00 ns/op 0.76
bytes32 Buffer.toString(hex) 275.00 ns/op 528.00 ns/op 0.52
bytes32 Buffer.toString(hex) from Uint8Array 407.00 ns/op 678.00 ns/op 0.60
bytes32 Buffer.toString(hex) + 0x 267.00 ns/op 526.00 ns/op 0.51
Object access 1 prop 0.14600 ns/op 0.35200 ns/op 0.41
Map access 1 prop 0.14500 ns/op 0.36300 ns/op 0.40
Object get x1000 6.2420 ns/op 5.2110 ns/op 1.20
Map get x1000 6.9480 ns/op 5.9630 ns/op 1.17
Object set x1000 35.974 ns/op 32.415 ns/op 1.11
Map set x1000 23.731 ns/op 25.003 ns/op 0.95
Return object 10000 times 0.30680 ns/op 0.30500 ns/op 1.01
Throw Error 10000 times 3.6757 us/op 2.7633 us/op 1.33
toHex 156.49 ns/op 135.63 ns/op 1.15
Buffer.from 144.91 ns/op 135.55 ns/op 1.07
shared Buffer 97.184 ns/op 77.960 ns/op 1.25
fastMsgIdFn sha256 / 200 bytes 2.3830 us/op 2.0710 us/op 1.15
fastMsgIdFn h32 xxhash / 200 bytes 262.00 ns/op 502.00 ns/op 0.52
fastMsgIdFn h64 xxhash / 200 bytes 289.00 ns/op 532.00 ns/op 0.54
fastMsgIdFn sha256 / 1000 bytes 8.0510 us/op 6.1690 us/op 1.31
fastMsgIdFn h32 xxhash / 1000 bytes 396.00 ns/op 616.00 ns/op 0.64
fastMsgIdFn h64 xxhash / 1000 bytes 375.00 ns/op 625.00 ns/op 0.60
fastMsgIdFn sha256 / 10000 bytes 68.780 us/op 51.291 us/op 1.34
fastMsgIdFn h32 xxhash / 10000 bytes 2.0010 us/op 2.1430 us/op 0.93
fastMsgIdFn h64 xxhash / 10000 bytes 1.2990 us/op 1.3860 us/op 0.94
send data - 1000 256B messages 14.378 ms/op 12.524 ms/op 1.15
send data - 1000 512B messages 18.268 ms/op 15.635 ms/op 1.17
send data - 1000 1024B messages 29.305 ms/op 28.965 ms/op 1.01
send data - 1000 1200B messages 26.488 ms/op 24.076 ms/op 1.10
send data - 1000 2048B messages 32.073 ms/op 32.282 ms/op 0.99
send data - 1000 4096B messages 30.610 ms/op 31.372 ms/op 0.98
send data - 1000 16384B messages 72.915 ms/op 69.688 ms/op 1.05
send data - 1000 65536B messages 219.60 ms/op 276.95 ms/op 0.79
enrSubnets - fastDeserialize 64 bits 1.1120 us/op 1.1990 us/op 0.93
enrSubnets - ssz BitVector 64 bits 366.00 ns/op 605.00 ns/op 0.60
enrSubnets - fastDeserialize 4 bits 158.00 ns/op 379.00 ns/op 0.42
enrSubnets - ssz BitVector 4 bits 366.00 ns/op 629.00 ns/op 0.58
prioritizePeers score -10:0 att 32-0.1 sync 2-0 156.06 us/op 153.21 us/op 1.02
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 169.73 us/op 161.12 us/op 1.05
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 244.25 us/op 408.18 us/op 0.60
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 435.54 us/op 443.64 us/op 0.98
prioritizePeers score 0:0 att 64-1 sync 4-1 537.97 us/op 988.13 us/op 0.54
array of 16000 items push then shift 1.7167 us/op 1.3307 us/op 1.29
LinkedList of 16000 items push then shift 7.4850 ns/op 9.2460 ns/op 0.81
array of 16000 items push then pop 110.95 ns/op 121.90 ns/op 0.91
LinkedList of 16000 items push then pop 7.4780 ns/op 7.0080 ns/op 1.07
array of 24000 items push then shift 2.5679 us/op 1.9391 us/op 1.32
LinkedList of 24000 items push then shift 7.6300 ns/op 10.170 ns/op 0.75
array of 24000 items push then pop 144.34 ns/op 167.69 ns/op 0.86
LinkedList of 24000 items push then pop 7.4910 ns/op 7.1890 ns/op 1.04
intersect bitArray bitLen 8 6.9760 ns/op 5.6120 ns/op 1.24
intersect array and set length 8 46.352 ns/op 73.345 ns/op 0.63
intersect bitArray bitLen 128 31.478 ns/op 27.733 ns/op 1.14
intersect array and set length 128 691.46 ns/op 824.76 ns/op 0.84
bitArray.getTrueBitIndexes() bitLen 128 1.4950 us/op 2.4900 us/op 0.60
bitArray.getTrueBitIndexes() bitLen 248 2.3190 us/op 3.7850 us/op 0.61
bitArray.getTrueBitIndexes() bitLen 512 4.4780 us/op 8.0080 us/op 0.56
Buffer.concat 32 items 1.0530 us/op 1.1720 us/op 0.90
Uint8Array.set 32 items 1.6590 us/op 1.6280 us/op 1.02
Buffer.copy 1.7470 us/op 1.8220 us/op 0.96
Uint8Array.set - with subarray 2.3870 us/op 2.6510 us/op 0.90
Uint8Array.set - without subarray 1.2200 us/op 1.5450 us/op 0.79
getUint32 - dataview 258.00 ns/op 511.00 ns/op 0.50
getUint32 - manual 168.00 ns/op 449.00 ns/op 0.37
Set add up to 64 items then delete first 2.2997 us/op 2.4957 us/op 0.92
OrderedSet add up to 64 items then delete first 3.6558 us/op 4.0443 us/op 0.90
Set add up to 64 items then delete last 2.6337 us/op 2.7679 us/op 0.95
OrderedSet add up to 64 items then delete last 4.0292 us/op 4.2240 us/op 0.95
Set add up to 64 items then delete middle 2.6492 us/op 2.7667 us/op 0.96
OrderedSet add up to 64 items then delete middle 5.5613 us/op 6.1340 us/op 0.91
Set add up to 128 items then delete first 5.2997 us/op 5.0127 us/op 1.06
OrderedSet add up to 128 items then delete first 7.8684 us/op 6.8193 us/op 1.15
Set add up to 128 items then delete last 5.3707 us/op 4.0044 us/op 1.34
OrderedSet add up to 128 items then delete last 8.2648 us/op 6.1076 us/op 1.35
Set add up to 128 items then delete middle 5.2186 us/op 4.0216 us/op 1.30
OrderedSet add up to 128 items then delete middle 15.130 us/op 12.137 us/op 1.25
Set add up to 256 items then delete first 11.095 us/op 8.1247 us/op 1.37
OrderedSet add up to 256 items then delete first 16.394 us/op 13.035 us/op 1.26
Set add up to 256 items then delete last 10.430 us/op 7.9097 us/op 1.32
OrderedSet add up to 256 items then delete last 17.140 us/op 12.417 us/op 1.38
Set add up to 256 items then delete middle 10.620 us/op 7.9467 us/op 1.34
OrderedSet add up to 256 items then delete middle 42.875 us/op 40.691 us/op 1.05
transfer serialized Status (84 B) 1.4060 us/op 1.6070 us/op 0.87
copy serialized Status (84 B) 1.0920 us/op 1.2740 us/op 0.86
transfer serialized SignedVoluntaryExit (112 B) 1.4820 us/op 1.7300 us/op 0.86
copy serialized SignedVoluntaryExit (112 B) 1.1680 us/op 1.5480 us/op 0.75
transfer serialized ProposerSlashing (416 B) 1.6330 us/op 2.5170 us/op 0.65
copy serialized ProposerSlashing (416 B) 1.5280 us/op 2.2500 us/op 0.68
transfer serialized Attestation (485 B) 1.6290 us/op 2.6080 us/op 0.62
copy serialized Attestation (485 B) 1.4870 us/op 2.4060 us/op 0.62
transfer serialized AttesterSlashing (33232 B) 1.7040 us/op 2.4550 us/op 0.69
copy serialized AttesterSlashing (33232 B) 4.2940 us/op 4.3060 us/op 1.00
transfer serialized Small SignedBeaconBlock (128000 B) 2.3020 us/op 2.4480 us/op 0.94
copy serialized Small SignedBeaconBlock (128000 B) 13.100 us/op 10.304 us/op 1.27
transfer serialized Avg SignedBeaconBlock (200000 B) 2.9420 us/op 2.8650 us/op 1.03
copy serialized Avg SignedBeaconBlock (200000 B) 19.407 us/op 14.347 us/op 1.35
transfer serialized BlobsSidecar (524380 B) 2.4800 us/op 3.3350 us/op 0.74
copy serialized BlobsSidecar (524380 B) 79.454 us/op 85.545 us/op 0.93
transfer serialized Big SignedBeaconBlock (1000000 B) 2.5940 us/op 3.0480 us/op 0.85
copy serialized Big SignedBeaconBlock (1000000 B) 246.50 us/op 142.06 us/op 1.74
pass gossip attestations to forkchoice per slot 2.9845 ms/op 2.4820 ms/op 1.20
forkChoice updateHead vc 100000 bc 64 eq 0 622.02 us/op 416.47 us/op 1.49
forkChoice updateHead vc 600000 bc 64 eq 0 3.7216 ms/op 2.6245 ms/op 1.42
forkChoice updateHead vc 1000000 bc 64 eq 0 5.5266 ms/op 4.2662 ms/op 1.30
forkChoice updateHead vc 600000 bc 320 eq 0 3.1640 ms/op 2.5190 ms/op 1.26
forkChoice updateHead vc 600000 bc 1200 eq 0 3.3134 ms/op 2.7063 ms/op 1.22
forkChoice updateHead vc 600000 bc 7200 eq 0 4.3776 ms/op 2.9698 ms/op 1.47
forkChoice updateHead vc 600000 bc 64 eq 1000 11.586 ms/op 9.8437 ms/op 1.18
forkChoice updateHead vc 600000 bc 64 eq 10000 11.408 ms/op 9.7544 ms/op 1.17
forkChoice updateHead vc 600000 bc 64 eq 300000 14.425 ms/op 12.028 ms/op 1.20
computeDeltas 500000 validators 300 proto nodes 3.7359 ms/op 3.1600 ms/op 1.18
computeDeltas 500000 validators 1200 proto nodes 3.6424 ms/op 3.3205 ms/op 1.10
computeDeltas 500000 validators 7200 proto nodes 3.7126 ms/op 3.1933 ms/op 1.16
computeDeltas 750000 validators 300 proto nodes 5.4644 ms/op 4.7268 ms/op 1.16
computeDeltas 750000 validators 1200 proto nodes 5.4332 ms/op 4.5860 ms/op 1.18
computeDeltas 750000 validators 7200 proto nodes 5.5862 ms/op 4.5061 ms/op 1.24
computeDeltas 1400000 validators 300 proto nodes 10.642 ms/op 8.8867 ms/op 1.20
computeDeltas 1400000 validators 1200 proto nodes 10.884 ms/op 8.6230 ms/op 1.26
computeDeltas 1400000 validators 7200 proto nodes 10.718 ms/op 8.6977 ms/op 1.23
computeDeltas 2100000 validators 300 proto nodes 17.076 ms/op 13.181 ms/op 1.30
computeDeltas 2100000 validators 1200 proto nodes 18.299 ms/op 13.106 ms/op 1.40
computeDeltas 2100000 validators 7200 proto nodes 17.633 ms/op 12.769 ms/op 1.38
altair processAttestation - 250000 vs - 7PWei normalcase 2.1746 ms/op 1.4371 ms/op 1.51
altair processAttestation - 250000 vs - 7PWei worstcase 3.9834 ms/op 2.2167 ms/op 1.80
altair processAttestation - setStatus - 1/6 committees join 103.11 us/op 71.643 us/op 1.44
altair processAttestation - setStatus - 1/3 committees join 197.33 us/op 136.66 us/op 1.44
altair processAttestation - setStatus - 1/2 committees join 277.34 us/op 195.28 us/op 1.42
altair processAttestation - setStatus - 2/3 committees join 389.61 us/op 277.19 us/op 1.41
altair processAttestation - setStatus - 4/5 committees join 548.67 us/op 397.73 us/op 1.38
altair processAttestation - setStatus - 100% committees join 719.76 us/op 479.15 us/op 1.50
altair processBlock - 250000 vs - 7PWei normalcase 5.9118 ms/op 4.4953 ms/op 1.32
altair processBlock - 250000 vs - 7PWei normalcase hashState 35.921 ms/op 26.351 ms/op 1.36
altair processBlock - 250000 vs - 7PWei worstcase 41.410 ms/op 33.544 ms/op 1.23
altair processBlock - 250000 vs - 7PWei worstcase hashState 86.855 ms/op 80.479 ms/op 1.08
phase0 processBlock - 250000 vs - 7PWei normalcase 2.5944 ms/op 2.1162 ms/op 1.23
phase0 processBlock - 250000 vs - 7PWei worstcase 27.864 ms/op 23.672 ms/op 1.18
altair processEth1Data - 250000 vs - 7PWei normalcase 555.38 us/op 260.63 us/op 2.13
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 7.9460 us/op 6.2890 us/op 1.26
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 40.926 us/op 32.082 us/op 1.28
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 12.026 us/op 10.231 us/op 1.18
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 7.3870 us/op 7.4000 us/op 1.00
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 167.69 us/op 137.36 us/op 1.22
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.5873 ms/op 1.3844 ms/op 1.15
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.0666 ms/op 1.2411 ms/op 1.67
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.1839 ms/op 1.1228 ms/op 1.94
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.7069 ms/op 3.6874 ms/op 1.28
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.2067 ms/op 1.4102 ms/op 1.56
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 5.0553 ms/op 4.8720 ms/op 1.04
Tree 40 250000 create 256.22 ms/op 248.80 ms/op 1.03
Tree 40 250000 get(125000) 167.71 ns/op 152.08 ns/op 1.10
Tree 40 250000 set(125000) 750.65 ns/op 586.01 ns/op 1.28
Tree 40 250000 toArray() 21.130 ms/op 19.436 ms/op 1.09
Tree 40 250000 iterate all - toArray() + loop 21.335 ms/op 19.877 ms/op 1.07
Tree 40 250000 iterate all - get(i) 65.376 ms/op 47.537 ms/op 1.38
Array 250000 create 3.7520 ms/op 2.4212 ms/op 1.55
Array 250000 clone - spread 1.6706 ms/op 1.2261 ms/op 1.36
Array 250000 get(125000) 0.49800 ns/op 0.61100 ns/op 0.82
Array 250000 set(125000) 0.50700 ns/op 0.65100 ns/op 0.78
Array 250000 iterate all - loop 121.93 us/op 81.760 us/op 1.49
phase0 afterProcessEpoch - 250000 vs - 7PWei 102.28 ms/op 78.812 ms/op 1.30
Array.fill - length 1000000 3.9049 ms/op 2.5566 ms/op 1.53
Array push - length 1000000 19.490 ms/op 14.649 ms/op 1.33
Array.get 0.30259 ns/op 0.28033 ns/op 1.08
Uint8Array.get 0.48202 ns/op 0.34138 ns/op 1.41
phase0 beforeProcessEpoch - 250000 vs - 7PWei 22.428 ms/op 21.930 ms/op 1.02
altair processEpoch - mainnet_e81889 366.37 ms/op 329.26 ms/op 1.11
mainnet_e81889 - altair beforeProcessEpoch 22.280 ms/op 23.558 ms/op 0.95
mainnet_e81889 - altair processJustificationAndFinalization 15.559 us/op 23.051 us/op 0.67
mainnet_e81889 - altair processInactivityUpdates 8.1286 ms/op 8.0815 ms/op 1.01
mainnet_e81889 - altair processRewardsAndPenalties 52.449 ms/op 41.822 ms/op 1.25
mainnet_e81889 - altair processRegistryUpdates 1.8120 us/op 4.0430 us/op 0.45
mainnet_e81889 - altair processSlashings 668.00 ns/op 1.2620 us/op 0.53
mainnet_e81889 - altair processEth1DataReset 488.00 ns/op 1.0080 us/op 0.48
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.0965 ms/op 2.0843 ms/op 1.01
mainnet_e81889 - altair processSlashingsReset 6.9450 us/op 4.7740 us/op 1.45
mainnet_e81889 - altair processRandaoMixesReset 4.4940 us/op 7.3380 us/op 0.61
mainnet_e81889 - altair processHistoricalRootsUpdate 597.00 ns/op 1.1350 us/op 0.53
mainnet_e81889 - altair processParticipationFlagUpdates 2.6680 us/op 4.0870 us/op 0.65
mainnet_e81889 - altair processSyncCommitteeUpdates 703.00 ns/op 1.5080 us/op 0.47
mainnet_e81889 - altair afterProcessEpoch 97.619 ms/op 91.775 ms/op 1.06
capella processEpoch - mainnet_e217614 1.2069 s/op 1.1652 s/op 1.04
mainnet_e217614 - capella beforeProcessEpoch 73.837 ms/op 71.055 ms/op 1.04
mainnet_e217614 - capella processJustificationAndFinalization 26.291 us/op 20.200 us/op 1.30
mainnet_e217614 - capella processInactivityUpdates 18.474 ms/op 17.070 ms/op 1.08
mainnet_e217614 - capella processRewardsAndPenalties 251.33 ms/op 228.96 ms/op 1.10
mainnet_e217614 - capella processRegistryUpdates 16.567 us/op 13.488 us/op 1.23
mainnet_e217614 - capella processSlashings 622.00 ns/op 814.00 ns/op 0.76
mainnet_e217614 - capella processEth1DataReset 656.00 ns/op 747.00 ns/op 0.88
mainnet_e217614 - capella processEffectiveBalanceUpdates 15.883 ms/op 7.3962 ms/op 2.15
mainnet_e217614 - capella processSlashingsReset 7.2540 us/op 2.9510 us/op 2.46
mainnet_e217614 - capella processRandaoMixesReset 8.6340 us/op 3.7880 us/op 2.28
mainnet_e217614 - capella processHistoricalRootsUpdate 1.3400 us/op 848.00 ns/op 1.58
mainnet_e217614 - capella processParticipationFlagUpdates 3.4140 us/op 6.1400 us/op 0.56
mainnet_e217614 - capella afterProcessEpoch 257.83 ms/op 205.72 ms/op 1.25
phase0 processEpoch - mainnet_e58758 401.74 ms/op 406.44 ms/op 0.99
mainnet_e58758 - phase0 beforeProcessEpoch 101.33 ms/op 73.235 ms/op 1.38
mainnet_e58758 - phase0 processJustificationAndFinalization 23.135 us/op 25.108 us/op 0.92
mainnet_e58758 - phase0 processRewardsAndPenalties 33.465 ms/op 31.960 ms/op 1.05
mainnet_e58758 - phase0 processRegistryUpdates 11.062 us/op 10.691 us/op 1.03
mainnet_e58758 - phase0 processSlashings 630.00 ns/op 1.0100 us/op 0.62
mainnet_e58758 - phase0 processEth1DataReset 1.2310 us/op 932.00 ns/op 1.32
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.0065 ms/op 1.4908 ms/op 1.35
mainnet_e58758 - phase0 processSlashingsReset 5.9490 us/op 5.4200 us/op 1.10
mainnet_e58758 - phase0 processRandaoMixesReset 9.9520 us/op 7.1290 us/op 1.40
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.1480 us/op 947.00 ns/op 1.21
mainnet_e58758 - phase0 processParticipationRecordUpdates 7.4490 us/op 5.6690 us/op 1.31
mainnet_e58758 - phase0 afterProcessEpoch 87.433 ms/op 68.726 ms/op 1.27
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.6570 ms/op 1.1064 ms/op 1.50
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 5.8681 ms/op 2.4053 ms/op 2.44
altair processInactivityUpdates - 250000 normalcase 24.383 ms/op 17.607 ms/op 1.38
altair processInactivityUpdates - 250000 worstcase 23.809 ms/op 16.984 ms/op 1.40
phase0 processRegistryUpdates - 250000 normalcase 14.059 us/op 10.554 us/op 1.33
phase0 processRegistryUpdates - 250000 badcase_full_deposits 332.96 us/op 332.93 us/op 1.00
phase0 processRegistryUpdates - 250000 worstcase 0.5 161.51 ms/op 122.12 ms/op 1.32
altair processRewardsAndPenalties - 250000 normalcase 55.767 ms/op 39.868 ms/op 1.40
altair processRewardsAndPenalties - 250000 worstcase 61.378 ms/op 45.742 ms/op 1.34
phase0 getAttestationDeltas - 250000 normalcase 12.227 ms/op 9.8151 ms/op 1.25
phase0 getAttestationDeltas - 250000 worstcase 9.4043 ms/op 6.5492 ms/op 1.44
phase0 processSlashings - 250000 worstcase 116.85 us/op 100.66 us/op 1.16
altair processSyncCommitteeUpdates - 250000 171.11 ms/op 118.00 ms/op 1.45
BeaconState.hashTreeRoot - No change 298.00 ns/op 520.00 ns/op 0.57
BeaconState.hashTreeRoot - 1 full validator 164.24 us/op 147.03 us/op 1.12
BeaconState.hashTreeRoot - 32 full validator 1.7371 ms/op 1.1281 ms/op 1.54
BeaconState.hashTreeRoot - 512 full validator 20.297 ms/op 15.177 ms/op 1.34
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 181.87 us/op 173.59 us/op 1.05
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.2748 ms/op 2.0898 ms/op 1.09
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 33.189 ms/op 34.770 ms/op 0.95
BeaconState.hashTreeRoot - 1 balances 134.06 us/op 184.25 us/op 0.73
BeaconState.hashTreeRoot - 32 balances 1.3271 ms/op 976.17 us/op 1.36
BeaconState.hashTreeRoot - 512 balances 8.0926 ms/op 9.3780 ms/op 0.86
BeaconState.hashTreeRoot - 250000 balances 186.29 ms/op 178.76 ms/op 1.04
aggregationBits - 2048 els - zipIndexesInBitList 25.790 us/op 22.843 us/op 1.13
byteArrayEquals 32 55.622 ns/op 45.292 ns/op 1.23
Buffer.compare 32 18.346 ns/op 15.267 ns/op 1.20
byteArrayEquals 1024 1.6255 us/op 1.2430 us/op 1.31
Buffer.compare 1024 26.795 ns/op 23.607 ns/op 1.14
byteArrayEquals 16384 26.181 us/op 19.514 us/op 1.34
Buffer.compare 16384 211.00 ns/op 174.79 ns/op 1.21
byteArrayEquals 123687377 204.52 ms/op 154.84 ms/op 1.32
Buffer.compare 123687377 6.7736 ms/op 8.2005 ms/op 0.83
byteArrayEquals 32 - diff last byte 56.967 ns/op 48.766 ns/op 1.17
Buffer.compare 32 - diff last byte 19.083 ns/op 16.517 ns/op 1.16
byteArrayEquals 1024 - diff last byte 1.6573 us/op 1.4060 us/op 1.18
Buffer.compare 1024 - diff last byte 28.453 ns/op 24.807 ns/op 1.15
byteArrayEquals 16384 - diff last byte 26.750 us/op 20.754 us/op 1.29
Buffer.compare 16384 - diff last byte 214.90 ns/op 200.17 ns/op 1.07
byteArrayEquals 123687377 - diff last byte 201.17 ms/op 159.15 ms/op 1.26
Buffer.compare 123687377 - diff last byte 6.6672 ms/op 7.0807 ms/op 0.94
byteArrayEquals 32 - random bytes 5.5080 ns/op 5.0000 ns/op 1.10
Buffer.compare 32 - random bytes 18.898 ns/op 15.873 ns/op 1.19
byteArrayEquals 1024 - random bytes 5.4760 ns/op 5.2330 ns/op 1.05
Buffer.compare 1024 - random bytes 18.517 ns/op 15.757 ns/op 1.18
byteArrayEquals 16384 - random bytes 5.4540 ns/op 5.0490 ns/op 1.08
Buffer.compare 16384 - random bytes 18.427 ns/op 15.831 ns/op 1.16
byteArrayEquals 123687377 - random bytes 6.6900 ns/op 8.2600 ns/op 0.81
Buffer.compare 123687377 - random bytes 19.630 ns/op 18.780 ns/op 1.05
regular array get 100000 times 36.492 us/op 31.290 us/op 1.17
wrappedArray get 100000 times 33.824 us/op 31.446 us/op 1.08
arrayWithProxy get 100000 times 15.412 ms/op 9.9351 ms/op 1.55
ssz.Root.equals 49.301 ns/op 46.209 ns/op 1.07
byteArrayEquals 47.683 ns/op 45.193 ns/op 1.06
Buffer.compare 11.136 ns/op 9.6920 ns/op 1.15
shuffle list - 16384 els 6.7847 ms/op 5.8899 ms/op 1.15
shuffle list - 250000 els 101.15 ms/op 88.429 ms/op 1.14
processSlot - 1 slots 18.723 us/op 14.721 us/op 1.27
processSlot - 32 slots 3.2456 ms/op 2.2708 ms/op 1.43
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 39.553 ms/op 37.418 ms/op 1.06
getCommitteeAssignments - req 1 vs - 250000 vc 2.2680 ms/op 1.8264 ms/op 1.24
getCommitteeAssignments - req 100 vs - 250000 vc 4.5327 ms/op 3.6356 ms/op 1.25
getCommitteeAssignments - req 1000 vs - 250000 vc 4.9004 ms/op 3.9055 ms/op 1.25
findModifiedValidators - 10000 modified validators 284.42 ms/op 246.42 ms/op 1.15
findModifiedValidators - 1000 modified validators 179.37 ms/op 171.51 ms/op 1.05
findModifiedValidators - 100 modified validators 193.57 ms/op 139.27 ms/op 1.39
findModifiedValidators - 10 modified validators 171.59 ms/op 147.87 ms/op 1.16
findModifiedValidators - 1 modified validators 180.67 ms/op 148.58 ms/op 1.22
findModifiedValidators - no difference 192.58 ms/op 138.61 ms/op 1.39
compare ViewDUs 3.4718 s/op 3.2058 s/op 1.08
compare each validator Uint8Array 1.6738 s/op 1.8981 s/op 0.88
compare ViewDU to Uint8Array 1.2949 s/op 1.0154 s/op 1.28
migrate state 1000000 validators, 24 modified, 0 new 984.38 ms/op 792.50 ms/op 1.24
migrate state 1000000 validators, 1700 modified, 1000 new 1.2537 s/op 1.0032 s/op 1.25
migrate state 1000000 validators, 3400 modified, 2000 new 1.4962 s/op 1.2823 s/op 1.17
migrate state 1500000 validators, 24 modified, 0 new 1.0467 s/op 755.77 ms/op 1.38
migrate state 1500000 validators, 1700 modified, 1000 new 1.1996 s/op 1.1561 s/op 1.04
migrate state 1500000 validators, 3400 modified, 2000 new 1.3972 s/op 1.3287 s/op 1.05
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.9600 ns/op 6.0900 ns/op 0.81
state getBlockRootAtSlot - 250000 vs - 7PWei 614.45 ns/op 387.58 ns/op 1.59
computeProposers - vc 250000 7.6196 ms/op 5.4400 ms/op 1.40
computeEpochShuffling - vc 250000 98.318 ms/op 80.781 ms/op 1.22
getNextSyncCommittee - vc 250000 141.14 ms/op 104.34 ms/op 1.35
computeSigningRoot for AttestationData 22.603 us/op 18.782 us/op 1.20
hash AttestationData serialized data then Buffer.toString(base64) 1.7449 us/op 1.1941 us/op 1.46
toHexString serialized data 942.22 ns/op 768.75 ns/op 1.23
Buffer.toString(base64) 204.69 ns/op 135.13 ns/op 1.51
nodejs block root to RootHex using toHex 172.71 ns/op 121.82 ns/op 1.42
nodejs block root to RootHex using toRootHex 105.57 ns/op 81.046 ns/op 1.30
browser block root to RootHex using the deprecated toHexString 280.61 ns/op 209.63 ns/op 1.34
browser block root to RootHex using toHex 240.66 ns/op 167.95 ns/op 1.43
browser block root to RootHex using toRootHex 183.97 ns/op 146.30 ns/op 1.26

by benchmarkbot/action

@ensi321 ensi321 changed the base branch from unstable to nc/devnet-4 October 7, 2024 16:15
@ensi321 ensi321 marked this pull request as ready for review October 7, 2024 16:17
@ensi321 ensi321 requested a review from a team as a code owner October 7, 2024 16:17
@ensi321
Copy link
Contributor Author

ensi321 commented Oct 7, 2024

Switching target branch to nc/devnet-4. Need to consolidate several PRs into the same branch in order to pass v1.5.0-alpha.7 spec test

consolidationRequest: electra.ConsolidationRequest
): boolean {
const {sourcePubkey, targetPubkey, sourceAddress} = consolidationRequest;
const sourceIndex = state.epochCtx.getValidatorIndex(sourcePubkey);
Copy link
Member

@nflaig nflaig Oct 10, 2024

Choose a reason for hiding this comment

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

we could save the index lookup if we compare the pubkeys first, not sure if it's worth though but would match more closely to the spec

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we could save the index lookup if we compare the pubkeys first, not sure if it's worth though but would match more closely to the spec

Let's do the optimization later. This part of spec is sub-optimized and will very likely to be cleaned up in alpha 9 or 10. We can optimize when the spec gets refactored.

@ensi321 ensi321 merged commit f9d9ae5 into nc/devnet-4 Oct 11, 2024
14 of 17 checks passed
@ensi321 ensi321 deleted the nc/compounding-switch branch October 11, 2024 20:41
@ensi321 ensi321 mentioned this pull request Oct 17, 2024
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