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: add kzg commitment length check when validating gossip blocks #7302

Merged
merged 4 commits into from
Dec 17, 2024

Conversation

ensi321
Copy link
Contributor

@ensi321 ensi321 commented Dec 14, 2024

We have missed a kzg commitment length check when validating incoming gossip block as laid out here in the spec.

This PR adds rejection of blocks when the number of kzg commitment is greater than MAX_BLOBS_PER_BLOCK

@ensi321 ensi321 requested a review from a team as a code owner December 14, 2024 02:16
Copy link
Contributor

github-actions bot commented Dec 14, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: d585f55 Previous: 3f3c7fc Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.1076 ms/op 1.9453 ms/op 1.08
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 63.722 us/op 48.436 us/op 1.32
BLS verify - blst 921.64 us/op 814.30 us/op 1.13
BLS verifyMultipleSignatures 3 - blst 1.4249 ms/op 1.2736 ms/op 1.12
BLS verifyMultipleSignatures 8 - blst 1.8541 ms/op 1.7629 ms/op 1.05
BLS verifyMultipleSignatures 32 - blst 5.4115 ms/op 4.9195 ms/op 1.10
BLS verifyMultipleSignatures 64 - blst 9.9258 ms/op 9.1007 ms/op 1.09
BLS verifyMultipleSignatures 128 - blst 18.647 ms/op 17.544 ms/op 1.06
BLS deserializing 10000 signatures 730.64 ms/op 684.63 ms/op 1.07
BLS deserializing 100000 signatures 6.8983 s/op 7.0176 s/op 0.98
BLS verifyMultipleSignatures - same message - 3 - blst 836.63 us/op 1.0128 ms/op 0.83
BLS verifyMultipleSignatures - same message - 8 - blst 1.0523 ms/op 1.1103 ms/op 0.95
BLS verifyMultipleSignatures - same message - 32 - blst 1.6692 ms/op 1.8408 ms/op 0.91
BLS verifyMultipleSignatures - same message - 64 - blst 2.5623 ms/op 2.7259 ms/op 0.94
BLS verifyMultipleSignatures - same message - 128 - blst 4.3144 ms/op 4.5660 ms/op 0.94
BLS aggregatePubkeys 32 - blst 19.392 us/op 20.070 us/op 0.97
BLS aggregatePubkeys 128 - blst 69.369 us/op 71.159 us/op 0.97
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 83.576 ms/op 59.515 ms/op 1.40
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 64.409 ms/op 56.642 ms/op 1.14
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 40.476 ms/op 46.439 ms/op 0.87
getSlashingsAndExits - default max 80.131 us/op 133.66 us/op 0.60
getSlashingsAndExits - 2k 277.47 us/op 302.01 us/op 0.92
proposeBlockBody type=full, size=empty 6.2575 ms/op 6.7270 ms/op 0.93
isKnown best case - 1 super set check 293.00 ns/op 446.00 ns/op 0.66
isKnown normal case - 2 super set checks 289.00 ns/op 449.00 ns/op 0.64
isKnown worse case - 16 super set checks 288.00 ns/op 400.00 ns/op 0.72
InMemoryCheckpointStateCache - add get delete 2.7930 us/op 2.9730 us/op 0.94
validate api signedAggregateAndProof - struct 1.4041 ms/op 1.6485 ms/op 0.85
validate gossip signedAggregateAndProof - struct 1.4232 ms/op 1.5351 ms/op 0.93
batch validate gossip attestation - vc 640000 - chunk 32 126.41 us/op 138.41 us/op 0.91
batch validate gossip attestation - vc 640000 - chunk 64 114.09 us/op 133.43 us/op 0.86
batch validate gossip attestation - vc 640000 - chunk 128 108.24 us/op 120.31 us/op 0.90
batch validate gossip attestation - vc 640000 - chunk 256 100.31 us/op 118.27 us/op 0.85
pickEth1Vote - no votes 1.0105 ms/op 1.2235 ms/op 0.83
pickEth1Vote - max votes 6.1826 ms/op 7.2086 ms/op 0.86
pickEth1Vote - Eth1Data hashTreeRoot value x2048 14.946 ms/op 14.186 ms/op 1.05
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 19.562 ms/op 22.031 ms/op 0.89
pickEth1Vote - Eth1Data fastSerialize value x2048 443.32 us/op 553.52 us/op 0.80
pickEth1Vote - Eth1Data fastSerialize tree x2048 3.2785 ms/op 3.0020 ms/op 1.09
bytes32 toHexString 426.00 ns/op 518.00 ns/op 0.82
bytes32 Buffer.toString(hex) 248.00 ns/op 261.00 ns/op 0.95
bytes32 Buffer.toString(hex) from Uint8Array 378.00 ns/op 450.00 ns/op 0.84
bytes32 Buffer.toString(hex) 0x 253.00 ns/op 276.00 ns/op 0.92
Object access 1 prop 0.13300 ns/op 0.17200 ns/op 0.77
Map access 1 prop 0.12200 ns/op 0.13400 ns/op 0.91
Object get x1000 5.7870 ns/op 6.5160 ns/op 0.89
Map get x1000 6.5830 ns/op 7.1800 ns/op 0.92
Object set x1000 32.921 ns/op 49.077 ns/op 0.67
Map set x1000 22.459 ns/op 37.625 ns/op 0.60
Return object 10000 times 0.29190 ns/op 0.37560 ns/op 0.78
Throw Error 10000 times 3.3694 us/op 3.9959 us/op 0.84
toHex 143.67 ns/op 186.71 ns/op 0.77
Buffer.from 134.58 ns/op 178.01 ns/op 0.76
shared Buffer 83.567 ns/op 96.558 ns/op 0.87
fastMsgIdFn sha256 / 200 bytes 2.1500 us/op 2.3740 us/op 0.91
fastMsgIdFn h32 xxhash / 200 bytes 220.00 ns/op 305.00 ns/op 0.72
fastMsgIdFn h64 xxhash / 200 bytes 266.00 ns/op 303.00 ns/op 0.88
fastMsgIdFn sha256 / 1000 bytes 7.2800 us/op 8.0330 us/op 0.91
fastMsgIdFn h32 xxhash / 1000 bytes 357.00 ns/op 464.00 ns/op 0.77
fastMsgIdFn h64 xxhash / 1000 bytes 335.00 ns/op 403.00 ns/op 0.83
fastMsgIdFn sha256 / 10000 bytes 62.628 us/op 74.899 us/op 0.84
fastMsgIdFn h32 xxhash / 10000 bytes 1.7960 us/op 2.0260 us/op 0.89
fastMsgIdFn h64 xxhash / 10000 bytes 1.1580 us/op 1.3030 us/op 0.89
send data - 1000 256B messages 12.003 ms/op 17.909 ms/op 0.67
send data - 1000 512B messages 16.176 ms/op 21.663 ms/op 0.75
send data - 1000 1024B messages 24.567 ms/op 31.067 ms/op 0.79
send data - 1000 1200B messages 19.626 ms/op 33.374 ms/op 0.59
send data - 1000 2048B messages 32.689 ms/op 37.385 ms/op 0.87
send data - 1000 4096B messages 33.738 ms/op 39.638 ms/op 0.85
send data - 1000 16384B messages 72.790 ms/op 82.459 ms/op 0.88
send data - 1000 65536B messages 215.37 ms/op 268.37 ms/op 0.80
enrSubnets - fastDeserialize 64 bits 1.1600 us/op 1.6500 us/op 0.70
enrSubnets - ssz BitVector 64 bits 382.00 ns/op 544.00 ns/op 0.70
enrSubnets - fastDeserialize 4 bits 157.00 ns/op 236.00 ns/op 0.67
enrSubnets - ssz BitVector 4 bits 371.00 ns/op 503.00 ns/op 0.74
prioritizePeers score -10:0 att 32-0.1 sync 2-0 150.24 us/op 225.29 us/op 0.67
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 163.12 us/op 207.38 us/op 0.79
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 244.27 us/op 397.31 us/op 0.61
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 433.01 us/op 474.68 us/op 0.91
prioritizePeers score 0:0 att 64-1 sync 4-1 579.27 us/op 936.33 us/op 0.62
array of 16000 items push then shift 1.6951 us/op 1.8072 us/op 0.94
LinkedList of 16000 items push then shift 7.3190 ns/op 8.9770 ns/op 0.82
array of 16000 items push then pop 123.74 ns/op 163.19 ns/op 0.76
LinkedList of 16000 items push then pop 7.2230 ns/op 9.4740 ns/op 0.76
array of 24000 items push then shift 2.4636 us/op 2.7610 us/op 0.89
LinkedList of 24000 items push then shift 7.7380 ns/op 8.4280 ns/op 0.92
array of 24000 items push then pop 158.93 ns/op 213.00 ns/op 0.75
LinkedList of 24000 items push then pop 7.2240 ns/op 8.0490 ns/op 0.90
intersect bitArray bitLen 8 6.5870 ns/op 7.0020 ns/op 0.94
intersect array and set length 8 46.522 ns/op 75.018 ns/op 0.62
intersect bitArray bitLen 128 30.533 ns/op 32.914 ns/op 0.93
intersect array and set length 128 719.27 ns/op 839.00 ns/op 0.86
bitArray.getTrueBitIndexes() bitLen 128 1.3440 us/op 2.5900 us/op 0.52
bitArray.getTrueBitIndexes() bitLen 248 2.2990 us/op 3.6620 us/op 0.63
bitArray.getTrueBitIndexes() bitLen 512 4.7800 us/op 8.2220 us/op 0.58
Buffer.concat 32 items 947.00 ns/op 1.0470 us/op 0.90
Uint8Array.set 32 items 1.4960 us/op 1.8890 us/op 0.79
Buffer.copy 2.1070 us/op 2.0750 us/op 1.02
Uint8Array.set - with subarray 4.1350 us/op 3.4460 us/op 1.20
Uint8Array.set - without subarray 2.2370 us/op 2.1170 us/op 1.06
getUint32 - dataview 300.00 ns/op 333.00 ns/op 0.90
getUint32 - manual 247.00 ns/op 289.00 ns/op 0.85
Set add up to 64 items then delete first 2.7863 us/op 2.9872 us/op 0.93
OrderedSet add up to 64 items then delete first 3.4565 us/op 4.5085 us/op 0.77
Set add up to 64 items then delete last 2.8244 us/op 3.2691 us/op 0.86
OrderedSet add up to 64 items then delete last 4.3606 us/op 4.4386 us/op 0.98
Set add up to 64 items then delete middle 2.6036 us/op 3.2224 us/op 0.81
OrderedSet add up to 64 items then delete middle 6.2945 us/op 6.5382 us/op 0.96
Set add up to 128 items then delete first 5.7365 us/op 6.9919 us/op 0.82
OrderedSet add up to 128 items then delete first 9.6074 us/op 11.031 us/op 0.87
Set add up to 128 items then delete last 5.9951 us/op 5.7623 us/op 1.04
OrderedSet add up to 128 items then delete last 8.1062 us/op 8.3002 us/op 0.98
Set add up to 128 items then delete middle 5.6557 us/op 6.8995 us/op 0.82
OrderedSet add up to 128 items then delete middle 15.693 us/op 17.840 us/op 0.88
Set add up to 256 items then delete first 11.325 us/op 14.027 us/op 0.81
OrderedSet add up to 256 items then delete first 19.672 us/op 20.150 us/op 0.98
Set add up to 256 items then delete last 11.195 us/op 13.333 us/op 0.84
OrderedSet add up to 256 items then delete last 17.054 us/op 18.946 us/op 0.90
Set add up to 256 items then delete middle 10.885 us/op 10.781 us/op 1.01
OrderedSet add up to 256 items then delete middle 46.688 us/op 46.132 us/op 1.01
transfer serialized Status (84 B) 1.5260 us/op 1.4760 us/op 1.03
copy serialized Status (84 B) 1.2980 us/op 1.2600 us/op 1.03
transfer serialized SignedVoluntaryExit (112 B) 1.5770 us/op 1.6160 us/op 0.98
copy serialized SignedVoluntaryExit (112 B) 1.3280 us/op 1.3040 us/op 1.02
transfer serialized ProposerSlashing (416 B) 1.8910 us/op 2.6250 us/op 0.72
copy serialized ProposerSlashing (416 B) 1.8650 us/op 1.8840 us/op 0.99
transfer serialized Attestation (485 B) 1.7810 us/op 2.2690 us/op 0.78
copy serialized Attestation (485 B) 2.6060 us/op 1.5390 us/op 1.69
transfer serialized AttesterSlashing (33232 B) 2.6280 us/op 1.9020 us/op 1.38
copy serialized AttesterSlashing (33232 B) 6.4150 us/op 6.7900 us/op 0.94
transfer serialized Small SignedBeaconBlock (128000 B) 3.2800 us/op 3.2390 us/op 1.01
copy serialized Small SignedBeaconBlock (128000 B) 19.976 us/op 24.086 us/op 0.83
transfer serialized Avg SignedBeaconBlock (200000 B) 3.3690 us/op 3.8490 us/op 0.88
copy serialized Avg SignedBeaconBlock (200000 B) 22.106 us/op 32.459 us/op 0.68
transfer serialized BlobsSidecar (524380 B) 3.4890 us/op 4.8510 us/op 0.72
copy serialized BlobsSidecar (524380 B) 132.70 us/op 124.48 us/op 1.07
transfer serialized Big SignedBeaconBlock (1000000 B) 3.3960 us/op 3.3070 us/op 1.03
copy serialized Big SignedBeaconBlock (1000000 B) 169.87 us/op 410.05 us/op 0.41
pass gossip attestations to forkchoice per slot 3.0305 ms/op 2.9513 ms/op 1.03
forkChoice updateHead vc 100000 bc 64 eq 0 517.53 us/op 471.08 us/op 1.10
forkChoice updateHead vc 600000 bc 64 eq 0 3.0696 ms/op 2.9839 ms/op 1.03
forkChoice updateHead vc 1000000 bc 64 eq 0 5.2894 ms/op 5.5158 ms/op 0.96
forkChoice updateHead vc 600000 bc 320 eq 0 3.3322 ms/op 3.6289 ms/op 0.92
forkChoice updateHead vc 600000 bc 1200 eq 0 3.0789 ms/op 3.2812 ms/op 0.94
forkChoice updateHead vc 600000 bc 7200 eq 0 3.4528 ms/op 3.7499 ms/op 0.92
forkChoice updateHead vc 600000 bc 64 eq 1000 10.895 ms/op 10.967 ms/op 0.99
forkChoice updateHead vc 600000 bc 64 eq 10000 10.882 ms/op 11.067 ms/op 0.98
forkChoice updateHead vc 600000 bc 64 eq 300000 15.180 ms/op 16.984 ms/op 0.89
computeDeltas 500000 validators 300 proto nodes 4.2142 ms/op 4.7920 ms/op 0.88
computeDeltas 500000 validators 1200 proto nodes 4.4966 ms/op 5.1763 ms/op 0.87
computeDeltas 500000 validators 7200 proto nodes 4.4560 ms/op 4.4971 ms/op 0.99
computeDeltas 750000 validators 300 proto nodes 6.5165 ms/op 6.3554 ms/op 1.03
computeDeltas 750000 validators 1200 proto nodes 6.4885 ms/op 6.1283 ms/op 1.06
computeDeltas 750000 validators 7200 proto nodes 6.2289 ms/op 6.1833 ms/op 1.01
computeDeltas 1400000 validators 300 proto nodes 11.430 ms/op 11.724 ms/op 0.97
computeDeltas 1400000 validators 1200 proto nodes 11.741 ms/op 11.768 ms/op 1.00
computeDeltas 1400000 validators 7200 proto nodes 11.585 ms/op 11.487 ms/op 1.01
computeDeltas 2100000 validators 300 proto nodes 17.764 ms/op 17.272 ms/op 1.03
computeDeltas 2100000 validators 1200 proto nodes 18.229 ms/op 17.206 ms/op 1.06
computeDeltas 2100000 validators 7200 proto nodes 18.778 ms/op 17.326 ms/op 1.08
altair processAttestation - 250000 vs - 7PWei normalcase 2.4052 ms/op 1.7105 ms/op 1.41
altair processAttestation - 250000 vs - 7PWei worstcase 3.2090 ms/op 2.5574 ms/op 1.25
altair processAttestation - setStatus - 1/6 committees join 103.36 us/op 86.902 us/op 1.19
altair processAttestation - setStatus - 1/3 committees join 191.15 us/op 171.61 us/op 1.11
altair processAttestation - setStatus - 1/2 committees join 284.78 us/op 238.90 us/op 1.19
altair processAttestation - setStatus - 2/3 committees join 377.45 us/op 313.54 us/op 1.20
altair processAttestation - setStatus - 4/5 committees join 501.76 us/op 450.96 us/op 1.11
altair processAttestation - setStatus - 100% committees join 614.21 us/op 551.55 us/op 1.11
altair processBlock - 250000 vs - 7PWei normalcase 5.2049 ms/op 4.9463 ms/op 1.05
altair processBlock - 250000 vs - 7PWei normalcase hashState 27.186 ms/op 25.690 ms/op 1.06
altair processBlock - 250000 vs - 7PWei worstcase 39.553 ms/op 33.415 ms/op 1.18
altair processBlock - 250000 vs - 7PWei worstcase hashState 73.809 ms/op 70.013 ms/op 1.05
phase0 processBlock - 250000 vs - 7PWei normalcase 2.2392 ms/op 1.7596 ms/op 1.27
phase0 processBlock - 250000 vs - 7PWei worstcase 24.738 ms/op 19.511 ms/op 1.27
altair processEth1Data - 250000 vs - 7PWei normalcase 373.15 us/op 307.35 us/op 1.21
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 7.6790 us/op 4.7100 us/op 1.63
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 44.863 us/op 26.489 us/op 1.68
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 11.077 us/op 8.3200 us/op 1.33
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 6.0990 us/op 5.0650 us/op 1.20
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 163.82 us/op 110.86 us/op 1.48
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.2627 ms/op 1.1054 ms/op 1.14
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.5902 ms/op 1.6203 ms/op 0.98
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.6529 ms/op 1.5141 ms/op 1.09
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.8942 ms/op 3.7018 ms/op 1.05
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.7400 ms/op 1.5888 ms/op 1.10
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.9285 ms/op 3.7072 ms/op 1.06
Tree 40 250000 create 244.73 ms/op 197.67 ms/op 1.24
Tree 40 250000 get(125000) 163.25 ns/op 141.57 ns/op 1.15
Tree 40 250000 set(125000) 813.94 ns/op 599.53 ns/op 1.36
Tree 40 250000 toArray() 19.495 ms/op 14.634 ms/op 1.33
Tree 40 250000 iterate all - toArray() loop 21.206 ms/op 14.958 ms/op 1.42
Tree 40 250000 iterate all - get(i) 60.721 ms/op 49.764 ms/op 1.22
Array 250000 create 3.7648 ms/op 2.7036 ms/op 1.39
Array 250000 clone - spread 1.6642 ms/op 1.3480 ms/op 1.23
Array 250000 get(125000) 0.45100 ns/op 0.39500 ns/op 1.14
Array 250000 set(125000) 0.46500 ns/op 0.40900 ns/op 1.14
Array 250000 iterate all - loop 85.118 us/op 79.203 us/op 1.07
phase0 afterProcessEpoch - 250000 vs - 7PWei 57.045 ms/op 49.315 ms/op 1.16
Array.fill - length 1000000 3.9241 ms/op 3.5019 ms/op 1.12
Array push - length 1000000 15.989 ms/op 16.098 ms/op 0.99
Array.get 0.29889 ns/op 0.26376 ns/op 1.13
Uint8Array.get 0.47162 ns/op 0.42329 ns/op 1.11
phase0 beforeProcessEpoch - 250000 vs - 7PWei 22.186 ms/op 17.563 ms/op 1.26
altair processEpoch - mainnet_e81889 308.92 ms/op 272.29 ms/op 1.13
mainnet_e81889 - altair beforeProcessEpoch 24.238 ms/op 21.305 ms/op 1.14
mainnet_e81889 - altair processJustificationAndFinalization 16.013 us/op 13.498 us/op 1.19
mainnet_e81889 - altair processInactivityUpdates 6.9326 ms/op 4.9620 ms/op 1.40
mainnet_e81889 - altair processRewardsAndPenalties 54.472 ms/op 43.876 ms/op 1.24
mainnet_e81889 - altair processRegistryUpdates 2.7080 us/op 1.7000 us/op 1.59
mainnet_e81889 - altair processSlashings 650.00 ns/op 397.00 ns/op 1.64
mainnet_e81889 - altair processEth1DataReset 1.0150 us/op 314.00 ns/op 3.23
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.0978 ms/op 1.4375 ms/op 1.46
mainnet_e81889 - altair processSlashingsReset 5.8720 us/op 2.7220 us/op 2.16
mainnet_e81889 - altair processRandaoMixesReset 4.6840 us/op 3.4220 us/op 1.37
mainnet_e81889 - altair processHistoricalRootsUpdate 568.00 ns/op 321.00 ns/op 1.77
mainnet_e81889 - altair processParticipationFlagUpdates 4.4850 us/op 1.6530 us/op 2.71
mainnet_e81889 - altair processSyncCommitteeUpdates 861.00 ns/op 244.00 ns/op 3.53
mainnet_e81889 - altair afterProcessEpoch 56.795 ms/op 52.908 ms/op 1.07
capella processEpoch - mainnet_e217614 1.3076 s/op 1.0185 s/op 1.28
mainnet_e217614 - capella beforeProcessEpoch 87.997 ms/op 69.451 ms/op 1.27
mainnet_e217614 - capella processJustificationAndFinalization 23.952 us/op 15.343 us/op 1.56
mainnet_e217614 - capella processInactivityUpdates 19.979 ms/op 21.809 ms/op 0.92
mainnet_e217614 - capella processRewardsAndPenalties 262.64 ms/op 217.83 ms/op 1.21
mainnet_e217614 - capella processRegistryUpdates 19.403 us/op 12.888 us/op 1.51
mainnet_e217614 - capella processSlashings 865.00 ns/op 384.00 ns/op 2.25
mainnet_e217614 - capella processEth1DataReset 835.00 ns/op 317.00 ns/op 2.63
mainnet_e217614 - capella processEffectiveBalanceUpdates 19.200 ms/op 13.744 ms/op 1.40
mainnet_e217614 - capella processSlashingsReset 11.729 us/op 6.0720 us/op 1.93
mainnet_e217614 - capella processRandaoMixesReset 9.0160 us/op 5.4050 us/op 1.67
mainnet_e217614 - capella processHistoricalRootsUpdate 751.00 ns/op 551.00 ns/op 1.36
mainnet_e217614 - capella processParticipationFlagUpdates 2.6400 us/op 2.8770 us/op 0.92
mainnet_e217614 - capella afterProcessEpoch 134.79 ms/op 125.19 ms/op 1.08
phase0 processEpoch - mainnet_e58758 426.61 ms/op 391.30 ms/op 1.09
mainnet_e58758 - phase0 beforeProcessEpoch 112.77 ms/op 84.056 ms/op 1.34
mainnet_e58758 - phase0 processJustificationAndFinalization 21.795 us/op 16.364 us/op 1.33
mainnet_e58758 - phase0 processRewardsAndPenalties 40.465 ms/op 30.518 ms/op 1.33
mainnet_e58758 - phase0 processRegistryUpdates 10.637 us/op 11.783 us/op 0.90
mainnet_e58758 - phase0 processSlashings 343.00 ns/op 674.00 ns/op 0.51
mainnet_e58758 - phase0 processEth1DataReset 376.00 ns/op 453.00 ns/op 0.83
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.2880 ms/op 1.3132 ms/op 0.98
mainnet_e58758 - phase0 processSlashingsReset 3.1400 us/op 2.6080 us/op 1.20
mainnet_e58758 - phase0 processRandaoMixesReset 4.0370 us/op 5.6980 us/op 0.71
mainnet_e58758 - phase0 processHistoricalRootsUpdate 297.00 ns/op 441.00 ns/op 0.67
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.1150 us/op 4.1210 us/op 0.76
mainnet_e58758 - phase0 afterProcessEpoch 44.814 ms/op 45.193 ms/op 0.99
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.9422 ms/op 1.5572 ms/op 1.25
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.5486 ms/op 2.4075 ms/op 1.06
altair processInactivityUpdates - 250000 normalcase 15.492 ms/op 17.453 ms/op 0.89
altair processInactivityUpdates - 250000 worstcase 15.952 ms/op 18.550 ms/op 0.86
phase0 processRegistryUpdates - 250000 normalcase 8.4880 us/op 7.8640 us/op 1.08
phase0 processRegistryUpdates - 250000 badcase_full_deposits 266.81 us/op 321.33 us/op 0.83
phase0 processRegistryUpdates - 250000 worstcase 0.5 119.55 ms/op 132.89 ms/op 0.90
altair processRewardsAndPenalties - 250000 normalcase 42.994 ms/op 41.308 ms/op 1.04
altair processRewardsAndPenalties - 250000 worstcase 42.685 ms/op 39.590 ms/op 1.08
phase0 getAttestationDeltas - 250000 normalcase 7.7355 ms/op 9.2636 ms/op 0.84
phase0 getAttestationDeltas - 250000 worstcase 7.7528 ms/op 8.1551 ms/op 0.95
phase0 processSlashings - 250000 worstcase 89.670 us/op 126.80 us/op 0.71
altair processSyncCommitteeUpdates - 250000 122.68 ms/op 146.14 ms/op 0.84
BeaconState.hashTreeRoot - No change 233.00 ns/op 250.00 ns/op 0.93
BeaconState.hashTreeRoot - 1 full validator 115.46 us/op 112.90 us/op 1.02
BeaconState.hashTreeRoot - 32 full validator 981.82 us/op 1.1443 ms/op 0.86
BeaconState.hashTreeRoot - 512 full validator 9.3735 ms/op 12.774 ms/op 0.73
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 106.84 us/op 146.90 us/op 0.73
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.3658 ms/op 2.0323 ms/op 0.67
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 17.626 ms/op 24.625 ms/op 0.72
BeaconState.hashTreeRoot - 1 balances 82.174 us/op 145.14 us/op 0.57
BeaconState.hashTreeRoot - 32 balances 847.46 us/op 1.3624 ms/op 0.62
BeaconState.hashTreeRoot - 512 balances 8.4721 ms/op 11.255 ms/op 0.75
BeaconState.hashTreeRoot - 250000 balances 151.90 ms/op 207.42 ms/op 0.73
aggregationBits - 2048 els - zipIndexesInBitList 25.495 us/op 40.683 us/op 0.63
byteArrayEquals 32 56.144 ns/op 56.546 ns/op 0.99
Buffer.compare 32 17.920 ns/op 19.899 ns/op 0.90
byteArrayEquals 1024 1.5781 us/op 1.6589 us/op 0.95
Buffer.compare 1024 25.326 ns/op 29.301 ns/op 0.86
byteArrayEquals 16384 25.728 us/op 25.778 us/op 1.00
Buffer.compare 16384 195.34 ns/op 187.86 ns/op 1.04
byteArrayEquals 123687377 194.04 ms/op 202.30 ms/op 0.96
Buffer.compare 123687377 6.5862 ms/op 13.011 ms/op 0.51
byteArrayEquals 32 - diff last byte 53.672 ns/op 59.273 ns/op 0.91
Buffer.compare 32 - diff last byte 17.475 ns/op 21.859 ns/op 0.80
byteArrayEquals 1024 - diff last byte 1.5970 us/op 1.7288 us/op 0.92
Buffer.compare 1024 - diff last byte 26.162 ns/op 32.889 ns/op 0.80
byteArrayEquals 16384 - diff last byte 25.568 us/op 27.187 us/op 0.94
Buffer.compare 16384 - diff last byte 205.86 ns/op 225.46 ns/op 0.91
byteArrayEquals 123687377 - diff last byte 195.83 ms/op 214.60 ms/op 0.91
Buffer.compare 123687377 - diff last byte 7.9817 ms/op 9.7327 ms/op 0.82
byteArrayEquals 32 - random bytes 5.4660 ns/op 7.1170 ns/op 0.77
Buffer.compare 32 - random bytes 18.381 ns/op 21.389 ns/op 0.86
byteArrayEquals 1024 - random bytes 5.3890 ns/op 5.4850 ns/op 0.98
Buffer.compare 1024 - random bytes 18.366 ns/op 22.885 ns/op 0.80
byteArrayEquals 16384 - random bytes 5.4070 ns/op 5.4990 ns/op 0.98
Buffer.compare 16384 - random bytes 18.217 ns/op 21.201 ns/op 0.86
byteArrayEquals 123687377 - random bytes 6.8000 ns/op 6.6700 ns/op 1.02
Buffer.compare 123687377 - random bytes 19.360 ns/op 22.810 ns/op 0.85
regular array get 100000 times 42.329 us/op 35.041 us/op 1.21
wrappedArray get 100000 times 34.408 us/op 34.214 us/op 1.01
arrayWithProxy get 100000 times 14.904 ms/op 13.807 ms/op 1.08
ssz.Root.equals 48.570 ns/op 47.193 ns/op 1.03
byteArrayEquals 47.924 ns/op 46.188 ns/op 1.04
Buffer.compare 11.133 ns/op 10.902 ns/op 1.02
processSlot - 1 slots 14.560 us/op 13.926 us/op 1.05
processSlot - 32 slots 3.0264 ms/op 2.7248 ms/op 1.11
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 35.859 ms/op 40.298 ms/op 0.89
getCommitteeAssignments - req 1 vs - 250000 vc 2.1092 ms/op 2.2338 ms/op 0.94
getCommitteeAssignments - req 100 vs - 250000 vc 4.1329 ms/op 4.3467 ms/op 0.95
getCommitteeAssignments - req 1000 vs - 250000 vc 4.5741 ms/op 4.7131 ms/op 0.97
findModifiedValidators - 10000 modified validators 251.19 ms/op 274.31 ms/op 0.92
findModifiedValidators - 1000 modified validators 174.75 ms/op 209.03 ms/op 0.84
findModifiedValidators - 100 modified validators 160.13 ms/op 221.51 ms/op 0.72
findModifiedValidators - 10 modified validators 154.53 ms/op 228.12 ms/op 0.68
findModifiedValidators - 1 modified validators 144.70 ms/op 186.38 ms/op 0.78
findModifiedValidators - no difference 158.47 ms/op 189.14 ms/op 0.84
compare ViewDUs 3.0897 s/op 3.7648 s/op 0.82
compare each validator Uint8Array 1.3337 s/op 1.9209 s/op 0.69
compare ViewDU to Uint8Array 1.0054 s/op 1.4365 s/op 0.70
migrate state 1000000 validators, 24 modified, 0 new 708.88 ms/op 875.77 ms/op 0.81
migrate state 1000000 validators, 1700 modified, 1000 new 946.98 ms/op 1.0609 s/op 0.89
migrate state 1000000 validators, 3400 modified, 2000 new 1.1568 s/op 1.2303 s/op 0.94
migrate state 1500000 validators, 24 modified, 0 new 774.24 ms/op 812.43 ms/op 0.95
migrate state 1500000 validators, 1700 modified, 1000 new 960.18 ms/op 1.0717 s/op 0.90
migrate state 1500000 validators, 3400 modified, 2000 new 1.1668 s/op 1.1956 s/op 0.98
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.3100 ns/op 4.3500 ns/op 0.99
state getBlockRootAtSlot - 250000 vs - 7PWei 698.69 ns/op 751.16 ns/op 0.93
computeProposers - vc 250000 7.3687 ms/op 6.9401 ms/op 1.06
computeEpochShuffling - vc 250000 41.306 ms/op 41.848 ms/op 0.99
getNextSyncCommittee - vc 250000 126.95 ms/op 123.52 ms/op 1.03
computeSigningRoot for AttestationData 22.179 us/op 16.586 us/op 1.34
hash AttestationData serialized data then Buffer.toString(base64) 1.5321 us/op 1.5521 us/op 0.99
toHexString serialized data 851.09 ns/op 929.08 ns/op 0.92
Buffer.toString(base64) 162.37 ns/op 193.76 ns/op 0.84
nodejs block root to RootHex using toHex 156.45 ns/op 153.01 ns/op 1.02
nodejs block root to RootHex using toRootHex 93.544 ns/op 108.72 ns/op 0.86
browser block root to RootHex using the deprecated toHexString 235.56 ns/op 229.97 ns/op 1.02
browser block root to RootHex using toHex 188.95 ns/op 187.88 ns/op 1.01
browser block root to RootHex using toRootHex 162.64 ns/op 166.78 ns/op 0.98

by benchmarkbot/action

Copy link

codecov bot commented Dec 14, 2024

Codecov Report

Attention: Patch coverage is 16.66667% with 10 lines in your changes missing coverage. Please review.

Project coverage is 48.75%. Comparing base (a00c796) to head (af0ad20).
Report is 4 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #7302       /-   ##
============================================
- Coverage     48.78%   48.75%   -0.03%     
============================================
  Files           601      601              
  Lines         40177    40214       37     
  Branches       2061     2061              
============================================
  Hits          19601    19608        7     
- Misses        20538    20568       30     
  Partials         38       38              

nflaig
nflaig previously approved these changes Dec 15, 2024
Copy link
Member

@nflaig nflaig left a comment

Choose a reason for hiding this comment

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

Looks good, seems like we only implement the check when processing the block as per spec here.

I guess the gossip check is not as critical since we won't be importing an invalid block due to the check above. The worst that can happen is probably that we re-gossip an invalid block and get downscored by our peers.

@twoeths
Copy link
Contributor

twoeths commented Dec 16, 2024

good finding, need to update respective unit test too

@ensi321 ensi321 merged commit 7cd296b into unstable Dec 17, 2024
19 of 20 checks passed
@ensi321 ensi321 deleted the nc/kzg-commitment-validation branch December 17, 2024 03:21
wemeetagain added a commit that referenced this pull request Dec 20, 2024
* feat: add keymanager endpoint to retrieve proposer config (#7210)

* feat: add keymanager endpoint to retrieve proposer config

* Do not return empty builder config

* Check all builder proposer config values

* Fix settings builder config if undefined

* Fix builder config parsing

* Use ssz type to handle json serialization

Default parsing can't handle BigInt

* Revert "Use ssz type to handle json serialization"

This reverts commit 01fcea7.

* Fix boost factor json serialization

* Remove unused import

* Update test data

* Update proposer config test

* feat: add mekong network option (#7212)

* chore: fix import order with biome syntax (#7211)

Fix import order

* fix: consistently validate pubkey and throw 404 if not found (#7214)

* Throw error if pubkey is unknown when getting graffiti

* Consistently validate pubkey and throw 404 if not found

* fix: only return local keys from /eth/v1/keystores (#7215)

* fix: only return local keys from /eth/v1/keystores

* Fix fetching remote keys in node assertion

* feat: add and use getBlobsV1 to expedite gossip import (#7134)

* hookup the getblobs api to get bob and proof data from el

remove unused

fix import

metrics overhault, test, debugging testing, some feeback

fix

add nethermind bug dicussion link

fix

resolve conflicts

* deblobs timeout

* fix metric

* chore: revert async aggregate with randomness (#7218)

Revert "feat: asyncAggregateWithRandomness (#7204)"

This reverts commit e31d535.

* fix: update config for relaunched mekong network (#7220)

* fix: light client generating `LightClientUpdate` with wrong length of branches (#7187)

* initial commit

* Rewrite SyncCommitteeWitnessRepository

* Fix finality branch

* Update unit test

* fix e2e

* Review PR

---------

Co-authored-by: Nico Flaig <[email protected]>

* fix: archive finalized state when shutting down beacon node (#7221)

* Fix typo

* feat: remove unfinalized pubkey cache (#7230)

* Remove unfinalized pubkey cache

* lint

* Fix unit test

* chore: skip web3_provider unit tests (#7252)

* fix: prune checkpoint states at syncing time (#7241)

* fix: prune checkpoint states at syncing time

* fix: lint

* fix: check-types in test

* fix: sync cached isCompoundingValidatorArr at epoch transition (#7247)

* fix: handle outOfRangeData when range sync Deneb (#7249)

* fix: handle outOfRangeData for beaconBlocksMaybeBlobsByRange()

* fix: lint

* fix: archiveBlocks - handle deneb outOfRangeData block

* fix: sync cached balance when adding new validator to registry (#7255)

* fix: sync cached balance when adding new validator to registry

* chore: add more comments

* fix: remove persisted checkpoint states from the previous run at startup

* fix: do not throw error when trying to prune missing directory (#7257)

* docs: update documentation Oct 2024 (#7178)

* docs update oct 2024 init

* Reconfig quickstart nav and minor fixes

* fix lint

* spelling fixes

* minor fixes and add to wordlist

* prettier fix

* add to wordlist

* sort wordlist

* modify dominance to include lighthouse

* fix typescript casing and add recommendation

* add selection and boost_factor with keymanager notice

* update wordlist

* remove builder enabled and add keymanager api

* spelling

---------

Co-authored-by: Nico Flaig <[email protected]>

* chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /docs (#7268)

Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](moxystudio/node-cross-spawn@v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333 dependabot[bot]@users.noreply.github.com>

* feat: add error log to notifier if execution client auth failed (#7239)

* feat: add error log to notifier if execution client auth failed

* Update packages/beacon-node/src/node/notifier.ts

---------

Co-authored-by: NC <17676176 [email protected]>

* docs: display rcConfig flag on CLI reference page (#7270)

* docs: display rcConfig flag on CLI reference page

* Update word list

* chore: remove prettier as default formatter for all file types (#7275)

* chore: unhide flags relevant for devnets / testing (#7271)

* feat: debug too many shuffling promises (#7251)

* feat: add asyncShufflingCalculation to StateTransitionOpts

* feat: add asyncShufflingCalculation to all regen / processSlots consumers

* fix: default to false for async shuffling and remove unnecessary props

* fix: remove unnecessary flags from stateTransition

* feat: implement conditional build of shuffling for prepareNextSlot

* fix: spec test bug where shufflingCache is present from BeaconChain constructor

* feat: sync build next shuffling if not queued async

* fix: use getSync to pull next shuffling correctly

* docs: add comment to prepareNextSlot

* refactor: rename StateCloneOpts to StateRegenerationOpts

* feat: pass asyncShufflingCalculation through to afterProcessEpoch and refactor conditional to run purely sync

* docs: add issue number to comment

* chore: lint

* chore: unpin nodejs version from 22.4 (#6982)

* Revert "chore: pin nodejs version to 22.4 (#6964)"

This reverts commit f20484b.

* Don't revert formatting changes

---------

Co-authored-by: Nico Flaig <[email protected]>
Co-authored-by: Cayman <[email protected]>

* chore: update bootnodes file url for holesky and sepolia (#7276)

* feat: add `debug_getHistoricalSummaries` endpoint (#7245)

* feat: add new getHistoricalSummaries endpoint to debug namespace

* Add JSON response

* Restructure to use stateId and add proof to response

* add test scaffolding

* Address feedback

* Move getHistoricalSummaries to lodestar namespace

* add lodestar namespace unit test

* update route name to lodestar namespace

* cast state object as Capella state

* Lint

* json properties need to be lower case

* Make it v1 since it's now part of lodestar namespace

* Group with other /lodestar endpoints

* Simplify beacon node impl

* Rename return type

* Update test description

* Fix variable name

---------

Co-authored-by: Nico Flaig <[email protected]>

* chore: log sync committee signature errors as `error` (#7283)

* fix: update engine_getClientVersionV1 commit encoding (#7282)

* fix: check pubkey or validator index known to a state (#7284)

* fix: check pubkey or validator index known to a state

* chore: add more comments

* feat: lodestar script setup (#7254)

* feat: lodestar_setup

* feat: script_updates   docs

* feat: script_addition_in_docs   command_update

* Remove duplicate script from docs folder

* Minor script updates

* Update script to prepare docs and ignore copied file

* Update installation page

* Wording

---------

Co-authored-by: Nico Flaig <[email protected]>

* feat: add terminal-sized Electra giraffe banner (#7286)

* Create giraffeBanners.ts

* Wire in banner

* Fix file name

* lint

* Address @nflaig's comment

---------

Co-authored-by: NC <17676176 [email protected]>

* chore: pin nodejs version to 22.4 (#7291)

Revert "chore: unpin nodejs version from 22.4 (#6982)"

This reverts commit 69ae688.

* feat: expose `DOMAIN_APPLICATION_MASK` in config/spec api (#7296)

* feat: expose DOMAIN_APPLICATION_MASK in config/spec api

* Lint

* feat: make `MAX_REQUEST_BLOB_SIDECARS` and `MAX_BLOBS_PER_BLOCK` configurable (#7294)

* Init commit

* Fix check-types

* Add comment on how MAX_REQUEST_BLOB_SIDECARS is calculated

* Ensure proper config object is passed

* Address comment

---------

Co-authored-by: Nico Flaig <[email protected]>

* feat: use `BLOB_SIDECAR_SUBNET_COUNT` to configure blob subnets (#7297)

feat: use BLOB_SIDECAR_SUBNET_COUNT to configure blob subnets

* chore: log sync aggregate participants when producing beacon block body (#7300)

* chore: log sync aggregate participants when producing beacon block body

* Use isForkLightClient instead of ForkSeq

* Fix produce block unit tests

* chore: print graffiti when producing beacon block body (#7303)

* fix: warn if engine / builder failed to produce block within cutoff time (#7305)

* feat: add kzg commitment length check when validating gossip blocks (#7302)

* feat: add blob sidecar index check (#7313)

Validate blobSidecar index

* fix: fix blob sidecar index check (#7315)

Fix index check

* chore: fix format of printed graffiti from hex to utf-8 (#7306)

* chore: fix format of printed graffiti from hex to utf-8

* Use Buffer.from no copy with offset

* docs: batch commit typos and update contributor readme (#7312)

* batch commit typos and update contributor readme

* update donation text

Co-authored-by: Nico Flaig <[email protected]>

* correct spelling

Co-authored-by: Nico Flaig <[email protected]>

---------

Co-authored-by: Nico Flaig <[email protected]>

* chore: remove trailing null bytes from printed graffiti (#7320)

* chore: remove trailing null bytes from printed graffiti

* Use replaceAll instead of regex

* chore: unpin nodejs version from 22.4 (#7324)

Revert "chore: pin nodejs version to 22.4 (#7291)"

This reverts commit 99794d3.

* chore: bump package versions to 1.24.0

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Nico Flaig <[email protected]>
Co-authored-by: Nazar Hussain <[email protected]>
Co-authored-by: g11tech <[email protected]>
Co-authored-by: Matthew Keil <[email protected]>
Co-authored-by: NC <17676176 [email protected]>
Co-authored-by: twoeths <[email protected]>
Co-authored-by: Phil Ngo <58080811 [email protected]>
Co-authored-by: dependabot[bot] <49699333 dependabot[bot]@users.noreply.github.com>
Co-authored-by: acolytec3 <17355484 [email protected]>
Co-authored-by: Varun Guleria <152203177 [email protected]>
Co-authored-by: ClockworkYuzu <[email protected]>
@wemeetagain
Copy link
Member

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