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: emit slashing events #6391

Merged
merged 3 commits into from Feb 8, 2024
Merged

feat: emit slashing events #6391

merged 3 commits into from Feb 8, 2024

Conversation

jeluard
Copy link
Member

@jeluard jeluard commented Feb 5, 2024

Motivation

Add proposer_slashing and attester_slashing to SSE

Description

Make sure new events introduced by ethereum/beacon-APIs#376 are now emitted and made available via SSE.

Closes #6209

Copy link
Contributor

github-actions bot commented Feb 5, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: bcdf203 Previous: cb99fc4 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 575.15 us/op 781.72 us/op 0.74
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 82.727 us/op 81.024 us/op 1.02
BLS verify - blst-native 1.3240 ms/op 1.2785 ms/op 1.04
BLS verifyMultipleSignatures 3 - blst-native 2.7686 ms/op 2.6808 ms/op 1.03
BLS verifyMultipleSignatures 8 - blst-native 6.0547 ms/op 5.8822 ms/op 1.03
BLS verifyMultipleSignatures 32 - blst-native 22.293 ms/op 21.498 ms/op 1.04
BLS verifyMultipleSignatures 64 - blst-native 43.597 ms/op 41.692 ms/op 1.05
BLS verifyMultipleSignatures 128 - blst-native 86.470 ms/op 82.488 ms/op 1.05
BLS deserializing 10000 signatures 950.35 ms/op 903.85 ms/op 1.05
BLS deserializing 100000 signatures 9.5881 s/op 9.2095 s/op 1.04
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.3970 ms/op 1.3066 ms/op 1.07
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.5832 ms/op 1.4719 ms/op 1.08
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.4143 ms/op 2.7219 ms/op 0.89
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.6407 ms/op 4.2498 ms/op 0.86
BLS verifyMultipleSignatures - same message - 128 - blst-native 5.8631 ms/op 7.4937 ms/op 0.78
BLS aggregatePubkeys 32 - blst-native 26.780 us/op 27.126 us/op 0.99
BLS aggregatePubkeys 128 - blst-native 103.59 us/op 99.345 us/op 1.04
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 63.232 ms/op 49.096 ms/op 1.29
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 57.455 ms/op 46.645 ms/op 1.23
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 51.005 ms/op 32.538 ms/op 1.57
getSlashingsAndExits - default max 182.41 us/op 216.85 us/op 0.84
getSlashingsAndExits - 2k 399.30 us/op 376.54 us/op 1.06
proposeBlockBody type=full, size=empty 5.5558 ms/op 5.0356 ms/op 1.10
isKnown best case - 1 super set check 366.00 ns/op 296.00 ns/op 1.24
isKnown normal case - 2 super set checks 362.00 ns/op 289.00 ns/op 1.25
isKnown worse case - 16 super set checks 332.00 ns/op 285.00 ns/op 1.16
CheckpointStateCache - add get delete 5.0640 us/op 4.8990 us/op 1.03
validate api signedAggregateAndProof - struct 2.8789 ms/op 2.7149 ms/op 1.06
validate gossip signedAggregateAndProof - struct 2.8819 ms/op 2.7206 ms/op 1.06
validate gossip attestation - vc 640000 1.3867 ms/op 1.3251 ms/op 1.05
batch validate gossip attestation - vc 640000 - chunk 32 164.96 us/op 157.06 us/op 1.05
batch validate gossip attestation - vc 640000 - chunk 64 153.76 us/op 139.37 us/op 1.10
batch validate gossip attestation - vc 640000 - chunk 128 151.66 us/op 134.26 us/op 1.13
batch validate gossip attestation - vc 640000 - chunk 256 134.85 us/op 133.63 us/op 1.01
pickEth1Vote - no votes 1.3556 ms/op 1.1459 ms/op 1.18
pickEth1Vote - max votes 9.3933 ms/op 8.9590 ms/op 1.05
pickEth1Vote - Eth1Data hashTreeRoot value x2048 18.206 ms/op 22.168 ms/op 0.82
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 24.616 ms/op 24.552 ms/op 1.00
pickEth1Vote - Eth1Data fastSerialize value x2048 704.24 us/op 587.73 us/op 1.20
pickEth1Vote - Eth1Data fastSerialize tree x2048 5.2188 ms/op 6.0949 ms/op 0.86
bytes32 toHexString 554.00 ns/op 475.00 ns/op 1.17
bytes32 Buffer.toString(hex) 306.00 ns/op 281.00 ns/op 1.09
bytes32 Buffer.toString(hex) from Uint8Array 473.00 ns/op 406.00 ns/op 1.17
bytes32 Buffer.toString(hex) + 0x 302.00 ns/op 282.00 ns/op 1.07
Object access 1 prop 0.17800 ns/op 0.16100 ns/op 1.11
Map access 1 prop 0.15500 ns/op 0.15000 ns/op 1.03
Object get x1000 7.5710 ns/op 7.0120 ns/op 1.08
Map get x1000 0.78500 ns/op 0.73300 ns/op 1.07
Object set x1000 54.434 ns/op 48.439 ns/op 1.12
Map set x1000 43.107 ns/op 41.436 ns/op 1.04
Return object 10000 times 0.25260 ns/op 0.24350 ns/op 1.04
Throw Error 10000 times 3.9707 us/op 3.8205 us/op 1.04
fastMsgIdFn sha256 / 200 bytes 3.4740 us/op 3.2960 us/op 1.05
fastMsgIdFn h32 xxhash / 200 bytes 305.00 ns/op 286.00 ns/op 1.07
fastMsgIdFn h64 xxhash / 200 bytes 363.00 ns/op 360.00 ns/op 1.01
fastMsgIdFn sha256 / 1000 bytes 11.699 us/op 11.485 us/op 1.02
fastMsgIdFn h32 xxhash / 1000 bytes 427.00 ns/op 484.00 ns/op 0.88
fastMsgIdFn h64 xxhash / 1000 bytes 443.00 ns/op 460.00 ns/op 0.96
fastMsgIdFn sha256 / 10000 bytes 106.48 us/op 105.14 us/op 1.01
fastMsgIdFn h32 xxhash / 10000 bytes 2.0410 us/op 2.0590 us/op 0.99
fastMsgIdFn h64 xxhash / 10000 bytes 1.3860 us/op 1.4340 us/op 0.97
send data - 1000 256B messages 21.427 ms/op 22.829 ms/op 0.94
send data - 1000 512B messages 31.287 ms/op 28.667 ms/op 1.09
send data - 1000 1024B messages 41.153 ms/op 40.220 ms/op 1.02
send data - 1000 1200B messages 37.382 ms/op 40.766 ms/op 0.92
send data - 1000 2048B messages 51.535 ms/op 53.480 ms/op 0.96
send data - 1000 4096B messages 44.650 ms/op 47.366 ms/op 0.94
send data - 1000 16384B messages 129.89 ms/op 116.28 ms/op 1.12
send data - 1000 65536B messages 508.73 ms/op 441.47 ms/op 1.15
enrSubnets - fastDeserialize 64 bits 1.4460 us/op 1.2340 us/op 1.17
enrSubnets - ssz BitVector 64 bits 498.00 ns/op 404.00 ns/op 1.23
enrSubnets - fastDeserialize 4 bits 203.00 ns/op 170.00 ns/op 1.19
enrSubnets - ssz BitVector 4 bits 518.00 ns/op 414.00 ns/op 1.25
prioritizePeers score -10:0 att 32-0.1 sync 2-0 125.81 us/op 96.828 us/op 1.30
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 153.31 us/op 128.86 us/op 1.19
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 196.25 us/op 159.72 us/op 1.23
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 341.89 us/op 288.64 us/op 1.18
prioritizePeers score 0:0 att 64-1 sync 4-1 361.52 us/op 335.02 us/op 1.08
array of 16000 items push then shift 1.7375 us/op 1.6016 us/op 1.08
LinkedList of 16000 items push then shift 9.2590 ns/op 8.7500 ns/op 1.06
array of 16000 items push then pop 104.68 ns/op 95.453 ns/op 1.10
LinkedList of 16000 items push then pop 9.1100 ns/op 8.5970 ns/op 1.06
array of 24000 items push then shift 2.6109 us/op 2.5319 us/op 1.03
LinkedList of 24000 items push then shift 9.4000 ns/op 8.8390 ns/op 1.06
array of 24000 items push then pop 128.43 ns/op 113.85 ns/op 1.13
LinkedList of 24000 items push then pop 8.9790 ns/op 8.6660 ns/op 1.04
intersect bitArray bitLen 8 5.9570 ns/op 5.8920 ns/op 1.01
intersect array and set length 8 65.117 ns/op 67.392 ns/op 0.97
intersect bitArray bitLen 128 36.484 ns/op 34.590 ns/op 1.05
intersect array and set length 128 903.98 ns/op 836.02 ns/op 1.08
bitArray.getTrueBitIndexes() bitLen 128 1.4990 us/op 1.3860 us/op 1.08
bitArray.getTrueBitIndexes() bitLen 248 2.6030 us/op 2.3620 us/op 1.10
bitArray.getTrueBitIndexes() bitLen 512 4.9980 us/op 4.7030 us/op 1.06
Buffer.concat 32 items 975.00 ns/op 917.00 ns/op 1.06
Uint8Array.set 32 items 1.6960 us/op 1.8880 us/op 0.90
Set add up to 64 items then delete first 4.7680 us/op 4.2949 us/op 1.11
OrderedSet add up to 64 items then delete first 6.4261 us/op 5.3814 us/op 1.19
Set add up to 64 items then delete last 5.4699 us/op 5.0855 us/op 1.08
OrderedSet add up to 64 items then delete last 6.9284 us/op 6.5443 us/op 1.06
Set add up to 64 items then delete middle 5.5421 us/op 4.7267 us/op 1.17
OrderedSet add up to 64 items then delete middle 8.5650 us/op 7.4349 us/op 1.15
Set add up to 128 items then delete first 11.122 us/op 9.4403 us/op 1.18
OrderedSet add up to 128 items then delete first 15.017 us/op 12.747 us/op 1.18
Set add up to 128 items then delete last 10.813 us/op 9.9304 us/op 1.09
OrderedSet add up to 128 items then delete last 14.441 us/op 11.817 us/op 1.22
Set add up to 128 items then delete middle 10.869 us/op 9.7361 us/op 1.12
OrderedSet add up to 128 items then delete middle 20.262 us/op 17.330 us/op 1.17
Set add up to 256 items then delete first 22.235 us/op 20.382 us/op 1.09
OrderedSet add up to 256 items then delete first 30.440 us/op 25.520 us/op 1.19
Set add up to 256 items then delete last 21.416 us/op 18.147 us/op 1.18
OrderedSet add up to 256 items then delete last 29.512 us/op 23.422 us/op 1.26
Set add up to 256 items then delete middle 22.274 us/op 18.422 us/op 1.21
OrderedSet add up to 256 items then delete middle 52.475 us/op 45.030 us/op 1.17
transfer serialized Status (84 B) 1.9300 us/op 1.7060 us/op 1.13
copy serialized Status (84 B) 1.4400 us/op 1.2770 us/op 1.13
transfer serialized SignedVoluntaryExit (112 B) 2.0340 us/op 1.9130 us/op 1.06
copy serialized SignedVoluntaryExit (112 B) 1.5010 us/op 1.4600 us/op 1.03
transfer serialized ProposerSlashing (416 B) 2.3190 us/op 2.9950 us/op 0.77
copy serialized ProposerSlashing (416 B) 1.8350 us/op 2.8340 us/op 0.65
transfer serialized Attestation (485 B) 2.2290 us/op 3.2850 us/op 0.68
copy serialized Attestation (485 B) 1.9350 us/op 2.8780 us/op 0.67
transfer serialized AttesterSlashing (33232 B) 2.1440 us/op 3.2000 us/op 0.67
copy serialized AttesterSlashing (33232 B) 6.1550 us/op 7.1850 us/op 0.86
transfer serialized Small SignedBeaconBlock (128000 B) 2.5210 us/op 3.8180 us/op 0.66
copy serialized Small SignedBeaconBlock (128000 B) 16.539 us/op 15.861 us/op 1.04
transfer serialized Avg SignedBeaconBlock (200000 B) 3.0460 us/op 3.9360 us/op 0.77
copy serialized Avg SignedBeaconBlock (200000 B) 24.659 us/op 24.257 us/op 1.02
transfer serialized BlobsSidecar (524380 B) 3.0920 us/op 3.8080 us/op 0.81
copy serialized BlobsSidecar (524380 B) 106.31 us/op 110.01 us/op 0.97
transfer serialized Big SignedBeaconBlock (1000000 B) 3.3150 us/op 3.8330 us/op 0.86
copy serialized Big SignedBeaconBlock (1000000 B) 172.25 us/op 158.52 us/op 1.09
pass gossip attestations to forkchoice per slot 4.5226 ms/op 4.2971 ms/op 1.05
forkChoice updateHead vc 100000 bc 64 eq 0 703.52 us/op 703.47 us/op 1.00
forkChoice updateHead vc 600000 bc 64 eq 0 4.3604 ms/op 4.1302 ms/op 1.06
forkChoice updateHead vc 1000000 bc 64 eq 0 7.4135 ms/op 6.8351 ms/op 1.08
forkChoice updateHead vc 600000 bc 320 eq 0 4.5098 ms/op 4.0866 ms/op 1.10
forkChoice updateHead vc 600000 bc 1200 eq 0 4.6503 ms/op 4.2527 ms/op 1.09
forkChoice updateHead vc 600000 bc 7200 eq 0 5.7100 ms/op 5.1423 ms/op 1.11
forkChoice updateHead vc 600000 bc 64 eq 1000 12.037 ms/op 10.954 ms/op 1.10
forkChoice updateHead vc 600000 bc 64 eq 10000 12.790 ms/op 11.642 ms/op 1.10
forkChoice updateHead vc 600000 bc 64 eq 300000 17.369 ms/op 15.818 ms/op 1.10
computeDeltas 500000 validators 300 proto nodes 6.8428 ms/op 6.4010 ms/op 1.07
computeDeltas 500000 validators 1200 proto nodes 6.6339 ms/op 6.6543 ms/op 1.00
computeDeltas 500000 validators 7200 proto nodes 6.8695 ms/op 6.5841 ms/op 1.04
computeDeltas 750000 validators 300 proto nodes 10.884 ms/op 10.381 ms/op 1.05
computeDeltas 750000 validators 1200 proto nodes 10.647 ms/op 11.263 ms/op 0.95
computeDeltas 750000 validators 7200 proto nodes 11.236 ms/op 10.876 ms/op 1.03
computeDeltas 1400000 validators 300 proto nodes 22.042 ms/op 21.317 ms/op 1.03
computeDeltas 1400000 validators 1200 proto nodes 21.889 ms/op 20.108 ms/op 1.09
computeDeltas 1400000 validators 7200 proto nodes 20.622 ms/op 20.248 ms/op 1.02
computeDeltas 2100000 validators 300 proto nodes 31.349 ms/op 29.790 ms/op 1.05
computeDeltas 2100000 validators 1200 proto nodes 31.593 ms/op 30.143 ms/op 1.05
computeDeltas 2100000 validators 7200 proto nodes 31.401 ms/op 29.880 ms/op 1.05
altair processAttestation - 250000 vs - 7PWei normalcase 4.0625 ms/op 3.1623 ms/op 1.28
altair processAttestation - 250000 vs - 7PWei worstcase 5.2171 ms/op 4.6440 ms/op 1.12
altair processAttestation - setStatus - 1/6 committees join 191.93 us/op 203.37 us/op 0.94
altair processAttestation - setStatus - 1/3 committees join 385.31 us/op 382.98 us/op 1.01
altair processAttestation - setStatus - 1/2 committees join 433.52 us/op 516.15 us/op 0.84
altair processAttestation - setStatus - 2/3 committees join 544.83 us/op 636.69 us/op 0.86
altair processAttestation - setStatus - 4/5 committees join 925.60 us/op 959.94 us/op 0.96
altair processAttestation - setStatus - 100% committees join 1.0892 ms/op 1.1557 ms/op 0.94
altair processBlock - 250000 vs - 7PWei normalcase 13.420 ms/op 13.730 ms/op 0.98
altair processBlock - 250000 vs - 7PWei normalcase hashState 50.348 ms/op 42.443 ms/op 1.19
altair processBlock - 250000 vs - 7PWei worstcase 44.853 ms/op 41.982 ms/op 1.07
altair processBlock - 250000 vs - 7PWei worstcase hashState 110.46 ms/op 104.01 ms/op 1.06
phase0 processBlock - 250000 vs - 7PWei normalcase 4.0113 ms/op 3.0790 ms/op 1.30
phase0 processBlock - 250000 vs - 7PWei worstcase 36.725 ms/op 33.161 ms/op 1.11
altair processEth1Data - 250000 vs - 7PWei normalcase 969.52 us/op 735.01 us/op 1.32
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 25.114 us/op 21.139 us/op 1.19
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 103.74 us/op 73.998 us/op 1.40
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 30.518 us/op 23.975 us/op 1.27
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 19.073 us/op 12.388 us/op 1.54
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 272.25 us/op 238.39 us/op 1.14
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 2.2138 ms/op 2.0913 ms/op 1.06
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.2024 ms/op 2.4322 ms/op 0.91
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.0636 ms/op 2.3467 ms/op 0.88
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 5.2831 ms/op 5.2909 ms/op 1.00
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 3.2529 ms/op 2.6495 ms/op 1.23
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 7.8857 ms/op 6.5981 ms/op 1.20
Tree 40 250000 create 695.95 ms/op 535.46 ms/op 1.30
Tree 40 250000 get(125000) 240.00 ns/op 228.22 ns/op 1.05
Tree 40 250000 set(125000) 2.3102 us/op 1.4383 us/op 1.61
Tree 40 250000 toArray() 28.295 ms/op 24.810 ms/op 1.14
Tree 40 250000 iterate all - toArray() + loop 27.340 ms/op 25.252 ms/op 1.08
Tree 40 250000 iterate all - get(i) 85.057 ms/op 78.896 ms/op 1.08
MutableVector 250000 create 18.900 ms/op 15.406 ms/op 1.23
MutableVector 250000 get(125000) 7.5800 ns/op 7.6170 ns/op 1.00
MutableVector 250000 set(125000) 788.62 ns/op 590.63 ns/op 1.34
MutableVector 250000 toArray() 5.4413 ms/op 4.9283 ms/op 1.10
MutableVector 250000 iterate all - toArray() + loop 5.8543 ms/op 4.7994 ms/op 1.22
MutableVector 250000 iterate all - get(i) 2.2362 ms/op 1.7937 ms/op 1.25
Array 250000 create 5.2602 ms/op 4.3540 ms/op 1.21
Array 250000 clone - spread 4.7424 ms/op 1.5474 ms/op 3.06
Array 250000 get(125000) 2.9860 ns/op 1.7390 ns/op 1.72
Array 250000 set(125000) 6.3970 ns/op 5.3690 ns/op 1.19
Array 250000 iterate all - loop 261.52 us/op 180.71 us/op 1.45
effectiveBalanceIncrements clone Uint8Array 300000 100.98 us/op 48.579 us/op 2.08
effectiveBalanceIncrements clone MutableVector 300000 2.0090 us/op 396.00 ns/op 5.07
effectiveBalanceIncrements rw all Uint8Array 300000 248.78 us/op 206.95 us/op 1.20
effectiveBalanceIncrements rw all MutableVector 300000 258.35 ms/op 103.46 ms/op 2.50
phase0 afterProcessEpoch - 250000 vs - 7PWei 154.72 ms/op 127.33 ms/op 1.22
phase0 beforeProcessEpoch - 250000 vs - 7PWei 91.323 ms/op 66.226 ms/op 1.38
altair processEpoch - mainnet_e81889 554.36 ms/op 559.10 ms/op 0.99
mainnet_e81889 - altair beforeProcessEpoch 89.492 ms/op 93.815 ms/op 0.95
mainnet_e81889 - altair processJustificationAndFinalization 15.767 us/op 17.811 us/op 0.89
mainnet_e81889 - altair processInactivityUpdates 5.9357 ms/op 6.6234 ms/op 0.90
mainnet_e81889 - altair processRewardsAndPenalties 64.656 ms/op 42.611 ms/op 1.52
mainnet_e81889 - altair processRegistryUpdates 3.2740 us/op 2.9660 us/op 1.10
mainnet_e81889 - altair processSlashings 496.00 ns/op 759.00 ns/op 0.65
mainnet_e81889 - altair processEth1DataReset 555.00 ns/op 1.8300 us/op 0.30
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.4612 ms/op 1.4639 ms/op 1.00
mainnet_e81889 - altair processSlashingsReset 3.7720 us/op 7.9900 us/op 0.47
mainnet_e81889 - altair processRandaoMixesReset 5.4070 us/op 7.9420 us/op 0.68
mainnet_e81889 - altair processHistoricalRootsUpdate 599.00 ns/op 1.5950 us/op 0.38
mainnet_e81889 - altair processParticipationFlagUpdates 2.5070 us/op 6.3540 us/op 0.39
mainnet_e81889 - altair processSyncCommitteeUpdates 665.00 ns/op 2.0070 us/op 0.33
mainnet_e81889 - altair afterProcessEpoch 126.53 ms/op 124.24 ms/op 1.02
capella processEpoch - mainnet_e217614 2.3422 s/op 2.5352 s/op 0.92
mainnet_e217614 - capella beforeProcessEpoch 500.08 ms/op 486.06 ms/op 1.03
mainnet_e217614 - capella processJustificationAndFinalization 14.753 us/op 19.133 us/op 0.77
mainnet_e217614 - capella processInactivityUpdates 20.192 ms/op 21.198 ms/op 0.95
mainnet_e217614 - capella processRewardsAndPenalties 411.31 ms/op 422.81 ms/op 0.97
mainnet_e217614 - capella processRegistryUpdates 45.203 us/op 17.112 us/op 2.64
mainnet_e217614 - capella processSlashings 781.00 ns/op 578.00 ns/op 1.35
mainnet_e217614 - capella processEth1DataReset 609.00 ns/op 452.00 ns/op 1.35
mainnet_e217614 - capella processEffectiveBalanceUpdates 6.1211 ms/op 5.6264 ms/op 1.09
mainnet_e217614 - capella processSlashingsReset 3.9980 us/op 3.6630 us/op 1.09
mainnet_e217614 - capella processRandaoMixesReset 5.6920 us/op 4.5600 us/op 1.25
mainnet_e217614 - capella processHistoricalRootsUpdate 619.00 ns/op 427.00 ns/op 1.45
mainnet_e217614 - capella processParticipationFlagUpdates 1.8550 us/op 1.4300 us/op 1.30
mainnet_e217614 - capella afterProcessEpoch 341.04 ms/op 301.82 ms/op 1.13
phase0 processEpoch - mainnet_e58758 482.41 ms/op 436.38 ms/op 1.11
mainnet_e58758 - phase0 beforeProcessEpoch 112.28 ms/op 125.38 ms/op 0.90
mainnet_e58758 - phase0 processJustificationAndFinalization 22.082 us/op 17.257 us/op 1.28
mainnet_e58758 - phase0 processRewardsAndPenalties 53.185 ms/op 37.873 ms/op 1.40
mainnet_e58758 - phase0 processRegistryUpdates 10.540 us/op 11.921 us/op 0.88
mainnet_e58758 - phase0 processSlashings 601.00 ns/op 420.00 ns/op 1.43
mainnet_e58758 - phase0 processEth1DataReset 418.00 ns/op 426.00 ns/op 0.98
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.1953 ms/op 1.1714 ms/op 1.02
mainnet_e58758 - phase0 processSlashingsReset 2.7390 us/op 3.0230 us/op 0.91
mainnet_e58758 - phase0 processRandaoMixesReset 3.8260 us/op 5.8810 us/op 0.65
mainnet_e58758 - phase0 processHistoricalRootsUpdate 389.00 ns/op 543.00 ns/op 0.72
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.7410 us/op 4.4510 us/op 0.84
mainnet_e58758 - phase0 afterProcessEpoch 100.07 ms/op 97.974 ms/op 1.02
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.4301 ms/op 1.3860 ms/op 1.03
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.6196 ms/op 1.9794 ms/op 0.82
altair processInactivityUpdates - 250000 normalcase 27.422 ms/op 23.606 ms/op 1.16
altair processInactivityUpdates - 250000 worstcase 24.372 ms/op 20.158 ms/op 1.21
phase0 processRegistryUpdates - 250000 normalcase 11.649 us/op 8.1010 us/op 1.44
phase0 processRegistryUpdates - 250000 badcase_full_deposits 437.10 us/op 410.16 us/op 1.07
phase0 processRegistryUpdates - 250000 worstcase 0.5 135.72 ms/op 125.88 ms/op 1.08
altair processRewardsAndPenalties - 250000 normalcase 54.682 ms/op 42.949 ms/op 1.27
altair processRewardsAndPenalties - 250000 worstcase 53.350 ms/op 40.880 ms/op 1.31
phase0 getAttestationDeltas - 250000 normalcase 8.9345 ms/op 8.9342 ms/op 1.00
phase0 getAttestationDeltas - 250000 worstcase 9.1999 ms/op 9.0759 ms/op 1.01
phase0 processSlashings - 250000 worstcase 91.562 us/op 82.023 us/op 1.12
altair processSyncCommitteeUpdates - 250000 153.72 ms/op 155.67 ms/op 0.99
BeaconState.hashTreeRoot - No change 355.00 ns/op 376.00 ns/op 0.94
BeaconState.hashTreeRoot - 1 full validator 140.84 us/op 122.80 us/op 1.15
BeaconState.hashTreeRoot - 32 full validator 1.6267 ms/op 1.5146 ms/op 1.07
BeaconState.hashTreeRoot - 512 full validator 16.544 ms/op 13.752 ms/op 1.20
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 168.47 us/op 145.10 us/op 1.16
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.2287 ms/op 2.1634 ms/op 1.03
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 26.708 ms/op 23.908 ms/op 1.12
BeaconState.hashTreeRoot - 1 balances 111.51 us/op 107.98 us/op 1.03
BeaconState.hashTreeRoot - 32 balances 1.0450 ms/op 1.2388 ms/op 0.84
BeaconState.hashTreeRoot - 512 balances 9.7045 ms/op 13.398 ms/op 0.72
BeaconState.hashTreeRoot - 250000 balances 176.87 ms/op 229.58 ms/op 0.77
aggregationBits - 2048 els - zipIndexesInBitList 17.509 us/op 18.553 us/op 0.94
byteArrayEquals 32 76.897 ns/op 75.711 ns/op 1.02
Buffer.compare 32 57.507 ns/op 56.832 ns/op 1.01
byteArrayEquals 1024 2.1826 us/op 2.0780 us/op 1.05
Buffer.compare 1024 71.766 ns/op 71.998 ns/op 1.00
byteArrayEquals 16384 33.478 us/op 32.686 us/op 1.02
Buffer.compare 16384 288.01 ns/op 244.73 ns/op 1.18
byteArrayEquals 123687377 252.39 ms/op 263.96 ms/op 0.96
Buffer.compare 123687377 7.3406 ms/op 8.9139 ms/op 0.82
byteArrayEquals 32 - diff last byte 78.439 ns/op 84.093 ns/op 0.93
Buffer.compare 32 - diff last byte 60.538 ns/op 58.951 ns/op 1.03
byteArrayEquals 1024 - diff last byte 2.4817 us/op 2.2338 us/op 1.11
Buffer.compare 1024 - diff last byte 74.863 ns/op 78.283 ns/op 0.96
byteArrayEquals 16384 - diff last byte 36.126 us/op 34.887 us/op 1.04
Buffer.compare 16384 - diff last byte 285.40 ns/op 301.11 ns/op 0.95
byteArrayEquals 123687377 - diff last byte 308.35 ms/op 272.26 ms/op 1.13
Buffer.compare 123687377 - diff last byte 10.796 ms/op 9.7619 ms/op 1.11
byteArrayEquals 32 - random bytes 9.1060 ns/op 6.2760 ns/op 1.45
Buffer.compare 32 - random bytes 77.068 ns/op 63.914 ns/op 1.21
byteArrayEquals 1024 - random bytes 7.1630 ns/op 7.1700 ns/op 1.00
Buffer.compare 1024 - random bytes 66.513 ns/op 63.377 ns/op 1.05
byteArrayEquals 16384 - random bytes 6.8990 ns/op 6.3050 ns/op 1.09
Buffer.compare 16384 - random bytes 65.140 ns/op 63.362 ns/op 1.03
byteArrayEquals 123687377 - random bytes 10.620 ns/op 9.2900 ns/op 1.14
Buffer.compare 123687377 - random bytes 78.560 ns/op 76.700 ns/op 1.02
regular array get 100000 times 47.890 us/op 46.504 us/op 1.03
wrappedArray get 100000 times 48.038 us/op 46.481 us/op 1.03
arrayWithProxy get 100000 times 14.940 ms/op 14.805 ms/op 1.01
ssz.Root.equals 58.272 ns/op 58.481 ns/op 1.00
byteArrayEquals 56.990 ns/op 57.281 ns/op 0.99
Buffer.compare 12.828 ns/op 12.741 ns/op 1.01
shuffle list - 16384 els 7.6836 ms/op 7.3652 ms/op 1.04
shuffle list - 250000 els 121.57 ms/op 106.96 ms/op 1.14
processSlot - 1 slots 19.466 us/op 18.632 us/op 1.04
processSlot - 32 slots 3.6040 ms/op 3.2672 ms/op 1.10
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 63.809 ms/op 61.870 ms/op 1.03
getCommitteeAssignments - req 1 vs - 250000 vc 2.8826 ms/op 2.5147 ms/op 1.15
getCommitteeAssignments - req 100 vs - 250000 vc 4.1004 ms/op 3.7257 ms/op 1.10
getCommitteeAssignments - req 1000 vs - 250000 vc 4.5951 ms/op 4.0430 ms/op 1.14
findModifiedValidators - 10000 modified validators 717.86 ms/op 531.88 ms/op 1.35
findModifiedValidators - 1000 modified validators 519.13 ms/op 467.55 ms/op 1.11
findModifiedValidators - 100 modified validators 490.54 ms/op 464.25 ms/op 1.06
findModifiedValidators - 10 modified validators 503.87 ms/op 427.86 ms/op 1.18
findModifiedValidators - 1 modified validators 446.83 ms/op 425.03 ms/op 1.05
findModifiedValidators - no difference 421.10 ms/op 420.26 ms/op 1.00
compare ViewDUs 4.7619 s/op 4.8502 s/op 0.98
compare each validator Uint8Array 1.4675 s/op 2.0767 s/op 0.71
compare ViewDU to Uint8Array 1.3763 s/op 1.4589 s/op 0.94
migrate state 1000000 validators, 24 modified, 0 new 808.36 ms/op 881.48 ms/op 0.92
migrate state 1000000 validators, 1700 modified, 1000 new 1.2871 s/op 1.0784 s/op 1.19
migrate state 1000000 validators, 3400 modified, 2000 new 1.6953 s/op 1.3290 s/op 1.28
migrate state 1500000 validators, 24 modified, 0 new 1.0972 s/op 770.13 ms/op 1.42
migrate state 1500000 validators, 1700 modified, 1000 new 1.3509 s/op 1.1069 s/op 1.22
migrate state 1500000 validators, 3400 modified, 2000 new 1.6035 s/op 1.2666 s/op 1.27
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.9400 ns/op 4.2500 ns/op 1.40
state getBlockRootAtSlot - 250000 vs - 7PWei 1.0566 us/op 849.71 ns/op 1.24
computeProposers - vc 250000 11.548 ms/op 8.8213 ms/op 1.31
computeEpochShuffling - vc 250000 131.53 ms/op 103.30 ms/op 1.27
getNextSyncCommittee - vc 250000 187.37 ms/op 147.99 ms/op 1.27
computeSigningRoot for AttestationData 41.203 us/op 25.285 us/op 1.63
hash AttestationData serialized data then Buffer.toString(base64) 2.6832 us/op 2.3199 us/op 1.16
toHexString serialized data 1.6616 us/op 1.1311 us/op 1.47
Buffer.toString(base64) 286.94 ns/op 227.78 ns/op 1.26

by benchmarkbot/action

@jeluard jeluard force-pushed the jeluard/emit-slashing-events branch from a9df592 to b22e7ad Compare February 6, 2024 08:56
Copy link

codecov bot commented Feb 6, 2024

Codecov Report

Merging #6391 (0fc928e) into unstable (c4bf385) will increase coverage by 0.00%.
Report is 12 commits behind head on unstable.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #6391   +/-   ##
=========================================
  Coverage     60.14%   60.14%           
=========================================
  Files           407      407           
  Lines         46512    46526   +14     
  Branches       1551     1551           
=========================================
+ Hits          27975    27985   +10     
- Misses        18505    18509    +4     
  Partials         32       32           

Copy link
Member

@wemeetagain wemeetagain left a comment

Choose a reason for hiding this comment

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

this lgtm, ready for review?

packages/api/src/beacon/routes/events.ts Outdated Show resolved Hide resolved
@@ -138,6 +138,70 @@ function runTests({useWorker}: {useWorker: boolean}): void {
);
});

it("Publish and receive an attesterSlashing", async function () {
Copy link
Member

Choose a reason for hiding this comment

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

The amount of copy pasted code is quite high in this file, maybe something that could be improved in this PR (or later one) to make it easier to add new events in the future

Copy link
Member Author

Choose a reason for hiding this comment

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

I would suggest to do that in a different PR for extra clarity.

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
@jeluard jeluard marked this pull request as ready for review February 8, 2024 08:44
@jeluard jeluard requested a review from a team as a code owner February 8, 2024 08:44
@nflaig nflaig merged commit 036fb39 into unstable Feb 8, 2024
13 of 15 checks passed
@nflaig nflaig deleted the jeluard/emit-slashing-events branch February 8, 2024 16:43
@wemeetagain
Copy link
Member

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

Add proposer_slashing and attester_slashing to SSE
3 participants