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 and use getBlobsV1 to expedite gossip import #7134

Open
wants to merge 4 commits into
base: unstable
Choose a base branch
from

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Oct 8, 2024

one may review but still

  • undergoing testing/observation

Closes #7114

@g11tech g11tech requested a review from a team as a code owner October 8, 2024 13:38
@g11tech g11tech closed this Oct 8, 2024
@g11tech g11tech reopened this Oct 8, 2024
Copy link

codecov bot commented Oct 8, 2024

Codecov Report

Attention: Patch coverage is 7.14286% with 39 lines in your changes missing coverage. Please review.

Project coverage is 49.10%. Comparing base (0d1fd9c) to head (2db8d02).
Report is 2 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #7134      +/-   ##
============================================
+ Coverage     49.04%   49.10%   +0.05%     
============================================
  Files           596      597       +1     
  Lines         39743    39772      +29     
  Branches       2065     2068       +3     
============================================
+ Hits          19493    19530      +37     
+ Misses        20209    20201       -8     
  Partials         41       41              

@philknows philknows added this to the v1.23.0 milestone Oct 8, 2024
Copy link
Contributor

github-actions bot commented Oct 8, 2024

⚠️ Performance Alert ⚠️

Possible performance regression was detected for some benchmarks.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold.

Benchmark suite Current: 57dccd7 Previous: 1fa3f37 Ratio
forkChoice updateHead vc 600000 bc 64 eq 300000 46.647 ms/op 14.776 ms/op 3.16
Full benchmark results
Benchmark suite Current: 57dccd7 Previous: 1fa3f37 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.4382 ms/op 2.0172 ms/op 1.21
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 84.989 us/op 58.150 us/op 1.46
BLS verify - blst 1.0697 ms/op 826.20 us/op 1.29
BLS verifyMultipleSignatures 3 - blst 1.7334 ms/op 1.3240 ms/op 1.31
BLS verifyMultipleSignatures 8 - blst 2.5581 ms/op 1.7245 ms/op 1.48
BLS verifyMultipleSignatures 32 - blst 6.8307 ms/op 5.1644 ms/op 1.32
BLS verifyMultipleSignatures 64 - blst 12.428 ms/op 9.3538 ms/op 1.33
BLS verifyMultipleSignatures 128 - blst 19.786 ms/op 17.259 ms/op 1.15
BLS deserializing 10000 signatures 756.27 ms/op 689.31 ms/op 1.10
BLS deserializing 100000 signatures 7.3483 s/op 6.8879 s/op 1.07
BLS verifyMultipleSignatures - same message - 3 - blst 1.1931 ms/op 1.0142 ms/op 1.18
BLS verifyMultipleSignatures - same message - 8 - blst 1.3796 ms/op 1.0981 ms/op 1.26
BLS verifyMultipleSignatures - same message - 32 - blst 1.9575 ms/op 1.8210 ms/op 1.07
BLS verifyMultipleSignatures - same message - 64 - blst 2.8312 ms/op 2.6986 ms/op 1.05
BLS verifyMultipleSignatures - same message - 128 - blst 4.8643 ms/op 4.4333 ms/op 1.10
BLS aggregatePubkeys 32 - blst 22.737 us/op 19.834 us/op 1.15
BLS aggregatePubkeys 128 - blst 74.021 us/op 70.185 us/op 1.05
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 61.460 ms/op 57.937 ms/op 1.06
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 57.143 ms/op 47.134 ms/op 1.21
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 47.758 ms/op 31.711 ms/op 1.51
getSlashingsAndExits - default max 99.658 us/op 86.446 us/op 1.15
getSlashingsAndExits - 2k 383.89 us/op 246.82 us/op 1.56
proposeBlockBody type=full, size=empty 8.2118 ms/op 5.6835 ms/op 1.44
isKnown best case - 1 super set check 577.00 ns/op 263.00 ns/op 2.19
isKnown normal case - 2 super set checks 573.00 ns/op 260.00 ns/op 2.20
isKnown worse case - 16 super set checks 515.00 ns/op 261.00 ns/op 1.97
InMemoryCheckpointStateCache - add get delete 3.3360 us/op 2.6570 us/op 1.26
updateUnfinalizedPubkeys - updating 10 pubkeys 1.5451 ms/op 730.36 us/op 2.12
updateUnfinalizedPubkeys - updating 100 pubkeys 4.8942 ms/op 3.2337 ms/op 1.51
updateUnfinalizedPubkeys - updating 1000 pubkeys 62.101 ms/op 49.970 ms/op 1.24
validate api signedAggregateAndProof - struct 1.7655 ms/op 1.3633 ms/op 1.29
validate gossip signedAggregateAndProof - struct 1.9296 ms/op 1.3258 ms/op 1.46
batch validate gossip attestation - vc 640000 - chunk 32 157.62 us/op 121.74 us/op 1.29
batch validate gossip attestation - vc 640000 - chunk 64 138.20 us/op 110.23 us/op 1.25
batch validate gossip attestation - vc 640000 - chunk 128 134.37 us/op 102.37 us/op 1.31
batch validate gossip attestation - vc 640000 - chunk 256 123.56 us/op 101.11 us/op 1.22
pickEth1Vote - no votes 1.1872 ms/op 1.0565 ms/op 1.12
pickEth1Vote - max votes 7.6693 ms/op 5.2073 ms/op 1.47
pickEth1Vote - Eth1Data hashTreeRoot value x2048 18.576 ms/op 11.423 ms/op 1.63
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 30.209 ms/op 14.885 ms/op 2.03
pickEth1Vote - Eth1Data fastSerialize value x2048 581.55 us/op 461.27 us/op 1.26
pickEth1Vote - Eth1Data fastSerialize tree x2048 3.9590 ms/op 3.6871 ms/op 1.07
bytes32 toHexString 661.00 ns/op 412.00 ns/op 1.60
bytes32 Buffer.toString(hex) 275.00 ns/op 251.00 ns/op 1.10
bytes32 Buffer.toString(hex) from Uint8Array 518.00 ns/op 381.00 ns/op 1.36
bytes32 Buffer.toString(hex) + 0x 318.00 ns/op 252.00 ns/op 1.26
Object access 1 prop 0.22000 ns/op 0.14100 ns/op 1.56
Map access 1 prop 0.15400 ns/op 0.14100 ns/op 1.09
Object get x1000 6.6030 ns/op 5.7810 ns/op 1.14
Map get x1000 7.6700 ns/op 6.5040 ns/op 1.18
Object set x1000 64.801 ns/op 32.685 ns/op 1.98
Map set x1000 39.879 ns/op 21.589 ns/op 1.85
Return object 10000 times 0.32830 ns/op 0.28730 ns/op 1.14
Throw Error 10000 times 3.7488 us/op 3.3067 us/op 1.13
toHex 179.21 ns/op 151.73 ns/op 1.18
Buffer.from 163.12 ns/op 133.31 ns/op 1.22
shared Buffer 109.66 ns/op 91.784 ns/op 1.19
fastMsgIdFn sha256 / 200 bytes 2.4840 us/op 2.2070 us/op 1.13
fastMsgIdFn h32 xxhash / 200 bytes 316.00 ns/op 234.00 ns/op 1.35
fastMsgIdFn h64 xxhash / 200 bytes 294.00 ns/op 270.00 ns/op 1.09
fastMsgIdFn sha256 / 1000 bytes 7.8740 us/op 7.2030 us/op 1.09
fastMsgIdFn h32 xxhash / 1000 bytes 449.00 ns/op 364.00 ns/op 1.23
fastMsgIdFn h64 xxhash / 1000 bytes 361.00 ns/op 339.00 ns/op 1.06
fastMsgIdFn sha256 / 10000 bytes 67.005 us/op 63.185 us/op 1.06
fastMsgIdFn h32 xxhash / 10000 bytes 2.0870 us/op 1.8310 us/op 1.14
fastMsgIdFn h64 xxhash / 10000 bytes 1.3740 us/op 1.1790 us/op 1.17
send data - 1000 256B messages 16.155 ms/op 11.900 ms/op 1.36
send data - 1000 512B messages 19.281 ms/op 16.250 ms/op 1.19
send data - 1000 1024B messages 34.177 ms/op 25.370 ms/op 1.35
send data - 1000 1200B messages 34.486 ms/op 25.966 ms/op 1.33
send data - 1000 2048B messages 36.503 ms/op 31.003 ms/op 1.18
send data - 1000 4096B messages 36.453 ms/op 32.252 ms/op 1.13
send data - 1000 16384B messages 87.901 ms/op 68.866 ms/op 1.28
send data - 1000 65536B messages 257.70 ms/op 218.41 ms/op 1.18
enrSubnets - fastDeserialize 64 bits 1.5740 us/op 1.1470 us/op 1.37
enrSubnets - ssz BitVector 64 bits 481.00 ns/op 379.00 ns/op 1.27
enrSubnets - fastDeserialize 4 bits 229.00 ns/op 169.00 ns/op 1.36
enrSubnets - ssz BitVector 4 bits 508.00 ns/op 371.00 ns/op 1.37
prioritizePeers score -10:0 att 32-0.1 sync 2-0 288.55 us/op 149.59 us/op 1.93
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 279.98 us/op 152.74 us/op 1.83
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 462.40 us/op 290.23 us/op 1.59
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 704.33 us/op 400.12 us/op 1.76
prioritizePeers score 0:0 att 64-1 sync 4-1 916.68 us/op 655.26 us/op 1.40
array of 16000 items push then shift 1.9323 us/op 1.6114 us/op 1.20
LinkedList of 16000 items push then shift 14.373 ns/op 6.8890 ns/op 2.09
array of 16000 items push then pop 182.24 ns/op 119.44 ns/op 1.53
LinkedList of 16000 items push then pop 13.621 ns/op 6.8170 ns/op 2.00
array of 24000 items push then shift 3.3540 us/op 2.3942 us/op 1.40
LinkedList of 24000 items push then shift 13.057 ns/op 7.2700 ns/op 1.80
array of 24000 items push then pop 226.05 ns/op 152.84 ns/op 1.48
LinkedList of 24000 items push then pop 11.104 ns/op 6.9130 ns/op 1.61
intersect bitArray bitLen 8 9.3950 ns/op 6.3780 ns/op 1.47
intersect array and set length 8 90.846 ns/op 49.151 ns/op 1.85
intersect bitArray bitLen 128 45.092 ns/op 29.589 ns/op 1.52
intersect array and set length 128 1.0947 us/op 695.74 ns/op 1.57
bitArray.getTrueBitIndexes() bitLen 128 3.2260 us/op 1.6460 us/op 1.96
bitArray.getTrueBitIndexes() bitLen 248 4.2800 us/op 3.3130 us/op 1.29
bitArray.getTrueBitIndexes() bitLen 512 9.9300 us/op 7.4000 us/op 1.34
Buffer.concat 32 items 1.3830 us/op 917.00 ns/op 1.51
Uint8Array.set 32 items 2.1460 us/op 1.6620 us/op 1.29
Buffer.copy 2.6650 us/op 1.8020 us/op 1.48
Uint8Array.set - with subarray 4.1270 us/op 2.9470 us/op 1.40
Uint8Array.set - without subarray 2.1490 us/op 1.6640 us/op 1.29
getUint32 - dataview 316.00 ns/op 255.00 ns/op 1.24
getUint32 - manual 293.00 ns/op 177.00 ns/op 1.66
Set add up to 64 items then delete first 3.2768 us/op 2.3034 us/op 1.42
OrderedSet add up to 64 items then delete first 5.0956 us/op 3.3536 us/op 1.52
Set add up to 64 items then delete last 3.7130 us/op 2.4722 us/op 1.50
OrderedSet add up to 64 items then delete last 5.9078 us/op 4.0447 us/op 1.46
Set add up to 64 items then delete middle 3.4359 us/op 2.7233 us/op 1.26
OrderedSet add up to 64 items then delete middle 7.9653 us/op 5.6456 us/op 1.41
Set add up to 128 items then delete first 7.1913 us/op 5.3742 us/op 1.34
OrderedSet add up to 128 items then delete first 10.340 us/op 8.5667 us/op 1.21
Set add up to 128 items then delete last 8.2126 us/op 5.1059 us/op 1.61
OrderedSet add up to 128 items then delete last 11.878 us/op 7.4032 us/op 1.60
Set add up to 128 items then delete middle 7.8554 us/op 5.1625 us/op 1.52
OrderedSet add up to 128 items then delete middle 19.890 us/op 15.680 us/op 1.27
Set add up to 256 items then delete first 14.666 us/op 12.066 us/op 1.22
OrderedSet add up to 256 items then delete first 21.856 us/op 17.365 us/op 1.26
Set add up to 256 items then delete last 15.727 us/op 10.185 us/op 1.54
OrderedSet add up to 256 items then delete last 25.285 us/op 16.063 us/op 1.57
Set add up to 256 items then delete middle 15.039 us/op 9.7160 us/op 1.55
OrderedSet add up to 256 items then delete middle 57.240 us/op 43.832 us/op 1.31
transfer serialized Status (84 B) 2.0300 us/op 1.3450 us/op 1.51
copy serialized Status (84 B) 1.8530 us/op 1.1650 us/op 1.59
transfer serialized SignedVoluntaryExit (112 B) 2.7400 us/op 1.4340 us/op 1.91
copy serialized SignedVoluntaryExit (112 B) 2.5400 us/op 1.1910 us/op 2.13
transfer serialized ProposerSlashing (416 B) 3.7000 us/op 1.5900 us/op 2.33
copy serialized ProposerSlashing (416 B) 2.4680 us/op 1.8550 us/op 1.33
transfer serialized Attestation (485 B) 2.2780 us/op 2.0470 us/op 1.11
copy serialized Attestation (485 B) 2.4610 us/op 1.8070 us/op 1.36
transfer serialized AttesterSlashing (33232 B) 2.7350 us/op 2.7270 us/op 1.00
copy serialized AttesterSlashing (33232 B) 8.8560 us/op 6.2860 us/op 1.41
transfer serialized Small SignedBeaconBlock (128000 B) 2.9980 us/op 2.8190 us/op 1.06
copy serialized Small SignedBeaconBlock (128000 B) 23.269 us/op 16.020 us/op 1.45
transfer serialized Avg SignedBeaconBlock (200000 B) 4.4400 us/op 3.4820 us/op 1.28
copy serialized Avg SignedBeaconBlock (200000 B) 42.384 us/op 22.600 us/op 1.88
transfer serialized BlobsSidecar (524380 B) 5.5950 us/op 3.2910 us/op 1.70
copy serialized BlobsSidecar (524380 B) 152.35 us/op 82.110 us/op 1.86
transfer serialized Big SignedBeaconBlock (1000000 B) 5.7720 us/op 3.1300 us/op 1.84
copy serialized Big SignedBeaconBlock (1000000 B) 311.64 us/op 150.36 us/op 2.07
pass gossip attestations to forkchoice per slot 3.3661 ms/op 2.7438 ms/op 1.23
forkChoice updateHead vc 100000 bc 64 eq 0 540.92 us/op 476.15 us/op 1.14
forkChoice updateHead vc 600000 bc 64 eq 0 6.2811 ms/op 3.6242 ms/op 1.73
forkChoice updateHead vc 1000000 bc 64 eq 0 8.2788 ms/op 5.2970 ms/op 1.56
forkChoice updateHead vc 600000 bc 320 eq 0 3.7004 ms/op 3.2402 ms/op 1.14
forkChoice updateHead vc 600000 bc 1200 eq 0 3.7754 ms/op 3.2064 ms/op 1.18
forkChoice updateHead vc 600000 bc 7200 eq 0 5.8907 ms/op 3.9092 ms/op 1.51
forkChoice updateHead vc 600000 bc 64 eq 1000 11.722 ms/op 10.543 ms/op 1.11
forkChoice updateHead vc 600000 bc 64 eq 10000 12.215 ms/op 10.557 ms/op 1.16
forkChoice updateHead vc 600000 bc 64 eq 300000 46.647 ms/op 14.776 ms/op 3.16
computeDeltas 500000 validators 300 proto nodes 5.7397 ms/op 3.5239 ms/op 1.63
computeDeltas 500000 validators 1200 proto nodes 5.5332 ms/op 3.7181 ms/op 1.49
computeDeltas 500000 validators 7200 proto nodes 4.7819 ms/op 3.7360 ms/op 1.28
computeDeltas 750000 validators 300 proto nodes 9.7238 ms/op 5.2222 ms/op 1.86
computeDeltas 750000 validators 1200 proto nodes 8.9345 ms/op 5.4100 ms/op 1.65
computeDeltas 750000 validators 7200 proto nodes 11.043 ms/op 5.2883 ms/op 2.09
computeDeltas 1400000 validators 300 proto nodes 21.966 ms/op 10.343 ms/op 2.12
computeDeltas 1400000 validators 1200 proto nodes 22.423 ms/op 10.700 ms/op 2.10
computeDeltas 1400000 validators 7200 proto nodes 22.158 ms/op 12.212 ms/op 1.81
computeDeltas 2100000 validators 300 proto nodes 37.429 ms/op 19.939 ms/op 1.88
computeDeltas 2100000 validators 1200 proto nodes 28.889 ms/op 21.536 ms/op 1.34
computeDeltas 2100000 validators 7200 proto nodes 26.016 ms/op 24.362 ms/op 1.07
altair processAttestation - 250000 vs - 7PWei normalcase 3.6291 ms/op 3.1713 ms/op 1.14
altair processAttestation - 250000 vs - 7PWei worstcase 4.4359 ms/op 5.4530 ms/op 0.81
altair processAttestation - setStatus - 1/6 committees join 187.81 us/op 112.78 us/op 1.67
altair processAttestation - setStatus - 1/3 committees join 305.63 us/op 226.03 us/op 1.35
altair processAttestation - setStatus - 1/2 committees join 336.00 us/op 311.20 us/op 1.08
altair processAttestation - setStatus - 2/3 committees join 360.85 us/op 430.95 us/op 0.84
altair processAttestation - setStatus - 4/5 committees join 704.86 us/op 674.76 us/op 1.04
altair processAttestation - setStatus - 100% committees join 850.45 us/op 795.99 us/op 1.07
altair processBlock - 250000 vs - 7PWei normalcase 8.3261 ms/op 7.9027 ms/op 1.05
altair processBlock - 250000 vs - 7PWei normalcase hashState 47.944 ms/op 33.531 ms/op 1.43
altair processBlock - 250000 vs - 7PWei worstcase 50.138 ms/op 50.909 ms/op 0.98
altair processBlock - 250000 vs - 7PWei worstcase hashState 128.17 ms/op 92.487 ms/op 1.39
phase0 processBlock - 250000 vs - 7PWei normalcase 5.6655 ms/op 3.6781 ms/op 1.54
phase0 processBlock - 250000 vs - 7PWei worstcase 38.651 ms/op 30.284 ms/op 1.28
altair processEth1Data - 250000 vs - 7PWei normalcase 895.53 us/op 631.17 us/op 1.42
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 18.170 us/op 10.560 us/op 1.72
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 67.153 us/op 55.943 us/op 1.20
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 24.452 us/op 19.020 us/op 1.29
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 19.325 us/op 10.529 us/op 1.84
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 218.32 us/op 191.39 us/op 1.14
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.7705 ms/op 1.3299 ms/op 1.33
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.8426 ms/op 1.7020 ms/op 1.67
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.3433 ms/op 1.6355 ms/op 1.43
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 8.7155 ms/op 4.7193 ms/op 1.85
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.1527 ms/op 2.3928 ms/op 0.90
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 8.8265 ms/op 4.9005 ms/op 1.80
Tree 40 250000 create 843.41 ms/op 289.58 ms/op 2.91
Tree 40 250000 get(125000) 214.42 ns/op 159.12 ns/op 1.35
Tree 40 250000 set(125000) 2.8776 us/op 751.76 ns/op 3.83
Tree 40 250000 toArray() 47.309 ms/op 20.190 ms/op 2.34
Tree 40 250000 iterate all - toArray() + loop 48.924 ms/op 19.603 ms/op 2.50
Tree 40 250000 iterate all - get(i) 81.924 ms/op 60.703 ms/op 1.35
Array 250000 create 6.3070 ms/op 3.8430 ms/op 1.64
Array 250000 clone - spread 4.2896 ms/op 1.5148 ms/op 2.83
Array 250000 get(125000) 0.64300 ns/op 0.43300 ns/op 1.48
Array 250000 set(125000) 0.65400 ns/op 0.47000 ns/op 1.39
Array 250000 iterate all - loop 119.06 us/op 102.21 us/op 1.16
phase0 afterProcessEpoch - 250000 vs - 7PWei 123.68 ms/op 92.600 ms/op 1.34
Array.fill - length 1000000 10.376 ms/op 4.5891 ms/op 2.26
Array push - length 1000000 55.023 ms/op 29.449 ms/op 1.87
Array.get 0.40510 ns/op 0.28780 ns/op 1.41
Uint8Array.get 0.59677 ns/op 0.46010 ns/op 1.30
phase0 beforeProcessEpoch - 250000 vs - 7PWei 55.026 ms/op 22.916 ms/op 2.40
altair processEpoch - mainnet_e81889 585.30 ms/op 311.32 ms/op 1.88
mainnet_e81889 - altair beforeProcessEpoch 43.854 ms/op 20.962 ms/op 2.09
mainnet_e81889 - altair processJustificationAndFinalization 38.588 us/op 18.624 us/op 2.07
mainnet_e81889 - altair processInactivityUpdates 12.625 ms/op 7.5044 ms/op 1.68
mainnet_e81889 - altair processRewardsAndPenalties 80.857 ms/op 40.596 ms/op 1.99
mainnet_e81889 - altair processRegistryUpdates 7.0440 us/op 2.8480 us/op 2.47
mainnet_e81889 - altair processSlashings 1.1830 us/op 460.00 ns/op 2.57
mainnet_e81889 - altair processEth1DataReset 944.00 ns/op 391.00 ns/op 2.41
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.7846 ms/op 1.9389 ms/op 0.92
mainnet_e81889 - altair processSlashingsReset 7.6940 us/op 5.5260 us/op 1.39
mainnet_e81889 - altair processRandaoMixesReset 15.009 us/op 4.6590 us/op 3.22
mainnet_e81889 - altair processHistoricalRootsUpdate 1.4400 us/op 672.00 ns/op 2.14
mainnet_e81889 - altair processParticipationFlagUpdates 5.1720 us/op 5.1480 us/op 1.00
mainnet_e81889 - altair processSyncCommitteeUpdates 907.00 ns/op 751.00 ns/op 1.21
mainnet_e81889 - altair afterProcessEpoch 106.02 ms/op 99.151 ms/op 1.07
capella processEpoch - mainnet_e217614 1.8978 s/op 1.2481 s/op 1.52
mainnet_e217614 - capella beforeProcessEpoch 90.324 ms/op 67.855 ms/op 1.33
mainnet_e217614 - capella processJustificationAndFinalization 22.355 us/op 16.994 us/op 1.32
mainnet_e217614 - capella processInactivityUpdates 21.893 ms/op 18.001 ms/op 1.22
mainnet_e217614 - capella processRewardsAndPenalties 287.93 ms/op 225.46 ms/op 1.28
mainnet_e217614 - capella processRegistryUpdates 28.141 us/op 13.989 us/op 2.01
mainnet_e217614 - capella processSlashings 1.3350 us/op 363.00 ns/op 3.68
mainnet_e217614 - capella processEth1DataReset 965.00 ns/op 417.00 ns/op 2.31
mainnet_e217614 - capella processEffectiveBalanceUpdates 19.349 ms/op 13.398 ms/op 1.44
mainnet_e217614 - capella processSlashingsReset 5.5390 us/op 3.1200 us/op 1.78
mainnet_e217614 - capella processRandaoMixesReset 15.054 us/op 4.2600 us/op 3.53
mainnet_e217614 - capella processHistoricalRootsUpdate 1.6000 us/op 501.00 ns/op 3.19
mainnet_e217614 - capella processParticipationFlagUpdates 4.8730 us/op 1.9870 us/op 2.45
mainnet_e217614 - capella afterProcessEpoch 264.99 ms/op 234.53 ms/op 1.13
phase0 processEpoch - mainnet_e58758 454.21 ms/op 357.30 ms/op 1.27
mainnet_e58758 - phase0 beforeProcessEpoch 95.042 ms/op 71.168 ms/op 1.34
mainnet_e58758 - phase0 processJustificationAndFinalization 22.969 us/op 15.084 us/op 1.52
mainnet_e58758 - phase0 processRewardsAndPenalties 32.361 ms/op 32.845 ms/op 0.99
mainnet_e58758 - phase0 processRegistryUpdates 12.748 us/op 7.5760 us/op 1.68
mainnet_e58758 - phase0 processSlashings 1.0430 us/op 404.00 ns/op 2.58
mainnet_e58758 - phase0 processEth1DataReset 801.00 ns/op 322.00 ns/op 2.49
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.4027 ms/op 1.2266 ms/op 1.14
mainnet_e58758 - phase0 processSlashingsReset 4.9630 us/op 3.5640 us/op 1.39
mainnet_e58758 - phase0 processRandaoMixesReset 5.4180 us/op 4.6440 us/op 1.17
mainnet_e58758 - phase0 processHistoricalRootsUpdate 655.00 ns/op 399.00 ns/op 1.64
mainnet_e58758 - phase0 processParticipationRecordUpdates 5.7720 us/op 5.1290 us/op 1.13
mainnet_e58758 - phase0 afterProcessEpoch 82.560 ms/op 77.208 ms/op 1.07
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.3675 ms/op 1.5624 ms/op 1.52
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.3642 ms/op 2.4424 ms/op 0.97
altair processInactivityUpdates - 250000 normalcase 18.777 ms/op 15.429 ms/op 1.22
altair processInactivityUpdates - 250000 worstcase 19.845 ms/op 16.751 ms/op 1.18
phase0 processRegistryUpdates - 250000 normalcase 9.2370 us/op 7.3380 us/op 1.26
phase0 processRegistryUpdates - 250000 badcase_full_deposits 375.80 us/op 296.72 us/op 1.27
phase0 processRegistryUpdates - 250000 worstcase 0.5 144.42 ms/op 120.78 ms/op 1.20
altair processRewardsAndPenalties - 250000 normalcase 44.754 ms/op 42.651 ms/op 1.05
altair processRewardsAndPenalties - 250000 worstcase 46.170 ms/op 39.636 ms/op 1.16
phase0 getAttestationDeltas - 250000 normalcase 8.5889 ms/op 8.7105 ms/op 0.99
phase0 getAttestationDeltas - 250000 worstcase 10.604 ms/op 8.2911 ms/op 1.28
phase0 processSlashings - 250000 worstcase 126.58 us/op 104.22 us/op 1.21
altair processSyncCommitteeUpdates - 250000 150.45 ms/op 132.98 ms/op 1.13
BeaconState.hashTreeRoot - No change 264.00 ns/op 259.00 ns/op 1.02
BeaconState.hashTreeRoot - 1 full validator 125.83 us/op 112.35 us/op 1.12
BeaconState.hashTreeRoot - 32 full validator 1.0687 ms/op 913.95 us/op 1.17
BeaconState.hashTreeRoot - 512 full validator 14.416 ms/op 11.074 ms/op 1.30
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 140.51 us/op 116.58 us/op 1.21
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.4109 ms/op 1.9509 ms/op 1.24
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 26.698 ms/op 31.574 ms/op 0.85
BeaconState.hashTreeRoot - 1 balances 135.26 us/op 128.68 us/op 1.05
BeaconState.hashTreeRoot - 32 balances 1.1966 ms/op 869.41 us/op 1.38
BeaconState.hashTreeRoot - 512 balances 12.124 ms/op 7.2797 ms/op 1.67
BeaconState.hashTreeRoot - 250000 balances 174.81 ms/op 198.74 ms/op 0.88
aggregationBits - 2048 els - zipIndexesInBitList 32.397 us/op 29.931 us/op 1.08
byteArrayEquals 32 55.126 ns/op 57.910 ns/op 0.95
Buffer.compare 32 17.953 ns/op 19.150 ns/op 0.94
byteArrayEquals 1024 1.6342 us/op 1.6482 us/op 0.99
Buffer.compare 1024 26.411 ns/op 26.395 ns/op 1.00
byteArrayEquals 16384 26.026 us/op 27.746 us/op 0.94
Buffer.compare 16384 206.26 ns/op 190.34 ns/op 1.08
byteArrayEquals 123687377 202.34 ms/op 198.21 ms/op 1.02
Buffer.compare 123687377 7.1700 ms/op 8.3986 ms/op 0.85
byteArrayEquals 32 - diff last byte 56.942 ns/op 52.646 ns/op 1.08
Buffer.compare 32 - diff last byte 19.647 ns/op 17.036 ns/op 1.15
byteArrayEquals 1024 - diff last byte 1.7466 us/op 1.5902 us/op 1.10
Buffer.compare 1024 - diff last byte 28.632 ns/op 26.412 ns/op 1.08
byteArrayEquals 16384 - diff last byte 27.455 us/op 25.582 us/op 1.07
Buffer.compare 16384 - diff last byte 215.00 ns/op 205.99 ns/op 1.04
byteArrayEquals 123687377 - diff last byte 199.09 ms/op 193.83 ms/op 1.03
Buffer.compare 123687377 - diff last byte 8.3869 ms/op 10.112 ms/op 0.83
byteArrayEquals 32 - random bytes 6.0850 ns/op 5.4920 ns/op 1.11
Buffer.compare 32 - random bytes 19.141 ns/op 17.594 ns/op 1.09
byteArrayEquals 1024 - random bytes 5.7090 ns/op 5.2390 ns/op 1.09
Buffer.compare 1024 - random bytes 18.735 ns/op 16.963 ns/op 1.10
byteArrayEquals 16384 - random bytes 6.0330 ns/op 5.2040 ns/op 1.16
Buffer.compare 16384 - random bytes 23.069 ns/op 17.249 ns/op 1.34
byteArrayEquals 123687377 - random bytes 7.7200 ns/op 6.5400 ns/op 1.18
Buffer.compare 123687377 - random bytes 21.880 ns/op 19.540 ns/op 1.12
regular array get 100000 times 37.709 us/op 43.041 us/op 0.88
wrappedArray get 100000 times 37.018 us/op 33.120 us/op 1.12
arrayWithProxy get 100000 times 15.669 ms/op 13.227 ms/op 1.18
ssz.Root.equals 52.913 ns/op 46.352 ns/op 1.14
byteArrayEquals 51.699 ns/op 45.626 ns/op 1.13
Buffer.compare 14.704 ns/op 10.537 ns/op 1.40
shuffle list - 16384 els 8.1590 ms/op 7.1106 ms/op 1.15
shuffle list - 250000 els 106.59 ms/op 95.573 ms/op 1.12
processSlot - 1 slots 19.003 us/op 14.749 us/op 1.29
processSlot - 32 slots 3.3361 ms/op 3.3153 ms/op 1.01
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 45.297 ms/op 42.351 ms/op 1.07
getCommitteeAssignments - req 1 vs - 250000 vc 2.3162 ms/op 2.1625 ms/op 1.07
getCommitteeAssignments - req 100 vs - 250000 vc 4.6243 ms/op 4.2040 ms/op 1.10
getCommitteeAssignments - req 1000 vs - 250000 vc 5.0357 ms/op 4.4082 ms/op 1.14
findModifiedValidators - 10000 modified validators 428.29 ms/op 277.39 ms/op 1.54
findModifiedValidators - 1000 modified validators 250.30 ms/op 170.70 ms/op 1.47
findModifiedValidators - 100 modified validators 277.59 ms/op 158.15 ms/op 1.76
findModifiedValidators - 10 modified validators 225.99 ms/op 147.52 ms/op 1.53
findModifiedValidators - 1 modified validators 211.57 ms/op 142.68 ms/op 1.48
findModifiedValidators - no difference 227.38 ms/op 165.41 ms/op 1.37
compare ViewDUs 3.8972 s/op 3.3283 s/op 1.17
compare each validator Uint8Array 1.7139 s/op 1.3650 s/op 1.26
compare ViewDU to Uint8Array 1.2800 s/op 1.0911 s/op 1.17
migrate state 1000000 validators, 24 modified, 0 new 959.82 ms/op 887.26 ms/op 1.08
migrate state 1000000 validators, 1700 modified, 1000 new 1.2984 s/op 1.1518 s/op 1.13
migrate state 1000000 validators, 3400 modified, 2000 new 1.6401 s/op 1.3457 s/op 1.22
migrate state 1500000 validators, 24 modified, 0 new 1.0828 s/op 957.34 ms/op 1.13
migrate state 1500000 validators, 1700 modified, 1000 new 1.2986 s/op 1.2070 s/op 1.08
migrate state 1500000 validators, 3400 modified, 2000 new 1.4814 s/op 1.4176 s/op 1.05
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.5100 ns/op 4.6700 ns/op 0.97
state getBlockRootAtSlot - 250000 vs - 7PWei 501.55 ns/op 521.28 ns/op 0.96
computeProposers - vc 250000 7.0721 ms/op 7.2309 ms/op 0.98
computeEpochShuffling - vc 250000 93.294 ms/op 92.561 ms/op 1.01
getNextSyncCommittee - vc 250000 116.91 ms/op 124.28 ms/op 0.94
computeSigningRoot for AttestationData 20.476 us/op 17.886 us/op 1.14
hash AttestationData serialized data then Buffer.toString(base64) 1.6080 us/op 1.5967 us/op 1.01
toHexString serialized data 891.76 ns/op 985.77 ns/op 0.90
Buffer.toString(base64) 180.53 ns/op 196.17 ns/op 0.92
nodejs block root to RootHex using toHex 154.11 ns/op 165.46 ns/op 0.93
nodejs block root to RootHex using toRootHex 93.296 ns/op 101.87 ns/op 0.92
browser block root to RootHex using the deprecated toHexString 225.34 ns/op 245.24 ns/op 0.92
browser block root to RootHex using toHex 180.18 ns/op 197.83 ns/op 0.91
browser block root to RootHex using toRootHex 158.87 ns/op 169.20 ns/op 0.94

by benchmarkbot/action

@@ -43,9 +44,12 @@ export async function verifyBlocksDataAvailability(
const availableBlockInputs: BlockInput[] = [];

for (const blockInput of blocks) {
if (signal.aborted) {
throw new ErrorAborted("verifyBlockStateTransitionOnly");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
throw new ErrorAborted("verifyBlockStateTransitionOnly");
throw new ErrorAborted("verifyBlocksDataAvailability");

const cutoffTimeout =
cutoffTime > 0
? new Promise((_resolve, reject) => {
setTimeout(reject, cutoffTime);
Copy link
Contributor

Choose a reason for hiding this comment

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

we should add reason to the reject functions, otherwise we'll get "undefined" reason which is very hard to debug

if (blobIdentifiers.length > 0) {
allBlobSidecars = await network.sendBlobSidecarsByRoot(peerId, blobIdentifiers);
const networkReqIdentifiers: deneb.BlobIdentifier[] = [];
if (executionEngine !== undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

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

IBeaconChain always has executionEngine so it should not be an optional param

if (executionEngine !== undefined) {
const signedBlockHeader = signedBlockToSignedHeader(config, block);
const versionedHashes = blobIdentifiersWithCommitments.map((bi) => kzgCommitmentToVersionedHash(bi.kzgCommitment));
const blobAndProofs = await executionEngine
Copy link
Contributor

Choose a reason for hiding this comment

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

executionEngine.getBlobs() should not be called inside this function because the consumer of this function (which is unknownBlock) has a loop over shuffled n peers, it would means that this function is called n times

Copy link
Contributor Author

@g11tech g11tech Oct 14, 2024

Choose a reason for hiding this comment

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

we can keep a flag that it has been called before but the main problem is that when we don't even know the block, we can't call this since we dont know versioned hashes, and we need to call this before start req/resp of blobs from the network

so the best way would be to just track it via a flag in pending blockinput

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually have locally modified it to use a pruneable fixed length cache, that gets populated whenever there is a "new" versioned hash to be queried (same tx in reorgs etc), testing that out

@@ -463,6 +465,17 @@ export class ExecutionEngineHttp implements IExecutionEngine {
return response.map(deserializeExecutionPayloadBody);
}

async getBlobs(_fork: ForkName, versionedHashes: VersionedHashes): Promise<(BlobAndProof | null)[]> {
Copy link
Member

Choose a reason for hiding this comment

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

if the EL does not have this api implemented yet it will always result in an error, from my observation when we implemented the client version api, this can lead to engine status switching from syncing to offline

const method = "engine_getBlobsV1";
assertReqSizeLimit(versionedHashes.length, 128);
const versionedHashesHex = versionedHashes.map(bytesToData);
const response = await this.rpc.fetchWithRetries<
Copy link
Member

Choose a reason for hiding this comment

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

we should probably stop trying to query this api if it failed earlier with specific code that method is not implemented and just return null

and since we wanna re-check if the EL is updated, could reset that behavior and retry querying if EL becomes online

this.logger.info("Execution client became online", {oldState, newState});
this.getClientVersion(getLodestarClientVersion(this.opts)).catch((e) => {
this.logger.debug("Unable to get execution client version", {}, e);
this.clientVersion = null;
});
break;

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.

Implement engine_getBlobsV1
4 participants