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

chore: fix verification of README code snippets #6868

Draft
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Jun 9, 2024

Motivation

Code snippets in README files are currently not validated, and some are broken. We should make sure that examples can be copy-pasted and are runnable

Description

Fix verification of README code snippets

There is a bug in typescript-docs-verifier which requires to have a override tsconfig per project and pass ts-node options in root as extends does not work.

Workaround can be removed once bbc/typescript-docs-verifier#31 is resolved.

Closes #6300

@@ -54,7 +54,7 @@ describe("web3_provider", function () {
mutateProvider: false,
});

const web3 = new Web3(nonVerifiedProvider);
const web3 = new Web3(verifiedProvider); //TODO: type is not compatible
Copy link
Member Author

@nflaig nflaig Jun 9, 2024

Choose a reason for hiding this comment

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

@nazarhussain the verifiedProvider is not compatible with what Web3 expects, and it's not clear to me why you would pass the nonVerifiedProvider provider as it is not mutated, meaning the prover is not used at all..

Same in the README, the example does not make sense to me.

Copy link
Contributor

github-actions bot commented Jun 9, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 9d9e361 Previous: 14855ea Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 945.76 us/op 842.05 us/op 1.12
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 40.393 us/op 49.203 us/op 0.82
BLS verify - blst-native 1.0690 ms/op 1.2079 ms/op 0.89
BLS verifyMultipleSignatures 3 - blst-native 2.3080 ms/op 2.5709 ms/op 0.90
BLS verifyMultipleSignatures 8 - blst-native 4.9606 ms/op 5.6705 ms/op 0.87
BLS verifyMultipleSignatures 32 - blst-native 18.306 ms/op 20.917 ms/op 0.88
BLS verifyMultipleSignatures 64 - blst-native 36.219 ms/op 41.047 ms/op 0.88
BLS verifyMultipleSignatures 128 - blst-native 73.798 ms/op 81.417 ms/op 0.91
BLS deserializing 10000 signatures 762.99 ms/op 841.72 ms/op 0.91
BLS deserializing 100000 signatures 7.7193 s/op 8.4261 s/op 0.92
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.1007 ms/op 1.2146 ms/op 0.91
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.2578 ms/op 1.3729 ms/op 0.92
BLS verifyMultipleSignatures - same message - 32 - blst-native 1.9615 ms/op 2.1451 ms/op 0.91
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.0833 ms/op 3.5655 ms/op 0.86
BLS verifyMultipleSignatures - same message - 128 - blst-native 4.9199 ms/op 5.3018 ms/op 0.93
BLS aggregatePubkeys 32 - blst-native 22.547 us/op 24.034 us/op 0.94
BLS aggregatePubkeys 128 - blst-native 87.958 us/op 94.785 us/op 0.93
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 54.923 ms/op 61.503 ms/op 0.89
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 40.406 ms/op 46.955 ms/op 0.86
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 26.788 ms/op 28.615 ms/op 0.94
getSlashingsAndExits - default max 71.479 us/op 74.700 us/op 0.96
getSlashingsAndExits - 2k 245.30 us/op 254.20 us/op 0.96
proposeBlockBody type=full, size=empty 4.6119 ms/op 4.9966 ms/op 0.92
isKnown best case - 1 super set check 500.00 ns/op 276.00 ns/op 1.81
isKnown normal case - 2 super set checks 470.00 ns/op 265.00 ns/op 1.77
isKnown worse case - 16 super set checks 467.00 ns/op 260.00 ns/op 1.80
InMemoryCheckpointStateCache - add get delete 5.2260 us/op 4.2220 us/op 1.24
validate api signedAggregateAndProof - struct 2.2591 ms/op 2.5720 ms/op 0.88
validate gossip signedAggregateAndProof - struct 2.2635 ms/op 2.5780 ms/op 0.88
validate gossip attestation - vc 640000 1.1055 ms/op 1.2431 ms/op 0.89
batch validate gossip attestation - vc 640000 - chunk 32 126.47 us/op 144.93 us/op 0.87
batch validate gossip attestation - vc 640000 - chunk 64 110.89 us/op 129.23 us/op 0.86
batch validate gossip attestation - vc 640000 - chunk 128 106.96 us/op 124.97 us/op 0.86
batch validate gossip attestation - vc 640000 - chunk 256 101.79 us/op 116.21 us/op 0.88
pickEth1Vote - no votes 818.01 us/op 1.0583 ms/op 0.77
pickEth1Vote - max votes 7.4232 ms/op 6.3184 ms/op 1.17
pickEth1Vote - Eth1Data hashTreeRoot value x2048 14.321 ms/op 11.337 ms/op 1.26
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 18.921 ms/op 14.968 ms/op 1.26
pickEth1Vote - Eth1Data fastSerialize value x2048 390.94 us/op 490.61 us/op 0.80
pickEth1Vote - Eth1Data fastSerialize tree x2048 6.3599 ms/op 6.7930 ms/op 0.94
bytes32 toHexString 594.00 ns/op 433.00 ns/op 1.37
bytes32 Buffer.toString(hex) 410.00 ns/op 245.00 ns/op 1.67
bytes32 Buffer.toString(hex) from Uint8Array 503.00 ns/op 355.00 ns/op 1.42
bytes32 Buffer.toString(hex) + 0x 416.00 ns/op 248.00 ns/op 1.68
Object access 1 prop 0.31600 ns/op 0.14700 ns/op 2.15
Map access 1 prop 0.31500 ns/op 0.13900 ns/op 2.27
Object get x1000 5.3500 ns/op 6.1760 ns/op 0.87
Map get x1000 6.3400 ns/op 6.6220 ns/op 0.96
Object set x1000 22.873 ns/op 33.838 ns/op 0.68
Map set x1000 18.883 ns/op 22.413 ns/op 0.84
Return object 10000 times 0.28910 ns/op 0.29050 ns/op 1.00
Throw Error 10000 times 2.6672 us/op 3.4325 us/op 0.78
fastMsgIdFn sha256 / 200 bytes 1.9840 us/op 2.1930 us/op 0.90
fastMsgIdFn h32 xxhash / 200 bytes 387.00 ns/op 231.00 ns/op 1.68
fastMsgIdFn h64 xxhash / 200 bytes 426.00 ns/op 271.00 ns/op 1.57
fastMsgIdFn sha256 / 1000 bytes 5.6960 us/op 7.4330 us/op 0.77
fastMsgIdFn h32 xxhash / 1000 bytes 485.00 ns/op 358.00 ns/op 1.35
fastMsgIdFn h64 xxhash / 1000 bytes 469.00 ns/op 342.00 ns/op 1.37
fastMsgIdFn sha256 / 10000 bytes 46.335 us/op 64.252 us/op 0.72
fastMsgIdFn h32 xxhash / 10000 bytes 1.7470 us/op 1.8140 us/op 0.96
fastMsgIdFn h64 xxhash / 10000 bytes 1.2110 us/op 1.1930 us/op 1.02
send data - 1000 256B messages 9.8394 ms/op 11.535 ms/op 0.85
send data - 1000 512B messages 12.649 ms/op 16.518 ms/op 0.77
send data - 1000 1024B messages 21.217 ms/op 25.909 ms/op 0.82
send data - 1000 1200B messages 23.220 ms/op 18.455 ms/op 1.26
send data - 1000 2048B messages 29.076 ms/op 31.063 ms/op 0.94
send data - 1000 4096B messages 26.004 ms/op 30.323 ms/op 0.86
send data - 1000 16384B messages 61.005 ms/op 68.164 ms/op 0.89
send data - 1000 65536B messages 235.19 ms/op 200.62 ms/op 1.17
enrSubnets - fastDeserialize 64 bits 1.1410 us/op 1.1120 us/op 1.03
enrSubnets - ssz BitVector 64 bits 504.00 ns/op 360.00 ns/op 1.40
enrSubnets - fastDeserialize 4 bits 325.00 ns/op 149.00 ns/op 2.18
enrSubnets - ssz BitVector 4 bits 504.00 ns/op 364.00 ns/op 1.38
prioritizePeers score -10:0 att 32-0.1 sync 2-0 125.09 us/op 138.86 us/op 0.90
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 168.22 us/op 170.04 us/op 0.99
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 256.82 us/op 236.54 us/op 1.09
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 524.38 us/op 385.47 us/op 1.36
prioritizePeers score 0:0 att 64-1 sync 4-1 641.14 us/op 585.45 us/op 1.10
array of 16000 items push then shift 1.2839 us/op 1.6180 us/op 0.79
LinkedList of 16000 items push then shift 6.1790 ns/op 7.2190 ns/op 0.86
array of 16000 items push then pop 76.496 ns/op 107.70 ns/op 0.71
LinkedList of 16000 items push then pop 6.0770 ns/op 7.1720 ns/op 0.85
array of 24000 items push then shift 1.9245 us/op 2.4083 us/op 0.80
LinkedList of 24000 items push then shift 6.6300 ns/op 7.3280 ns/op 0.90
array of 24000 items push then pop 105.89 ns/op 136.41 ns/op 0.78
LinkedList of 24000 items push then pop 6.3060 ns/op 7.2260 ns/op 0.87
intersect bitArray bitLen 8 5.3030 ns/op 6.4330 ns/op 0.82
intersect array and set length 8 41.139 ns/op 46.472 ns/op 0.89
intersect bitArray bitLen 128 25.830 ns/op 30.107 ns/op 0.86
intersect array and set length 128 590.33 ns/op 681.46 ns/op 0.87
bitArray.getTrueBitIndexes() bitLen 128 2.3000 us/op 1.6820 us/op 1.37
bitArray.getTrueBitIndexes() bitLen 248 2.9410 us/op 3.0670 us/op 0.96
bitArray.getTrueBitIndexes() bitLen 512 6.8870 us/op 6.1270 us/op 1.12
Buffer.concat 32 items 1.0350 us/op 943.00 ns/op 1.10
Uint8Array.set 32 items 1.6700 us/op 2.2540 us/op 0.74
Buffer.copy 1.7720 us/op 2.4630 us/op 0.72
Uint8Array.set - with subarray 2.4280 us/op 2.7140 us/op 0.89
Uint8Array.set - without subarray 1.6960 us/op 1.4970 us/op 1.13
Set add up to 64 items then delete first 1.8068 us/op 2.1437 us/op 0.84
OrderedSet add up to 64 items then delete first 2.8289 us/op 3.2881 us/op 0.86
Set add up to 64 items then delete last 2.0582 us/op 2.4138 us/op 0.85
OrderedSet add up to 64 items then delete last 3.2182 us/op 3.5351 us/op 0.91
Set add up to 64 items then delete middle 2.0891 us/op 2.4498 us/op 0.85
OrderedSet add up to 64 items then delete middle 4.5934 us/op 5.1130 us/op 0.90
Set add up to 128 items then delete first 4.0208 us/op 4.9645 us/op 0.81
OrderedSet add up to 128 items then delete first 6.0256 us/op 7.7510 us/op 0.78
Set add up to 128 items then delete last 4.0220 us/op 4.7724 us/op 0.84
OrderedSet add up to 128 items then delete last 6.2564 us/op 7.0127 us/op 0.89
Set add up to 128 items then delete middle 4.0178 us/op 4.7167 us/op 0.85
OrderedSet add up to 128 items then delete middle 11.621 us/op 13.335 us/op 0.87
Set add up to 256 items then delete first 7.9116 us/op 10.034 us/op 0.79
OrderedSet add up to 256 items then delete first 12.076 us/op 15.631 us/op 0.77
Set add up to 256 items then delete last 8.0378 us/op 9.5107 us/op 0.85
OrderedSet add up to 256 items then delete last 12.364 us/op 14.207 us/op 0.87
Set add up to 256 items then delete middle 7.8415 us/op 9.4065 us/op 0.83
OrderedSet add up to 256 items then delete middle 34.326 us/op 40.149 us/op 0.85
transfer serialized Status (84 B) 1.4050 us/op 1.4640 us/op 0.96
copy serialized Status (84 B) 1.2160 us/op 1.1640 us/op 1.04
transfer serialized SignedVoluntaryExit (112 B) 1.5270 us/op 1.6410 us/op 0.93
copy serialized SignedVoluntaryExit (112 B) 1.2780 us/op 1.2030 us/op 1.06
transfer serialized ProposerSlashing (416 B) 2.2100 us/op 2.0550 us/op 1.08
copy serialized ProposerSlashing (416 B) 1.8620 us/op 1.5090 us/op 1.23
transfer serialized Attestation (485 B) 1.9960 us/op 1.6050 us/op 1.24
copy serialized Attestation (485 B) 1.9520 us/op 1.5750 us/op 1.24
transfer serialized AttesterSlashing (33232 B) 2.7120 us/op 2.0270 us/op 1.34
copy serialized AttesterSlashing (33232 B) 4.2630 us/op 4.8730 us/op 0.87
transfer serialized Small SignedBeaconBlock (128000 B) 2.5610 us/op 2.7450 us/op 0.93
copy serialized Small SignedBeaconBlock (128000 B) 9.7220 us/op 14.011 us/op 0.69
transfer serialized Avg SignedBeaconBlock (200000 B) 3.2140 us/op 3.3640 us/op 0.96
copy serialized Avg SignedBeaconBlock (200000 B) 13.676 us/op 21.251 us/op 0.64
transfer serialized BlobsSidecar (524380 B) 3.0210 us/op 3.1320 us/op 0.96
copy serialized BlobsSidecar (524380 B) 126.43 us/op 88.126 us/op 1.43
transfer serialized Big SignedBeaconBlock (1000000 B) 3.1980 us/op 3.0010 us/op 1.07
copy serialized Big SignedBeaconBlock (1000000 B) 143.01 us/op 143.00 us/op 1.00
pass gossip attestations to forkchoice per slot 2.5746 ms/op 2.9812 ms/op 0.86
forkChoice updateHead vc 100000 bc 64 eq 0 465.63 us/op 487.16 us/op 0.96
forkChoice updateHead vc 600000 bc 64 eq 0 2.3975 ms/op 3.0584 ms/op 0.78
forkChoice updateHead vc 1000000 bc 64 eq 0 4.1009 ms/op 5.2555 ms/op 0.78
forkChoice updateHead vc 600000 bc 320 eq 0 2.5182 ms/op 3.5567 ms/op 0.71
forkChoice updateHead vc 600000 bc 1200 eq 0 2.3270 ms/op 3.0360 ms/op 0.77
forkChoice updateHead vc 600000 bc 7200 eq 0 2.7420 ms/op 3.4649 ms/op 0.79
forkChoice updateHead vc 600000 bc 64 eq 1000 8.9200 ms/op 10.461 ms/op 0.85
forkChoice updateHead vc 600000 bc 64 eq 10000 9.3539 ms/op 10.841 ms/op 0.86
forkChoice updateHead vc 600000 bc 64 eq 300000 11.662 ms/op 14.722 ms/op 0.79
computeDeltas 500000 validators 300 proto nodes 3.0098 ms/op 3.4851 ms/op 0.86
computeDeltas 500000 validators 1200 proto nodes 3.1511 ms/op 3.5093 ms/op 0.90
computeDeltas 500000 validators 7200 proto nodes 3.1103 ms/op 3.5005 ms/op 0.89
computeDeltas 750000 validators 300 proto nodes 4.3457 ms/op 5.1852 ms/op 0.84
computeDeltas 750000 validators 1200 proto nodes 4.4321 ms/op 5.1219 ms/op 0.87
computeDeltas 750000 validators 7200 proto nodes 4.5101 ms/op 5.1559 ms/op 0.87
computeDeltas 1400000 validators 300 proto nodes 8.3330 ms/op 9.5973 ms/op 0.87
computeDeltas 1400000 validators 1200 proto nodes 8.2608 ms/op 9.8207 ms/op 0.84
computeDeltas 1400000 validators 7200 proto nodes 8.2392 ms/op 9.7398 ms/op 0.85
computeDeltas 2100000 validators 300 proto nodes 11.928 ms/op 14.557 ms/op 0.82
computeDeltas 2100000 validators 1200 proto nodes 11.995 ms/op 14.673 ms/op 0.82
computeDeltas 2100000 validators 7200 proto nodes 12.050 ms/op 14.723 ms/op 0.82
altair processAttestation - 250000 vs - 7PWei normalcase 1.2926 ms/op 1.7706 ms/op 0.73
altair processAttestation - 250000 vs - 7PWei worstcase 2.0841 ms/op 2.4851 ms/op 0.84
altair processAttestation - setStatus - 1/6 committees join 67.514 us/op 93.452 us/op 0.72
altair processAttestation - setStatus - 1/3 committees join 126.45 us/op 176.08 us/op 0.72
altair processAttestation - setStatus - 1/2 committees join 184.44 us/op 254.38 us/op 0.73
altair processAttestation - setStatus - 2/3 committees join 248.38 us/op 327.96 us/op 0.76
altair processAttestation - setStatus - 4/5 committees join 392.85 us/op 526.38 us/op 0.75
altair processAttestation - setStatus - 100% committees join 463.09 us/op 589.53 us/op 0.79
altair processBlock - 250000 vs - 7PWei normalcase 3.3389 ms/op 5.2086 ms/op 0.64
altair processBlock - 250000 vs - 7PWei normalcase hashState 28.007 ms/op 26.457 ms/op 1.06
altair processBlock - 250000 vs - 7PWei worstcase 40.821 ms/op 46.450 ms/op 0.88
altair processBlock - 250000 vs - 7PWei worstcase hashState 79.299 ms/op 90.511 ms/op 0.88
phase0 processBlock - 250000 vs - 7PWei normalcase 1.7266 ms/op 2.3637 ms/op 0.73
phase0 processBlock - 250000 vs - 7PWei worstcase 22.230 ms/op 30.508 ms/op 0.73
altair processEth1Data - 250000 vs - 7PWei normalcase 231.89 us/op 418.59 us/op 0.55
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 4.3870 us/op 8.3980 us/op 0.52
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 16.592 us/op 35.366 us/op 0.47
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 6.7240 us/op 13.356 us/op 0.50
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 6.7510 us/op 9.6500 us/op 0.70
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 75.701 us/op 141.66 us/op 0.53
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 750.15 us/op 762.32 us/op 0.98
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.1277 ms/op 1.0140 ms/op 1.11
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 713.76 us/op 949.03 us/op 0.75
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 1.6561 ms/op 2.5009 ms/op 0.66
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.2251 ms/op 1.8269 ms/op 0.67
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 2.7623 ms/op 4.3170 ms/op 0.64
Tree 40 250000 create 171.65 ms/op 279.38 ms/op 0.61
Tree 40 250000 get(125000) 111.78 ns/op 162.63 ns/op 0.69
Tree 40 250000 set(125000) 527.36 ns/op 924.03 ns/op 0.57
Tree 40 250000 toArray() 9.7673 ms/op 22.598 ms/op 0.43
Tree 40 250000 iterate all - toArray() + loop 9.8028 ms/op 22.773 ms/op 0.43
Tree 40 250000 iterate all - get(i) 39.675 ms/op 61.348 ms/op 0.65
MutableVector 250000 create 11.568 ms/op 9.2495 ms/op 1.25
MutableVector 250000 get(125000) 5.7550 ns/op 6.5090 ns/op 0.88
MutableVector 250000 set(125000) 166.27 ns/op 278.30 ns/op 0.60
MutableVector 250000 toArray() 2.5683 ms/op 5.0603 ms/op 0.51
MutableVector 250000 iterate all - toArray() + loop 2.6657 ms/op 5.2390 ms/op 0.51
MutableVector 250000 iterate all - get(i) 1.3982 ms/op 1.7054 ms/op 0.82
Array 250000 create 2.2822 ms/op 4.5569 ms/op 0.50
Array 250000 clone - spread 1.2079 ms/op 2.0674 ms/op 0.58
Array 250000 get(125000) 0.56700 ns/op 0.45300 ns/op 1.25
Array 250000 set(125000) 0.57900 ns/op 0.47900 ns/op 1.21
Array 250000 iterate all - loop 75.826 us/op 92.013 us/op 0.82
effectiveBalanceIncrements clone Uint8Array 300000 13.109 us/op 61.230 us/op 0.21
effectiveBalanceIncrements clone MutableVector 300000 315.00 ns/op 129.00 ns/op 2.44
effectiveBalanceIncrements rw all Uint8Array 300000 164.59 us/op 210.89 us/op 0.78
effectiveBalanceIncrements rw all MutableVector 300000 54.302 ms/op 105.54 ms/op 0.51
phase0 afterProcessEpoch - 250000 vs - 7PWei 72.982 ms/op 92.492 ms/op 0.79
phase0 beforeProcessEpoch - 250000 vs - 7PWei 41.154 ms/op 46.613 ms/op 0.88
altair processEpoch - mainnet_e81889 361.77 ms/op 392.78 ms/op 0.92
mainnet_e81889 - altair beforeProcessEpoch 58.092 ms/op 61.640 ms/op 0.94
mainnet_e81889 - altair processJustificationAndFinalization 5.1720 us/op 21.905 us/op 0.24
mainnet_e81889 - altair processInactivityUpdates 4.9450 ms/op 7.5334 ms/op 0.66
mainnet_e81889 - altair processRewardsAndPenalties 51.017 ms/op 45.497 ms/op 1.12
mainnet_e81889 - altair processRegistryUpdates 2.0490 us/op 2.5480 us/op 0.80
mainnet_e81889 - altair processSlashings 764.00 ns/op 530.00 ns/op 1.44
mainnet_e81889 - altair processEth1DataReset 749.00 ns/op 608.00 ns/op 1.23
mainnet_e81889 - altair processEffectiveBalanceUpdates 857.00 us/op 1.1493 ms/op 0.75
mainnet_e81889 - altair processSlashingsReset 1.3130 us/op 3.1740 us/op 0.41
mainnet_e81889 - altair processRandaoMixesReset 2.3100 us/op 5.5650 us/op 0.42
mainnet_e81889 - altair processHistoricalRootsUpdate 663.00 ns/op 783.00 ns/op 0.85
mainnet_e81889 - altair processParticipationFlagUpdates 1.3130 us/op 3.1410 us/op 0.42
mainnet_e81889 - altair processSyncCommitteeUpdates 469.00 ns/op 549.00 ns/op 0.85
mainnet_e81889 - altair afterProcessEpoch 76.158 ms/op 92.816 ms/op 0.82
capella processEpoch - mainnet_e217614 1.2316 s/op 1.2345 s/op 1.00
mainnet_e217614 - capella beforeProcessEpoch 230.31 ms/op 236.79 ms/op 0.97
mainnet_e217614 - capella processJustificationAndFinalization 5.8680 us/op 11.829 us/op 0.50
mainnet_e217614 - capella processInactivityUpdates 14.266 ms/op 15.970 ms/op 0.89
mainnet_e217614 - capella processRewardsAndPenalties 264.59 ms/op 227.46 ms/op 1.16
mainnet_e217614 - capella processRegistryUpdates 12.082 us/op 12.385 us/op 0.98
mainnet_e217614 - capella processSlashings 776.00 ns/op 369.00 ns/op 2.10
mainnet_e217614 - capella processEth1DataReset 717.00 ns/op 300.00 ns/op 2.39
mainnet_e217614 - capella processEffectiveBalanceUpdates 3.8151 ms/op 10.264 ms/op 0.37
mainnet_e217614 - capella processSlashingsReset 1.5450 us/op 4.0940 us/op 0.38
mainnet_e217614 - capella processRandaoMixesReset 3.0930 us/op 4.3870 us/op 0.71
mainnet_e217614 - capella processHistoricalRootsUpdate 678.00 ns/op 545.00 ns/op 1.24
mainnet_e217614 - capella processParticipationFlagUpdates 1.9900 us/op 2.0690 us/op 0.96
mainnet_e217614 - capella afterProcessEpoch 234.27 ms/op 273.22 ms/op 0.86
phase0 processEpoch - mainnet_e58758 323.20 ms/op 354.60 ms/op 0.91
mainnet_e58758 - phase0 beforeProcessEpoch 90.011 ms/op 110.45 ms/op 0.81
mainnet_e58758 - phase0 processJustificationAndFinalization 12.860 us/op 13.981 us/op 0.92
mainnet_e58758 - phase0 processRewardsAndPenalties 31.381 ms/op 34.802 ms/op 0.90
mainnet_e58758 - phase0 processRegistryUpdates 3.7700 us/op 7.3380 us/op 0.51
mainnet_e58758 - phase0 processSlashings 650.00 ns/op 383.00 ns/op 1.70
mainnet_e58758 - phase0 processEth1DataReset 662.00 ns/op 329.00 ns/op 2.01
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.0701 ms/op 956.28 us/op 1.12
mainnet_e58758 - phase0 processSlashingsReset 1.4260 us/op 2.3900 us/op 0.60
mainnet_e58758 - phase0 processRandaoMixesReset 3.5030 us/op 3.6900 us/op 0.95
mainnet_e58758 - phase0 processHistoricalRootsUpdate 723.00 ns/op 318.00 ns/op 2.27
mainnet_e58758 - phase0 processParticipationRecordUpdates 5.9890 us/op 2.5460 us/op 2.35
mainnet_e58758 - phase0 afterProcessEpoch 66.229 ms/op 74.238 ms/op 0.89
phase0 processEffectiveBalanceUpdates - 250000 normalcase 798.68 us/op 1.4607 ms/op 0.55
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.3054 ms/op 2.0003 ms/op 0.65
altair processInactivityUpdates - 250000 normalcase 18.129 ms/op 15.835 ms/op 1.14
altair processInactivityUpdates - 250000 worstcase 16.388 ms/op 16.143 ms/op 1.02
phase0 processRegistryUpdates - 250000 normalcase 3.1190 us/op 6.3070 us/op 0.49
phase0 processRegistryUpdates - 250000 badcase_full_deposits 270.41 us/op 231.80 us/op 1.17
phase0 processRegistryUpdates - 250000 worstcase 0.5 111.84 ms/op 116.32 ms/op 0.96
altair processRewardsAndPenalties - 250000 normalcase 39.467 ms/op 37.578 ms/op 1.05
altair processRewardsAndPenalties - 250000 worstcase 42.307 ms/op 41.204 ms/op 1.03
phase0 getAttestationDeltas - 250000 normalcase 5.6610 ms/op 6.7671 ms/op 0.84
phase0 getAttestationDeltas - 250000 worstcase 5.6291 ms/op 6.9649 ms/op 0.81
phase0 processSlashings - 250000 worstcase 79.983 us/op 73.997 us/op 1.08
altair processSyncCommitteeUpdates - 250000 94.504 ms/op 125.84 ms/op 0.75
BeaconState.hashTreeRoot - No change 466.00 ns/op 255.00 ns/op 1.83
BeaconState.hashTreeRoot - 1 full validator 112.81 us/op 126.88 us/op 0.89
BeaconState.hashTreeRoot - 32 full validator 1.1287 ms/op 1.2624 ms/op 0.89
BeaconState.hashTreeRoot - 512 full validator 13.668 ms/op 10.467 ms/op 1.31
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 128.66 us/op 135.96 us/op 0.95
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.6620 ms/op 1.8717 ms/op 0.89
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 23.790 ms/op 23.458 ms/op 1.01
BeaconState.hashTreeRoot - 1 balances 93.672 us/op 106.47 us/op 0.88
BeaconState.hashTreeRoot - 32 balances 1.0707 ms/op 1.1359 ms/op 0.94
BeaconState.hashTreeRoot - 512 balances 8.4796 ms/op 7.7953 ms/op 1.09
BeaconState.hashTreeRoot - 250000 balances 166.21 ms/op 176.76 ms/op 0.94
aggregationBits - 2048 els - zipIndexesInBitList 20.509 us/op 23.203 us/op 0.88
byteArrayEquals 32 49.261 ns/op 53.282 ns/op 0.92
Buffer.compare 32 35.402 ns/op 45.654 ns/op 0.78
byteArrayEquals 1024 1.2055 us/op 1.5768 us/op 0.76
Buffer.compare 1024 41.233 ns/op 54.460 ns/op 0.76
byteArrayEquals 16384 19.150 us/op 25.061 us/op 0.76
Buffer.compare 16384 222.34 ns/op 223.47 ns/op 0.99
byteArrayEquals 123687377 145.72 ms/op 189.06 ms/op 0.77
Buffer.compare 123687377 3.6197 ms/op 6.0588 ms/op 0.60
byteArrayEquals 32 - diff last byte 46.337 ns/op 52.127 ns/op 0.89
Buffer.compare 32 - diff last byte 39.144 ns/op 46.241 ns/op 0.85
byteArrayEquals 1024 - diff last byte 1.2371 us/op 1.5704 us/op 0.79
Buffer.compare 1024 - diff last byte 47.317 ns/op 53.448 ns/op 0.89
byteArrayEquals 16384 - diff last byte 19.653 us/op 25.051 us/op 0.78
Buffer.compare 16384 - diff last byte 216.35 ns/op 241.30 ns/op 0.90
byteArrayEquals 123687377 - diff last byte 148.04 ms/op 189.00 ms/op 0.78
Buffer.compare 123687377 - diff last byte 3.6594 ms/op 6.2463 ms/op 0.59
byteArrayEquals 32 - random bytes 4.7950 ns/op 5.1380 ns/op 0.93
Buffer.compare 32 - random bytes 39.489 ns/op 47.990 ns/op 0.82
byteArrayEquals 1024 - random bytes 4.8120 ns/op 5.0880 ns/op 0.95
Buffer.compare 1024 - random bytes 38.892 ns/op 45.994 ns/op 0.85
byteArrayEquals 16384 - random bytes 4.7930 ns/op 5.1110 ns/op 0.94
Buffer.compare 16384 - random bytes 38.650 ns/op 46.084 ns/op 0.84
byteArrayEquals 123687377 - random bytes 7.5800 ns/op 6.3300 ns/op 1.20
Buffer.compare 123687377 - random bytes 42.270 ns/op 47.340 ns/op 0.89
regular array get 100000 times 30.093 us/op 35.354 us/op 0.85
wrappedArray get 100000 times 30.098 us/op 32.711 us/op 0.92
arrayWithProxy get 100000 times 9.7666 ms/op 12.692 ms/op 0.77
ssz.Root.equals 42.533 ns/op 45.640 ns/op 0.93
byteArrayEquals 41.901 ns/op 44.980 ns/op 0.93
Buffer.compare 9.5780 ns/op 10.348 ns/op 0.93
shuffle list - 16384 els 5.5915 ms/op 6.1637 ms/op 0.91
shuffle list - 250000 els 82.642 ms/op 89.758 ms/op 0.92
processSlot - 1 slots 14.959 us/op 13.595 us/op 1.10
processSlot - 32 slots 3.4619 ms/op 2.7954 ms/op 1.24
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 44.160 ms/op 37.215 ms/op 1.19
getCommitteeAssignments - req 1 vs - 250000 vc 1.7870 ms/op 2.1280 ms/op 0.84
getCommitteeAssignments - req 100 vs - 250000 vc 3.4703 ms/op 4.1202 ms/op 0.84
getCommitteeAssignments - req 1000 vs - 250000 vc 3.7051 ms/op 4.3665 ms/op 0.85
findModifiedValidators - 10000 modified validators 238.68 ms/op 254.87 ms/op 0.94
findModifiedValidators - 1000 modified validators 143.99 ms/op 173.24 ms/op 0.83
findModifiedValidators - 100 modified validators 135.73 ms/op 152.58 ms/op 0.89
findModifiedValidators - 10 modified validators 135.22 ms/op 147.90 ms/op 0.91
findModifiedValidators - 1 modified validators 141.88 ms/op 156.53 ms/op 0.91
findModifiedValidators - no difference 143.04 ms/op 144.44 ms/op 0.99
compare ViewDUs 3.1250 s/op 2.9063 s/op 1.08
compare each validator Uint8Array 1.4050 s/op 1.5876 s/op 0.88
compare ViewDU to Uint8Array 670.47 ms/op 1.0114 s/op 0.66
migrate state 1000000 validators, 24 modified, 0 new 588.18 ms/op 596.63 ms/op 0.99
migrate state 1000000 validators, 1700 modified, 1000 new 829.10 ms/op 798.65 ms/op 1.04
migrate state 1000000 validators, 3400 modified, 2000 new 1.0243 s/op 1.0478 s/op 0.98
migrate state 1500000 validators, 24 modified, 0 new 572.25 ms/op 626.04 ms/op 0.91
migrate state 1500000 validators, 1700 modified, 1000 new 814.32 ms/op 861.33 ms/op 0.95
migrate state 1500000 validators, 3400 modified, 2000 new 1.0126 s/op 1.0388 s/op 0.97
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.9000 ns/op 4.3000 ns/op 1.37
state getBlockRootAtSlot - 250000 vs - 7PWei 655.90 ns/op 496.24 ns/op 1.32
computeProposers - vc 250000 5.8067 ms/op 8.4079 ms/op 0.69
computeEpochShuffling - vc 250000 81.685 ms/op 97.198 ms/op 0.84
getNextSyncCommittee - vc 250000 95.165 ms/op 141.07 ms/op 0.67
computeSigningRoot for AttestationData 23.605 us/op 23.717 us/op 1.00
hash AttestationData serialized data then Buffer.toString(base64) 1.1231 us/op 1.5014 us/op 0.75
toHexString serialized data 769.95 ns/op 898.40 ns/op 0.86
Buffer.toString(base64) 138.31 ns/op 195.60 ns/op 0.71

by benchmarkbot/action

{
"extends": "../../tsconfig.json",
"compilerOptions": {},
// `typescript-docs-verifier` uses `ts-node` to compile README snippets
Copy link
Contributor

Choose a reason for hiding this comment

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

If you want to add comments in JSON, rename those to .jsoc extension so it does not highlight as error.

Copy link
Member Author

Choose a reason for hiding this comment

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

that's really only highlighted this way in the diff, we have comments in other tsconfig files as well

lodestar/tsconfig.json

Lines 12 to 15 in 14855ea

// We want to speed up the CI run for all tests, which require us to use the
// `transpileOnly` mode for the `ts-node`. This change requires to treat types for each module
// independently, which is done by setting the `isolatedModules` flag to `true`.
"isolatedModules": true,

tsconfig itself supports comments as is, might be able to remove this if upstream issue is fixed

@@ -54,7 +54,7 @@ describe("web3_provider", function () {
mutateProvider: false,
});

const web3 = new Web3(nonVerifiedProvider);
const web3 = new Web3(verifiedProvider); //TODO: type is not compatible
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
const web3 = new Web3(verifiedProvider); //TODO: type is not compatible
const web3 = new Web3(nonVerifiedProvider);

Copy link
Contributor

Choose a reason for hiding this comment

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

Because we want to get the accounts via normal RPC and then verify it through our ELRpc object.

Copy link
Member Author

Choose a reason for hiding this comment

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

the examples in the README show otherwise

Copy link
Member Author

@nflaig nflaig Jun 10, 2024

Choose a reason for hiding this comment

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

as per README we pass the verifiedProvider to Web3 but the types are not compatible, the example in the README does not work

const web3 = new Web3(provider);

// and hence it is required to disable `transpileOnly` mode as it disables
// all type checks. Set at root to be directly forwarded to `ts-node` until
// https://github.com/bbc/typescript-docs-verifier/issues/31 is resolved
"transpileOnly": false
Copy link
Contributor

Choose a reason for hiding this comment

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

If you want to set this it should go under ts-node not on the root level.

"ts-node": {
   "transpileOnly": true
}

Copy link
Contributor

Choose a reason for hiding this comment

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

This made me think if that config is actually have any effect or not.

Copy link
Member Author

Choose a reason for hiding this comment

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

this is passed directly to ts-node by the typescript-docs-verifier module that's why it has to be in root, see code comment and issue bbc/typescript-docs-verifier#31

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.

Fix yarn check-readme
2 participants