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: update correlation penalty computation #7071

Draft
wants to merge 6 commits into
base: unstable
Choose a base branch
from

Conversation

ensi321
Copy link
Contributor

@ensi321 ensi321 commented Sep 6, 2024

ethereum/consensus-specs#3882 proposes to reformat slashing penalty calculation due to overflow issue.

Lodestar does not have such issue as we've already been tracking everything in increments.

This PR restyle the calculation to be more in line with the spec.

Although spec change supposedly will be live for devnet-4, we can make the code change now for devnet-3 since no functional difference.

@ensi321 ensi321 requested a review from a team as a code owner September 6, 2024 22:20
Copy link

codecov bot commented Sep 6, 2024

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Project coverage is 50.89%. Comparing base (bb40ef7) to head (224dbd5).

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #7071      +/-   ##
============================================
- Coverage     50.89%   50.89%   -0.01%     
============================================
  Files           595      595              
  Lines         39652    39657       +5     
  Branches       2258     2060     -198     
============================================
  Hits          20182    20182              
- Misses        19470    19475       +5     

Copy link
Contributor

github-actions bot commented Sep 6, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: e0e36c3 Previous: bb40ef7 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.8212 ms/op 1.9819 ms/op 0.92
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 38.201 us/op 48.475 us/op 0.79
BLS verify - blst 800.60 us/op 1.0266 ms/op 0.78
BLS verifyMultipleSignatures 3 - blst 1.2704 ms/op 1.3525 ms/op 0.94
BLS verifyMultipleSignatures 8 - blst 2.2243 ms/op 2.1102 ms/op 1.05
BLS verifyMultipleSignatures 32 - blst 4.5476 ms/op 6.6228 ms/op 0.69
BLS verifyMultipleSignatures 64 - blst 8.3260 ms/op 10.977 ms/op 0.76
BLS verifyMultipleSignatures 128 - blst 15.980 ms/op 17.663 ms/op 0.90
BLS deserializing 10000 signatures 624.60 ms/op 682.25 ms/op 0.92
BLS deserializing 100000 signatures 6.2471 s/op 6.9150 s/op 0.90
BLS verifyMultipleSignatures - same message - 3 - blst 891.23 us/op 1.0821 ms/op 0.82
BLS verifyMultipleSignatures - same message - 8 - blst 999.50 us/op 1.1089 ms/op 0.90
BLS verifyMultipleSignatures - same message - 32 - blst 1.6024 ms/op 1.8012 ms/op 0.89
BLS verifyMultipleSignatures - same message - 64 - blst 2.4817 ms/op 2.7281 ms/op 0.91
BLS verifyMultipleSignatures - same message - 128 - blst 4.0620 ms/op 4.3597 ms/op 0.93
BLS aggregatePubkeys 32 - blst 17.855 us/op 19.575 us/op 0.91
BLS aggregatePubkeys 128 - blst 63.557 us/op 70.147 us/op 0.91
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 60.412 ms/op 70.245 ms/op 0.86
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 52.780 ms/op 69.885 ms/op 0.76
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 29.339 ms/op 39.012 ms/op 0.75
getSlashingsAndExits - default max 75.940 us/op 98.465 us/op 0.77
getSlashingsAndExits - 2k 240.73 us/op 304.24 us/op 0.79
proposeBlockBody type=full, size=empty 4.6735 ms/op 6.1662 ms/op 0.76
isKnown best case - 1 super set check 480.00 ns/op 331.00 ns/op 1.45
isKnown normal case - 2 super set checks 457.00 ns/op 304.00 ns/op 1.50
isKnown worse case - 16 super set checks 460.00 ns/op 312.00 ns/op 1.47
InMemoryCheckpointStateCache - add get delete 4.0010 us/op 2.9090 us/op 1.38
updateUnfinalizedPubkeys - updating 10 pubkeys 617.72 us/op 1.5418 ms/op 0.40
updateUnfinalizedPubkeys - updating 100 pubkeys 2.5502 ms/op 4.2937 ms/op 0.59
updateUnfinalizedPubkeys - updating 1000 pubkeys 36.583 ms/op 56.575 ms/op 0.65
validate api signedAggregateAndProof - struct 1.8762 ms/op 1.6026 ms/op 1.17
validate gossip signedAggregateAndProof - struct 1.9240 ms/op 1.6909 ms/op 1.14
validate gossip attestation - vc 640000 977.86 us/op 1.0663 ms/op 0.92
batch validate gossip attestation - vc 640000 - chunk 32 116.34 us/op 149.63 us/op 0.78
batch validate gossip attestation - vc 640000 - chunk 64 104.11 us/op 131.01 us/op 0.79
batch validate gossip attestation - vc 640000 - chunk 128 95.350 us/op 125.54 us/op 0.76
batch validate gossip attestation - vc 640000 - chunk 256 93.743 us/op 124.48 us/op 0.75
pickEth1Vote - no votes 809.66 us/op 1.2091 ms/op 0.67
pickEth1Vote - max votes 5.2349 ms/op 8.8825 ms/op 0.59
pickEth1Vote - Eth1Data hashTreeRoot value x2048 14.851 ms/op 14.882 ms/op 1.00
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 19.412 ms/op 21.231 ms/op 0.91
pickEth1Vote - Eth1Data fastSerialize value x2048 375.74 us/op 579.61 us/op 0.65
pickEth1Vote - Eth1Data fastSerialize tree x2048 3.5882 ms/op 4.5053 ms/op 0.80
bytes32 toHexString 607.00 ns/op 506.00 ns/op 1.20
bytes32 Buffer.toString(hex) 438.00 ns/op 272.00 ns/op 1.61
bytes32 Buffer.toString(hex) from Uint8Array 540.00 ns/op 465.00 ns/op 1.16
bytes32 Buffer.toString(hex) + 0x 440.00 ns/op 267.00 ns/op 1.65
Object access 1 prop 0.32700 ns/op 0.15600 ns/op 2.10
Map access 1 prop 0.32300 ns/op 0.13300 ns/op 2.43
Object get x1000 5.5880 ns/op 6.2810 ns/op 0.89
Map get x1000 6.1620 ns/op 6.9350 ns/op 0.89
Object set x1000 22.771 ns/op 39.276 ns/op 0.58
Map set x1000 19.834 ns/op 26.151 ns/op 0.76
Return object 10000 times 0.29900 ns/op 0.33060 ns/op 0.90
Throw Error 10000 times 2.7449 us/op 3.8156 us/op 0.72
toHex 112.31 ns/op 162.48 ns/op 0.69
Buffer.from 104.69 ns/op 148.25 ns/op 0.71
shared Buffer 71.288 ns/op 106.21 ns/op 0.67
fastMsgIdFn sha256 / 200 bytes 2.0120 us/op 2.4600 us/op 0.82
fastMsgIdFn h32 xxhash / 200 bytes 408.00 ns/op 288.00 ns/op 1.42
fastMsgIdFn h64 xxhash / 200 bytes 452.00 ns/op 295.00 ns/op 1.53
fastMsgIdFn sha256 / 1000 bytes 6.1090 us/op 7.5690 us/op 0.81
fastMsgIdFn h32 xxhash / 1000 bytes 531.00 ns/op 419.00 ns/op 1.27
fastMsgIdFn h64 xxhash / 1000 bytes 522.00 ns/op 377.00 ns/op 1.38
fastMsgIdFn sha256 / 10000 bytes 51.000 us/op 68.718 us/op 0.74
fastMsgIdFn h32 xxhash / 10000 bytes 1.9070 us/op 1.9820 us/op 0.96
fastMsgIdFn h64 xxhash / 10000 bytes 1.3420 us/op 1.3070 us/op 1.03
send data - 1000 256B messages 9.7081 ms/op 14.693 ms/op 0.66
send data - 1000 512B messages 13.112 ms/op 20.004 ms/op 0.66
send data - 1000 1024B messages 20.981 ms/op 31.382 ms/op 0.67
send data - 1000 1200B messages 23.663 ms/op 33.126 ms/op 0.71
send data - 1000 2048B messages 28.620 ms/op 39.297 ms/op 0.73
send data - 1000 4096B messages 25.190 ms/op 37.175 ms/op 0.68
send data - 1000 16384B messages 65.398 ms/op 77.705 ms/op 0.84
send data - 1000 65536B messages 239.17 ms/op 245.52 ms/op 0.97
enrSubnets - fastDeserialize 64 bits 1.1280 us/op 1.2950 us/op 0.87
enrSubnets - ssz BitVector 64 bits 508.00 ns/op 468.00 ns/op 1.09
enrSubnets - fastDeserialize 4 bits 338.00 ns/op 211.00 ns/op 1.60
enrSubnets - ssz BitVector 4 bits 513.00 ns/op 473.00 ns/op 1.08
prioritizePeers score -10:0 att 32-0.1 sync 2-0 129.68 us/op 186.81 us/op 0.69
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 147.27 us/op 188.93 us/op 0.78
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 309.93 us/op 457.17 us/op 0.68
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 501.13 us/op 546.38 us/op 0.92
prioritizePeers score 0:0 att 64-1 sync 4-1 688.77 us/op 1.0111 ms/op 0.68
array of 16000 items push then shift 1.3044 us/op 1.9126 us/op 0.68
LinkedList of 16000 items push then shift 6.4340 ns/op 10.118 ns/op 0.64
array of 16000 items push then pop 77.116 ns/op 167.66 ns/op 0.46
LinkedList of 16000 items push then pop 6.2690 ns/op 9.7150 ns/op 0.65
array of 24000 items push then shift 1.9065 us/op 2.9853 us/op 0.64
LinkedList of 24000 items push then shift 6.3480 ns/op 9.5450 ns/op 0.67
array of 24000 items push then pop 107.67 ns/op 196.25 ns/op 0.55
LinkedList of 24000 items push then pop 5.9590 ns/op 8.7520 ns/op 0.68
intersect bitArray bitLen 8 5.1010 ns/op 7.7050 ns/op 0.66
intersect array and set length 8 36.105 ns/op 90.206 ns/op 0.40
intersect bitArray bitLen 128 25.190 ns/op 32.921 ns/op 0.77
intersect array and set length 128 524.16 ns/op 1.0748 us/op 0.49
bitArray.getTrueBitIndexes() bitLen 128 2.1730 us/op 3.0360 us/op 0.72
bitArray.getTrueBitIndexes() bitLen 248 3.1130 us/op 5.0690 us/op 0.61
bitArray.getTrueBitIndexes() bitLen 512 6.5020 us/op 13.678 us/op 0.48
Buffer.concat 32 items 1.0420 us/op 1.3060 us/op 0.80
Uint8Array.set 32 items 1.6980 us/op 2.5370 us/op 0.67
Buffer.copy 1.9330 us/op 3.1780 us/op 0.61
Uint8Array.set - with subarray 2.2160 us/op 3.9240 us/op 0.56
Uint8Array.set - without subarray 1.5510 us/op 1.9910 us/op 0.78
getUint32 - dataview 399.00 ns/op 343.00 ns/op 1.16
getUint32 - manual 332.00 ns/op 284.00 ns/op 1.17
Set add up to 64 items then delete first 1.7684 us/op 3.1384 us/op 0.56
OrderedSet add up to 64 items then delete first 2.7450 us/op 5.4223 us/op 0.51
Set add up to 64 items then delete last 1.9573 us/op 4.2805 us/op 0.46
OrderedSet add up to 64 items then delete last 2.9708 us/op 5.1915 us/op 0.57
Set add up to 64 items then delete middle 1.9713 us/op 3.6497 us/op 0.54
OrderedSet add up to 64 items then delete middle 4.3963 us/op 7.9798 us/op 0.55
Set add up to 128 items then delete first 3.9128 us/op 8.0303 us/op 0.49
OrderedSet add up to 128 items then delete first 6.1809 us/op 15.008 us/op 0.41
Set add up to 128 items then delete last 3.8274 us/op 7.7626 us/op 0.49
OrderedSet add up to 128 items then delete last 5.8386 us/op 11.758 us/op 0.50
Set add up to 128 items then delete middle 3.9445 us/op 7.4560 us/op 0.53
OrderedSet add up to 128 items then delete middle 11.209 us/op 19.736 us/op 0.57
Set add up to 256 items then delete first 7.7286 us/op 16.186 us/op 0.48
OrderedSet add up to 256 items then delete first 12.455 us/op 23.622 us/op 0.53
Set add up to 256 items then delete last 7.5652 us/op 14.717 us/op 0.51
OrderedSet add up to 256 items then delete last 11.982 us/op 25.876 us/op 0.46
Set add up to 256 items then delete middle 7.6268 us/op 15.320 us/op 0.50
OrderedSet add up to 256 items then delete middle 34.500 us/op 57.070 us/op 0.60
transfer serialized Status (84 B) 1.3650 us/op 1.7920 us/op 0.76
copy serialized Status (84 B) 1.2950 us/op 1.6600 us/op 0.78
transfer serialized SignedVoluntaryExit (112 B) 1.6150 us/op 1.8910 us/op 0.85
copy serialized SignedVoluntaryExit (112 B) 1.3250 us/op 1.6060 us/op 0.83
transfer serialized ProposerSlashing (416 B) 2.2690 us/op 2.9520 us/op 0.77
copy serialized ProposerSlashing (416 B) 1.9220 us/op 2.4450 us/op 0.79
transfer serialized Attestation (485 B) 2.1680 us/op 2.5250 us/op 0.86
copy serialized Attestation (485 B) 1.7090 us/op 2.3420 us/op 0.73
transfer serialized AttesterSlashing (33232 B) 1.6950 us/op 2.3800 us/op 0.71
copy serialized AttesterSlashing (33232 B) 4.4620 us/op 9.1950 us/op 0.49
transfer serialized Small SignedBeaconBlock (128000 B) 3.1510 us/op 3.5160 us/op 0.90
copy serialized Small SignedBeaconBlock (128000 B) 10.323 us/op 29.514 us/op 0.35
transfer serialized Avg SignedBeaconBlock (200000 B) 3.3640 us/op 4.1430 us/op 0.81
copy serialized Avg SignedBeaconBlock (200000 B) 14.529 us/op 42.536 us/op 0.34
transfer serialized BlobsSidecar (524380 B) 3.0010 us/op 4.6950 us/op 0.64
copy serialized BlobsSidecar (524380 B) 125.66 us/op 144.42 us/op 0.87
transfer serialized Big SignedBeaconBlock (1000000 B) 3.2030 us/op 5.6410 us/op 0.57
copy serialized Big SignedBeaconBlock (1000000 B) 224.52 us/op 267.15 us/op 0.84
pass gossip attestations to forkchoice per slot 2.4472 ms/op 3.3300 ms/op 0.73
forkChoice updateHead vc 100000 bc 64 eq 0 521.99 us/op 564.80 us/op 0.92
forkChoice updateHead vc 600000 bc 64 eq 0 2.6177 ms/op 4.2735 ms/op 0.61
forkChoice updateHead vc 1000000 bc 64 eq 0 4.3027 ms/op 6.7732 ms/op 0.64
forkChoice updateHead vc 600000 bc 320 eq 0 2.4166 ms/op 3.5246 ms/op 0.69
forkChoice updateHead vc 600000 bc 1200 eq 0 2.4414 ms/op 3.7537 ms/op 0.65
forkChoice updateHead vc 600000 bc 7200 eq 0 2.8636 ms/op 4.7980 ms/op 0.60
forkChoice updateHead vc 600000 bc 64 eq 1000 9.9101 ms/op 12.947 ms/op 0.77
forkChoice updateHead vc 600000 bc 64 eq 10000 9.7847 ms/op 12.071 ms/op 0.81
forkChoice updateHead vc 600000 bc 64 eq 300000 11.735 ms/op 17.849 ms/op 0.66
computeDeltas 500000 validators 300 proto nodes 3.1029 ms/op 5.1500 ms/op 0.60
computeDeltas 500000 validators 1200 proto nodes 3.1596 ms/op 4.7981 ms/op 0.66
computeDeltas 500000 validators 7200 proto nodes 3.0251 ms/op 4.9189 ms/op 0.61
computeDeltas 750000 validators 300 proto nodes 4.5228 ms/op 7.3694 ms/op 0.61
computeDeltas 750000 validators 1200 proto nodes 4.4797 ms/op 7.2950 ms/op 0.61
computeDeltas 750000 validators 7200 proto nodes 4.5368 ms/op 6.7431 ms/op 0.67
computeDeltas 1400000 validators 300 proto nodes 8.5828 ms/op 12.514 ms/op 0.69
computeDeltas 1400000 validators 1200 proto nodes 8.2550 ms/op 12.107 ms/op 0.68
computeDeltas 1400000 validators 7200 proto nodes 8.7359 ms/op 11.524 ms/op 0.76
computeDeltas 2100000 validators 300 proto nodes 12.825 ms/op 18.069 ms/op 0.71
computeDeltas 2100000 validators 1200 proto nodes 12.768 ms/op 17.369 ms/op 0.74
computeDeltas 2100000 validators 7200 proto nodes 12.654 ms/op 17.746 ms/op 0.71
altair processAttestation - 250000 vs - 7PWei normalcase 1.4199 ms/op 2.2313 ms/op 0.64
altair processAttestation - 250000 vs - 7PWei worstcase 2.1165 ms/op 3.0812 ms/op 0.69
altair processAttestation - setStatus - 1/6 committees join 70.787 us/op 104.67 us/op 0.68
altair processAttestation - setStatus - 1/3 committees join 141.40 us/op 209.31 us/op 0.68
altair processAttestation - setStatus - 1/2 committees join 213.55 us/op 293.02 us/op 0.73
altair processAttestation - setStatus - 2/3 committees join 266.38 us/op 368.48 us/op 0.72
altair processAttestation - setStatus - 4/5 committees join 394.23 us/op 530.27 us/op 0.74
altair processAttestation - setStatus - 100% committees join 473.02 us/op 704.55 us/op 0.67
altair processBlock - 250000 vs - 7PWei normalcase 3.7167 ms/op 5.1921 ms/op 0.72
altair processBlock - 250000 vs - 7PWei normalcase hashState 26.458 ms/op 30.098 ms/op 0.88
altair processBlock - 250000 vs - 7PWei worstcase 35.738 ms/op 42.046 ms/op 0.85
altair processBlock - 250000 vs - 7PWei worstcase hashState 69.973 ms/op 92.813 ms/op 0.75
phase0 processBlock - 250000 vs - 7PWei normalcase 2.1842 ms/op 2.6002 ms/op 0.84
phase0 processBlock - 250000 vs - 7PWei worstcase 23.797 ms/op 27.396 ms/op 0.87
altair processEth1Data - 250000 vs - 7PWei normalcase 246.90 us/op 380.53 us/op 0.65
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 4.4980 us/op 7.5610 us/op 0.59
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 30.556 us/op 40.297 us/op 0.76
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 8.5600 us/op 12.957 us/op 0.66
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 10.691 us/op 8.3260 us/op 1.28
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 127.52 us/op 139.59 us/op 0.91
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 915.97 us/op 1.6916 ms/op 0.54
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.1447 ms/op 2.8928 ms/op 0.40
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.1479 ms/op 1.6729 ms/op 0.69
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.9369 ms/op 3.6708 ms/op 0.80
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.2046 ms/op 2.3037 ms/op 0.52
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.0250 ms/op 3.8951 ms/op 0.78
Tree 40 250000 create 179.49 ms/op 234.63 ms/op 0.77
Tree 40 250000 get(125000) 114.20 ns/op 167.57 ns/op 0.68
Tree 40 250000 set(125000) 499.17 ns/op 799.54 ns/op 0.62
Tree 40 250000 toArray() 10.017 ms/op 20.598 ms/op 0.49
Tree 40 250000 iterate all - toArray() + loop 10.077 ms/op 22.045 ms/op 0.46
Tree 40 250000 iterate all - get(i) 42.155 ms/op 67.872 ms/op 0.62
Array 250000 create 2.3096 ms/op 3.9375 ms/op 0.59
Array 250000 clone - spread 1.1030 ms/op 1.6473 ms/op 0.67
Array 250000 get(125000) 0.58800 ns/op 0.44100 ns/op 1.33
Array 250000 set(125000) 0.59900 ns/op 0.46200 ns/op 1.30
Array 250000 iterate all - loop 77.800 us/op 104.11 us/op 0.75
phase0 afterProcessEpoch - 250000 vs - 7PWei 75.839 ms/op 99.668 ms/op 0.76
Array.fill - length 1000000 2.4003 ms/op 5.1340 ms/op 0.47
Array push - length 1000000 18.344 ms/op 19.208 ms/op 0.96
Array.get 0.26403 ns/op 0.32048 ns/op 0.82
Uint8Array.get 0.34634 ns/op 0.47165 ns/op 0.73
phase0 beforeProcessEpoch - 250000 vs - 7PWei 13.561 ms/op 19.317 ms/op 0.70
altair processEpoch - mainnet_e81889 299.57 ms/op 344.36 ms/op 0.87
mainnet_e81889 - altair beforeProcessEpoch 18.226 ms/op 20.025 ms/op 0.91
mainnet_e81889 - altair processJustificationAndFinalization 9.3130 us/op 17.193 us/op 0.54
mainnet_e81889 - altair processInactivityUpdates 4.8351 ms/op 5.7576 ms/op 0.84
mainnet_e81889 - altair processRewardsAndPenalties 55.898 ms/op 55.128 ms/op 1.01
mainnet_e81889 - altair processRegistryUpdates 1.7370 us/op 3.7270 us/op 0.47
mainnet_e81889 - altair processSlashings 713.00 ns/op 591.00 ns/op 1.21
mainnet_e81889 - altair processEth1DataReset 715.00 ns/op 333.00 ns/op 2.15
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.6970 ms/op 1.9343 ms/op 0.88
mainnet_e81889 - altair processSlashingsReset 2.3530 us/op 5.0700 us/op 0.46
mainnet_e81889 - altair processRandaoMixesReset 2.7280 us/op 7.3920 us/op 0.37
mainnet_e81889 - altair processHistoricalRootsUpdate 711.00 ns/op 793.00 ns/op 0.90
mainnet_e81889 - altair processParticipationFlagUpdates 1.4930 us/op 1.9700 us/op 0.76
mainnet_e81889 - altair processSyncCommitteeUpdates 1.4370 us/op 693.00 ns/op 2.07
mainnet_e81889 - altair afterProcessEpoch 77.446 ms/op 101.90 ms/op 0.76
capella processEpoch - mainnet_e217614 1.0433 s/op 1.2677 s/op 0.82
mainnet_e217614 - capella beforeProcessEpoch 68.181 ms/op 69.011 ms/op 0.99
mainnet_e217614 - capella processJustificationAndFinalization 12.521 us/op 22.114 us/op 0.57
mainnet_e217614 - capella processInactivityUpdates 13.805 ms/op 19.118 ms/op 0.72
mainnet_e217614 - capella processRewardsAndPenalties 232.22 ms/op 269.55 ms/op 0.86
mainnet_e217614 - capella processRegistryUpdates 10.532 us/op 16.006 us/op 0.66
mainnet_e217614 - capella processSlashings 866.00 ns/op 416.00 ns/op 2.08
mainnet_e217614 - capella processEth1DataReset 655.00 ns/op 318.00 ns/op 2.06
mainnet_e217614 - capella processEffectiveBalanceUpdates 5.8043 ms/op 13.756 ms/op 0.42
mainnet_e217614 - capella processSlashingsReset 2.5900 us/op 3.1480 us/op 0.82
mainnet_e217614 - capella processRandaoMixesReset 4.1130 us/op 7.0780 us/op 0.58
mainnet_e217614 - capella processHistoricalRootsUpdate 695.00 ns/op 507.00 ns/op 1.37
mainnet_e217614 - capella processParticipationFlagUpdates 1.2120 us/op 1.8200 us/op 0.67
mainnet_e217614 - capella afterProcessEpoch 199.75 ms/op 247.11 ms/op 0.81
phase0 processEpoch - mainnet_e58758 381.32 ms/op 460.89 ms/op 0.83
mainnet_e58758 - phase0 beforeProcessEpoch 80.331 ms/op 98.938 ms/op 0.81
mainnet_e58758 - phase0 processJustificationAndFinalization 13.839 us/op 20.880 us/op 0.66
mainnet_e58758 - phase0 processRewardsAndPenalties 24.886 ms/op 33.745 ms/op 0.74
mainnet_e58758 - phase0 processRegistryUpdates 5.4300 us/op 7.8900 us/op 0.69
mainnet_e58758 - phase0 processSlashings 658.00 ns/op 425.00 ns/op 1.55
mainnet_e58758 - phase0 processEth1DataReset 662.00 ns/op 556.00 ns/op 1.19
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 820.88 us/op 1.5574 ms/op 0.53
mainnet_e58758 - phase0 processSlashingsReset 1.5240 us/op 3.0490 us/op 0.50
mainnet_e58758 - phase0 processRandaoMixesReset 1.9840 us/op 4.9660 us/op 0.40
mainnet_e58758 - phase0 processHistoricalRootsUpdate 691.00 ns/op 693.00 ns/op 1.00
mainnet_e58758 - phase0 processParticipationRecordUpdates 2.6610 us/op 6.1460 us/op 0.43
mainnet_e58758 - phase0 afterProcessEpoch 66.954 ms/op 93.483 ms/op 0.72
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.0626 ms/op 2.3220 ms/op 0.46
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.6818 ms/op 2.7812 ms/op 0.60
altair processInactivityUpdates - 250000 normalcase 19.219 ms/op 20.484 ms/op 0.94
altair processInactivityUpdates - 250000 worstcase 16.674 ms/op 19.346 ms/op 0.86
phase0 processRegistryUpdates - 250000 normalcase 5.2280 us/op 10.546 us/op 0.50
phase0 processRegistryUpdates - 250000 badcase_full_deposits 300.87 us/op 366.53 us/op 0.82
phase0 processRegistryUpdates - 250000 worstcase 0.5 97.107 ms/op 144.62 ms/op 0.67
altair processRewardsAndPenalties - 250000 normalcase 45.783 ms/op 44.294 ms/op 1.03
altair processRewardsAndPenalties - 250000 worstcase 31.756 ms/op 46.858 ms/op 0.68
phase0 getAttestationDeltas - 250000 normalcase 5.7136 ms/op 11.960 ms/op 0.48
phase0 getAttestationDeltas - 250000 worstcase 5.6432 ms/op 12.489 ms/op 0.45
phase0 processSlashings - 250000 worstcase 52.575 us/op 110.96 us/op 0.47
altair processSyncCommitteeUpdates - 250000 102.85 ms/op 154.29 ms/op 0.67
BeaconState.hashTreeRoot - No change 498.00 ns/op 448.00 ns/op 1.11
BeaconState.hashTreeRoot - 1 full validator 99.189 us/op 135.63 us/op 0.73
BeaconState.hashTreeRoot - 32 full validator 996.13 us/op 1.2190 ms/op 0.82
BeaconState.hashTreeRoot - 512 full validator 10.277 ms/op 16.398 ms/op 0.63
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 146.45 us/op 163.47 us/op 0.90
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.9530 ms/op 3.0442 ms/op 0.64
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 26.073 ms/op 46.331 ms/op 0.56
BeaconState.hashTreeRoot - 1 balances 103.50 us/op 187.56 us/op 0.55
BeaconState.hashTreeRoot - 32 balances 1.0021 ms/op 1.4102 ms/op 0.71
BeaconState.hashTreeRoot - 512 balances 9.4857 ms/op 13.905 ms/op 0.68
BeaconState.hashTreeRoot - 250000 balances 176.00 ms/op 222.11 ms/op 0.79
aggregationBits - 2048 els - zipIndexesInBitList 20.083 us/op 36.180 us/op 0.56
byteArrayEquals 32 48.115 ns/op 62.570 ns/op 0.77
Buffer.compare 32 16.979 ns/op 19.089 ns/op 0.89
byteArrayEquals 1024 1.2624 us/op 1.7836 us/op 0.71
Buffer.compare 1024 24.481 ns/op 28.090 ns/op 0.87
byteArrayEquals 16384 20.053 us/op 27.260 us/op 0.74
Buffer.compare 16384 184.36 ns/op 220.47 ns/op 0.84
byteArrayEquals 123687377 150.98 ms/op 218.39 ms/op 0.69
Buffer.compare 123687377 4.1210 ms/op 10.260 ms/op 0.40
byteArrayEquals 32 - diff last byte 44.785 ns/op 58.625 ns/op 0.76
Buffer.compare 32 - diff last byte 15.160 ns/op 20.344 ns/op 0.75
byteArrayEquals 1024 - diff last byte 1.2073 us/op 1.7945 us/op 0.67
Buffer.compare 1024 - diff last byte 31.456 ns/op 30.815 ns/op 1.02
byteArrayEquals 16384 - diff last byte 20.157 us/op 28.208 us/op 0.71
Buffer.compare 16384 - diff last byte 187.65 ns/op 203.70 ns/op 0.92
byteArrayEquals 123687377 - diff last byte 149.88 ms/op 208.00 ms/op 0.72
Buffer.compare 123687377 - diff last byte 3.7230 ms/op 9.6462 ms/op 0.39
byteArrayEquals 32 - random bytes 4.9040 ns/op 6.3780 ns/op 0.77
Buffer.compare 32 - random bytes 16.766 ns/op 19.543 ns/op 0.86
byteArrayEquals 1024 - random bytes 4.8820 ns/op 5.5610 ns/op 0.88
Buffer.compare 1024 - random bytes 16.530 ns/op 18.745 ns/op 0.88
byteArrayEquals 16384 - random bytes 4.8820 ns/op 5.5350 ns/op 0.88
Buffer.compare 16384 - random bytes 16.573 ns/op 18.241 ns/op 0.91
byteArrayEquals 123687377 - random bytes 7.8100 ns/op 6.8700 ns/op 1.14
Buffer.compare 123687377 - random bytes 20.920 ns/op 20.230 ns/op 1.03
regular array get 100000 times 31.035 us/op 40.928 us/op 0.76
wrappedArray get 100000 times 31.022 us/op 37.994 us/op 0.82
arrayWithProxy get 100000 times 10.744 ms/op 14.464 ms/op 0.74
ssz.Root.equals 44.010 ns/op 51.942 ns/op 0.85
byteArrayEquals 41.830 ns/op 49.604 ns/op 0.84
Buffer.compare 10.133 ns/op 12.653 ns/op 0.80
shuffle list - 16384 els 5.4507 ms/op 8.2827 ms/op 0.66
shuffle list - 250000 els 80.946 ms/op 109.83 ms/op 0.74
processSlot - 1 slots 11.633 us/op 19.059 us/op 0.61
processSlot - 32 slots 3.3371 ms/op 3.5220 ms/op 0.95
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 41.176 ms/op 42.796 ms/op 0.96
getCommitteeAssignments - req 1 vs - 250000 vc 1.7821 ms/op 2.6644 ms/op 0.67
getCommitteeAssignments - req 100 vs - 250000 vc 3.5188 ms/op 5.0722 ms/op 0.69
getCommitteeAssignments - req 1000 vs - 250000 vc 3.7470 ms/op 5.3373 ms/op 0.70
findModifiedValidators - 10000 modified validators 232.70 ms/op 268.23 ms/op 0.87
findModifiedValidators - 1000 modified validators 145.28 ms/op 176.98 ms/op 0.82
findModifiedValidators - 100 modified validators 129.68 ms/op 190.44 ms/op 0.68
findModifiedValidators - 10 modified validators 139.98 ms/op 163.37 ms/op 0.86
findModifiedValidators - 1 modified validators 129.21 ms/op 177.11 ms/op 0.73
findModifiedValidators - no difference 152.87 ms/op 248.14 ms/op 0.62
compare ViewDUs 3.2353 s/op 3.4711 s/op 0.93
compare each validator Uint8Array 1.8667 s/op 1.3499 s/op 1.38
compare ViewDU to Uint8Array 659.93 ms/op 1.3222 s/op 0.50
migrate state 1000000 validators, 24 modified, 0 new 583.49 ms/op 670.74 ms/op 0.87
migrate state 1000000 validators, 1700 modified, 1000 new 821.92 ms/op 954.61 ms/op 0.86
migrate state 1000000 validators, 3400 modified, 2000 new 1.0446 s/op 1.1845 s/op 0.88
migrate state 1500000 validators, 24 modified, 0 new 589.16 ms/op 787.90 ms/op 0.75
migrate state 1500000 validators, 1700 modified, 1000 new 823.12 ms/op 1.0710 s/op 0.77
migrate state 1500000 validators, 3400 modified, 2000 new 1.0226 s/op 1.4247 s/op 0.72
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 6.0100 ns/op 6.2900 ns/op 0.96
state getBlockRootAtSlot - 250000 vs - 7PWei 887.61 ns/op 1.2018 us/op 0.74
computeProposers - vc 250000 6.6575 ms/op 11.480 ms/op 0.58
computeEpochShuffling - vc 250000 75.858 ms/op 113.61 ms/op 0.67
getNextSyncCommittee - vc 250000 103.25 ms/op 193.74 ms/op 0.53
computeSigningRoot for AttestationData 20.131 us/op 33.125 us/op 0.61
hash AttestationData serialized data then Buffer.toString(base64) 1.2093 us/op 2.3510 us/op 0.51
toHexString serialized data 707.74 ns/op 1.9590 us/op 0.36
Buffer.toString(base64) 132.50 ns/op 302.29 ns/op 0.44
nodejs block root to RootHex using toHex 102.83 ns/op 242.33 ns/op 0.42
nodejs block root to RootHex using toRootHex 66.861 ns/op 151.37 ns/op 0.44
browser block root to RootHex using the deprecated toHexString 190.59 ns/op 473.43 ns/op 0.40
browser block root to RootHex using toHex 153.05 ns/op 394.34 ns/op 0.39
browser block root to RootHex using toRootHex 135.68 ns/op 202.64 ns/op 0.67

by benchmarkbot/action

@wemeetagain
Copy link
Member

spec tests failing

@ensi321 ensi321 marked this pull request as draft September 9, 2024 22:06
@ensi321 ensi321 changed the title feat: restyle slashing penalty calculation feat: update correlation penalty computation Sep 9, 2024
@ensi321
Copy link
Contributor Author

ensi321 commented Sep 9, 2024

spec tests failing

New slashing penalty calculation preserves every digit in gwei whereas old calculation is rounded to the nearest 1ETH. So this change doesn't retrofit pre-electra forks and will need to wait for next release of spec test in order to test the correctness of this PR.

Will convert to draft for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants