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: support capella fork on simpleserialize.com #321

Merged
merged 4 commits into from
May 3, 2023

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented May 2, 2023

Motivation

Closes #320

Description

  • Add capella fork types
  • Use @lodestar/types package instead of @chainsafe/lodestar-types
  • Update consensus spec version to 1.3.0
  • Set capella as default fork instead of phase0
  • Add webpack config rules to fix build issues

@CLAassistant
Copy link

CLAassistant commented May 2, 2023

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@nflaig nflaig marked this pull request as ready for review May 2, 2023 13:25
@nflaig nflaig requested a review from a team as a code owner May 2, 2023 13:25
@github-actions
Copy link

github-actions bot commented May 2, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 921d110 Previous: 46dee18 Ratio
digestTwoHashObjects 50023 times 57.935 ms/op 73.482 ms/op 0.79
digest64 50023 times 59.999 ms/op 72.690 ms/op 0.83
digest 50023 times 59.976 ms/op 71.981 ms/op 0.83
input length 32 1.5030 us/op 1.7910 us/op 0.84
input length 64 1.6190 us/op 1.9380 us/op 0.84
input length 128 2.8370 us/op 3.3650 us/op 0.84
input length 256 4.1670 us/op 5.0020 us/op 0.83
input length 512 6.9060 us/op 8.1290 us/op 0.85
input length 1024 13.517 us/op 16.154 us/op 0.84
digest 1000000 times 1.0389 s/op 1.2377 s/op 0.84
hashObjectToByteArray 50023 times 2.3848 ms/op 2.8553 ms/op 0.84
byteArrayToHashObject 50023 times 2.9756 ms/op 3.5048 ms/op 0.85
getGindicesAtDepth 6.5380 us/op 7.5140 us/op 0.87
iterateAtDepth 13.012 us/op 15.101 us/op 0.86
getGindexBits 625.00 ns/op 692.00 ns/op 0.90
gindexIterator 1.3370 us/op 1.5750 us/op 0.85
hash 2 Uint8Array 2250026 times - as-sha256 2.7443 s/op 3.2676 s/op 0.84
hashTwoObjects 2250026 times - as-sha256 2.6302 s/op 3.1457 s/op 0.84
hash 2 Uint8Array 2250026 times - noble 7.2854 s/op 11.157 s/op 0.65
hashTwoObjects 2250026 times - noble 11.770 s/op 14.060 s/op 0.84
getNodeH() x7812.5 avg hindex 21.084 us/op 29.553 us/op 0.71
getNodeH() x7812.5 index 0 8.3050 us/op 10.521 us/op 0.79
getNodeH() x7812.5 index 7 8.3040 us/op 10.496 us/op 0.79
getNodeH() x7812.5 index 7 with key array 8.3690 us/op 10.582 us/op 0.79
new LeafNode() x7812.5 219.10 us/op 357.00 us/op 0.61
multiproof - depth 15, 1 requested leaves 14.086 us/op 18.819 us/op 0.75
tree offset multiproof - depth 15, 1 requested leaves 30.009 us/op 41.209 us/op 0.73
compact multiproof - depth 15, 1 requested leaves 9.2780 us/op 10.233 us/op 0.91
multiproof - depth 15, 2 requested leaves 20.924 us/op 24.520 us/op 0.85
tree offset multiproof - depth 15, 2 requested leaves 36.614 us/op 42.086 us/op 0.87
compact multiproof - depth 15, 2 requested leaves 5.0280 us/op 5.5980 us/op 0.90
multiproof - depth 15, 3 requested leaves 29.197 us/op 37.057 us/op 0.79
tree offset multiproof - depth 15, 3 requested leaves 47.178 us/op 57.983 us/op 0.81
compact multiproof - depth 15, 3 requested leaves 8.2070 us/op 11.342 us/op 0.72
multiproof - depth 15, 4 requested leaves 36.402 us/op 46.399 us/op 0.78
tree offset multiproof - depth 15, 4 requested leaves 57.219 us/op 70.028 us/op 0.82
compact multiproof - depth 15, 4 requested leaves 10.576 us/op 11.737 us/op 0.90
packedRootsBytesToLeafNodes bytes 4000 offset 0 4.0230 us/op 4.2180 us/op 0.95
packedRootsBytesToLeafNodes bytes 4000 offset 1 3.9890 us/op 4.2700 us/op 0.93
packedRootsBytesToLeafNodes bytes 4000 offset 2 4.0400 us/op 4.3860 us/op 0.92
packedRootsBytesToLeafNodes bytes 4000 offset 3 3.9910 us/op 4.3410 us/op 0.92
subtreeFillToContents depth 40 count 250000 92.913 ms/op 102.98 ms/op 0.90
setRoot - gindexBitstring 15.644 ms/op 17.151 ms/op 0.91
setRoot - gindex 16.577 ms/op 19.465 ms/op 0.85
getRoot - gindexBitstring 3.7158 ms/op 4.6513 ms/op 0.80
getRoot - gindex 4.5083 ms/op 5.5455 ms/op 0.81
getHashObject then setHashObject 18.759 ms/op 19.217 ms/op 0.98
setNodeWithFn 15.895 ms/op 20.222 ms/op 0.79
getNodeAtDepth depth 0 x100000 2.2633 ms/op 2.7657 ms/op 0.82
setNodeAtDepth depth 0 x100000 5.4667 ms/op 5.2287 ms/op 1.05
getNodesAtDepth depth 0 x100000 1.8523 ms/op 2.1662 ms/op 0.86
setNodesAtDepth depth 0 x100000 2.4982 ms/op 3.0780 ms/op 0.81
getNodeAtDepth depth 1 x100000 2.3228 ms/op 2.8524 ms/op 0.81
setNodeAtDepth depth 1 x100000 11.831 ms/op 11.121 ms/op 1.06
getNodesAtDepth depth 1 x100000 2.0199 ms/op 2.4207 ms/op 0.83
setNodesAtDepth depth 1 x100000 8.6148 ms/op 10.356 ms/op 0.83
getNodeAtDepth depth 2 x100000 2.8136 ms/op 3.3520 ms/op 0.84
setNodeAtDepth depth 2 x100000 16.875 ms/op 18.902 ms/op 0.89
getNodesAtDepth depth 2 x100000 29.290 ms/op 33.032 ms/op 0.89
setNodesAtDepth depth 2 x100000 23.844 ms/op 24.027 ms/op 0.99
tree.getNodesAtDepth - gindexes 10.525 ms/op 10.088 ms/op 1.04
tree.getNodesAtDepth - push all nodes 3.0002 ms/op 3.1162 ms/op 0.96
tree.getNodesAtDepth - navigation 170.20 us/op 201.72 us/op 0.84
tree.setNodesAtDepth - indexes 596.09 us/op 674.69 us/op 0.88
set at depth 8 869.00 ns/op 843.00 ns/op 1.03
set at depth 16 1.1690 us/op 1.0980 us/op 1.06
set at depth 32 1.9180 us/op 1.7810 us/op 1.08
iterateNodesAtDepth 8 256 23.569 us/op 27.831 us/op 0.85
getNodesAtDepth 8 256 6.0820 us/op 6.9560 us/op 0.87
iterateNodesAtDepth 16 65536 6.8041 ms/op 7.9510 ms/op 0.86
getNodesAtDepth 16 65536 2.6790 ms/op 3.0644 ms/op 0.87
iterateNodesAtDepth 32 250000 25.070 ms/op 29.789 ms/op 0.84
getNodesAtDepth 32 250000 7.5409 ms/op 9.1581 ms/op 0.82
iterateNodesAtDepth 40 250000 25.067 ms/op 29.687 ms/op 0.84
getNodesAtDepth 40 250000 7.4057 ms/op 9.6536 ms/op 0.77
250k validators 12.397 s/op 13.968 s/op 0.89
bitlist bytes to struct (120,90) 942.00 ns/op 1.2060 us/op 0.78
bitlist bytes to tree (120,90) 4.1200 us/op 4.7990 us/op 0.86
bitlist bytes to struct (2048,2048) 2.0770 us/op 2.4480 us/op 0.85
bitlist bytes to tree (2048,2048) 7.1840 us/op 9.1290 us/op 0.79
ByteListType - deserialize 19.426 ms/op 21.784 ms/op 0.89
BasicListType - deserialize 15.572 ms/op 22.098 ms/op 0.70
ByteListType - serialize 19.246 ms/op 23.220 ms/op 0.83
BasicListType - serialize 22.740 ms/op 26.676 ms/op 0.85
BasicListType - tree_convertToStruct 48.300 ms/op 51.976 ms/op 0.93
List[uint8, 68719476736] len 300000 ViewDU.getAll() + iterate 5.8204 ms/op 7.3430 ms/op 0.79
List[uint8, 68719476736] len 300000 ViewDU.get(i) 6.3289 ms/op 7.5966 ms/op 0.83
Array.push len 300000 empty Array - number 9.3489 ms/op 10.728 ms/op 0.87
Array.set len 300000 from new Array - number 2.4201 ms/op 3.2418 ms/op 0.75
Array.set len 300000 - number 8.2416 ms/op 10.523 ms/op 0.78
Uint8Array.set len 300000 265.01 us/op 332.64 us/op 0.80
Uint32Array.set len 300000 431.76 us/op 483.37 us/op 0.89
Container({a: uint8, b: uint8}) getViewDU x300000 38.281 ms/op 41.927 ms/op 0.91
ContainerNodeStruct({a: uint8, b: uint8}) getViewDU x300000 13.315 ms/op 15.398 ms/op 0.86
List(Container) len 300000 ViewDU.getAllReadonly() + iterate 412.20 ms/op 678.96 ms/op 0.61
List(Container) len 300000 ViewDU.getAllReadonlyValues() + iterate 508.67 ms/op 551.05 ms/op 0.92
List(Container) len 300000 ViewDU.get(i) 13.312 ms/op 15.504 ms/op 0.86
List(Container) len 300000 ViewDU.getReadonly(i) 12.987 ms/op 12.579 ms/op 1.03
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonly() + iterate 60.142 ms/op 68.769 ms/op 0.87
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonlyValues() + iterate 9.6279 ms/op 10.332 ms/op 0.93
List(ContainerNodeStruct) len 300000 ViewDU.get(i) 13.126 ms/op 11.703 ms/op 1.12
List(ContainerNodeStruct) len 300000 ViewDU.getReadonly(i) 12.673 ms/op 12.848 ms/op 0.99
Array.push len 300000 empty Array - object 8.8293 ms/op 10.053 ms/op 0.88
Array.set len 300000 from new Array - object 2.8515 ms/op 4.3041 ms/op 0.66
Array.set len 300000 - object 9.5856 ms/op 10.066 ms/op 0.95
cachePermanentRootStruct no cache 12.464 us/op 14.533 us/op 0.86
cachePermanentRootStruct with cache 311.00 ns/op 360.00 ns/op 0.86
epochParticipation len 250000 rws 7813 3.3143 ms/op 3.8767 ms/op 0.85
deserialize Attestation - tree 4.4310 us/op 5.9050 us/op 0.75
deserialize Attestation - struct 3.0860 us/op 3.7310 us/op 0.83
deserialize SignedAggregateAndProof - tree 5.8860 us/op 7.0570 us/op 0.83
deserialize SignedAggregateAndProof - struct 5.1220 us/op 5.7200 us/op 0.90
deserialize SyncCommitteeMessage - tree 1.5630 us/op 1.7340 us/op 0.90
deserialize SyncCommitteeMessage - struct 1.9540 us/op 2.1860 us/op 0.89
deserialize SignedContributionAndProof - tree 2.8490 us/op 3.4630 us/op 0.82
deserialize SignedContributionAndProof - struct 4.3670 us/op 5.1350 us/op 0.85
deserialize SignedBeaconBlock - tree 348.12 us/op 418.62 us/op 0.83
deserialize SignedBeaconBlock - struct 221.52 us/op 280.47 us/op 0.79
BeaconState vc 300000 - deserialize tree 1.0836 s/op 1.1493 s/op 0.94
BeaconState vc 300000 - serialize tree 302.22 ms/op 342.28 ms/op 0.88
BeaconState.historicalRoots vc 300000 - deserialize tree 1.2420 us/op 1.5100 us/op 0.82
BeaconState.historicalRoots vc 300000 - serialize tree 1.3830 us/op 1.5100 us/op 0.92
BeaconState.validators vc 300000 - deserialize tree 1.0420 s/op 1.1530 s/op 0.90
BeaconState.validators vc 300000 - serialize tree 274.54 ms/op 317.07 ms/op 0.87
BeaconState.balances vc 300000 - deserialize tree 41.483 ms/op 47.503 ms/op 0.87
BeaconState.balances vc 300000 - serialize tree 7.3189 ms/op 7.2469 ms/op 1.01
BeaconState.previousEpochParticipation vc 300000 - deserialize tree 940.26 us/op 937.08 us/op 1.00
BeaconState.previousEpochParticipation vc 300000 - serialize tree 477.62 us/op 533.73 us/op 0.89
BeaconState.currentEpochParticipation vc 300000 - deserialize tree 879.07 us/op 844.09 us/op 1.04
BeaconState.currentEpochParticipation vc 300000 - serialize tree 471.72 us/op 532.50 us/op 0.89
BeaconState.inactivityScores vc 300000 - deserialize tree 42.211 ms/op 47.766 ms/op 0.88
BeaconState.inactivityScores vc 300000 - serialize tree 7.5426 ms/op 7.1206 ms/op 1.06
hashTreeRoot Attestation - struct 47.220 us/op 56.563 us/op 0.83
hashTreeRoot Attestation - tree 28.756 us/op 31.263 us/op 0.92
hashTreeRoot SignedAggregateAndProof - struct 64.119 us/op 81.687 us/op 0.78
hashTreeRoot SignedAggregateAndProof - tree 35.587 us/op 42.560 us/op 0.84
hashTreeRoot SyncCommitteeMessage - struct 15.475 us/op 18.580 us/op 0.83
hashTreeRoot SyncCommitteeMessage - tree 7.6500 us/op 9.1570 us/op 0.84
hashTreeRoot SignedContributionAndProof - struct 43.045 us/op 47.550 us/op 0.91
hashTreeRoot SignedContributionAndProof - tree 28.274 us/op 30.342 us/op 0.93
hashTreeRoot SignedBeaconBlock - struct 3.5586 ms/op 4.1959 ms/op 0.85
hashTreeRoot SignedBeaconBlock - tree 2.0337 ms/op 2.4335 ms/op 0.84
hashTreeRoot Validator - struct 18.873 us/op 21.146 us/op 0.89
hashTreeRoot Validator - tree 14.848 us/op 16.970 us/op 0.87
BeaconState vc 300000 - hashTreeRoot tree 4.7377 s/op 5.3988 s/op 0.88
BeaconState.historicalRoots vc 300000 - hashTreeRoot tree 1.8920 us/op 2.2020 us/op 0.86
BeaconState.validators vc 300000 - hashTreeRoot tree 4.4672 s/op 5.1575 s/op 0.87
BeaconState.balances vc 300000 - hashTreeRoot tree 105.64 ms/op 125.35 ms/op 0.84
BeaconState.previousEpochParticipation vc 300000 - hashTreeRoot tree 11.077 ms/op 13.299 ms/op 0.83
BeaconState.currentEpochParticipation vc 300000 - hashTreeRoot tree 11.078 ms/op 13.272 ms/op 0.83
BeaconState.inactivityScores vc 300000 - hashTreeRoot tree 106.10 ms/op 137.80 ms/op 0.77
hash64 x18 24.608 us/op 31.263 us/op 0.79
hashTwoObjects x18 21.808 us/op 26.801 us/op 0.81
hash64 x1740 2.3130 ms/op 2.7682 ms/op 0.84
hashTwoObjects x1740 2.0828 ms/op 2.4813 ms/op 0.84
hash64 x2700000 3.5946 s/op 4.2523 s/op 0.85
hashTwoObjects x2700000 3.2259 s/op 3.8516 s/op 0.84
get_exitEpoch - ContainerType 497.00 ns/op 692.00 ns/op 0.72
get_exitEpoch - ContainerNodeStructType 412.00 ns/op 567.00 ns/op 0.73
set_exitEpoch - ContainerType 451.00 ns/op 631.00 ns/op 0.71
set_exitEpoch - ContainerNodeStructType 306.00 ns/op 605.00 ns/op 0.51
get_pubkey - ContainerType 1.6110 us/op 2.3260 us/op 0.69
get_pubkey - ContainerNodeStructType 300.00 ns/op 623.00 ns/op 0.48
hashTreeRoot - ContainerType 518.00 ns/op 705.00 ns/op 0.73
hashTreeRoot - ContainerNodeStructType 562.00 ns/op 805.00 ns/op 0.70
createProof - ContainerType 6.4590 us/op 7.6340 us/op 0.85
createProof - ContainerNodeStructType 35.172 us/op 40.718 us/op 0.86
serialize - ContainerType 3.0190 us/op 3.6450 us/op 0.83
serialize - ContainerNodeStructType 2.4860 us/op 3.0200 us/op 0.82
set_exitEpoch_and_hashTreeRoot - ContainerType 5.4150 us/op 6.4940 us/op 0.83
set_exitEpoch_and_hashTreeRoot - ContainerNodeStructType 15.660 us/op 18.087 us/op 0.87
Array - for of 10.654 us/op 12.575 us/op 0.85
Array - for(;;) 7.2730 us/op 8.6510 us/op 0.84
basicListValue.readonlyValuesArray() 5.3979 ms/op 7.4797 ms/op 0.72
basicListValue.readonlyValuesArray() + loop all 5.2792 ms/op 7.4129 ms/op 0.71
compositeListValue.readonlyValuesArray() 58.273 ms/op 48.187 ms/op 1.21
compositeListValue.readonlyValuesArray() + loop all 45.605 ms/op 43.811 ms/op 1.04
Number64UintType - get balances list 6.4402 ms/op 7.1981 ms/op 0.89
Number64UintType - set balances list 15.579 ms/op 16.994 ms/op 0.92
Number64UintType - get and increase 10 then set 61.693 ms/op 68.026 ms/op 0.91
Number64UintType - increase 10 using applyDelta 26.099 ms/op 29.042 ms/op 0.90
Number64UintType - increase 10 using applyDeltaInBatch 25.693 ms/op 29.292 ms/op 0.88
tree_newTreeFromUint64Deltas 28.081 ms/op 32.063 ms/op 0.88
unsafeUint8ArrayToTree 54.362 ms/op 58.601 ms/op 0.93
bitLength(50) 316.00 ns/op 406.00 ns/op 0.78
bitLengthStr(50) 372.00 ns/op 468.00 ns/op 0.79
bitLength(8000) 299.00 ns/op 377.00 ns/op 0.79
bitLengthStr(8000) 503.00 ns/op 597.00 ns/op 0.84
bitLength(250000) 303.00 ns/op 369.00 ns/op 0.82
bitLengthStr(250000) 603.00 ns/op 708.00 ns/op 0.85
floor - Math.floor (53) 0.66985 ns/op 0.79967 ns/op 0.84
floor - << 0 (53) 0.67007 ns/op 0.80415 ns/op 0.83
floor - Math.floor (512) 0.67029 ns/op 0.80413 ns/op 0.83
floor - << 0 (512) 0.67003 ns/op 0.80355 ns/op 0.83
fnIf(0) 2.6798 ns/op 3.1851 ns/op 0.84
fnSwitch(0) 5.0219 ns/op 6.0183 ns/op 0.83
fnObj(0) 0.66996 ns/op 0.80432 ns/op 0.83
fnArr(0) 0.67080 ns/op 0.80405 ns/op 0.83
fnIf(4) 4.3533 ns/op 5.2224 ns/op 0.83
fnSwitch(4) 5.0244 ns/op 6.0304 ns/op 0.83
fnObj(4) 0.67002 ns/op 0.80351 ns/op 0.83
fnArr(4) 0.66991 ns/op 0.79949 ns/op 0.84
fnIf(9) 6.6966 ns/op 8.0197 ns/op 0.84
fnSwitch(9) 5.0338 ns/op 6.0324 ns/op 0.83
fnObj(9) 0.66998 ns/op 0.80415 ns/op 0.83
fnArr(9) 0.67012 ns/op 0.80070 ns/op 0.84
Container {a,b,vec} - as struct x100000 67.373 us/op 80.829 us/op 0.83
Container {a,b,vec} - as tree x100000 837.45 us/op 999.88 us/op 0.84
Container {a,vec,b} - as struct x100000 100.88 us/op 121.02 us/op 0.83
Container {a,vec,b} - as tree x100000 904.59 us/op 1.0847 ms/op 0.83
get 2 props x1000000 - rawObject 335.12 us/op 394.08 us/op 0.85
get 2 props x1000000 - proxy 134.50 ms/op 160.16 ms/op 0.84
get 2 props x1000000 - customObj 335.14 us/op 402.27 us/op 0.83
Simple object binary -> struct 877.00 ns/op 1.4450 us/op 0.61
Simple object binary -> tree_backed 2.4260 us/op 4.0300 us/op 0.60
Simple object struct -> tree_backed 3.1580 us/op 5.1090 us/op 0.62
Simple object tree_backed -> struct 2.6990 us/op 4.3010 us/op 0.63
Simple object struct -> binary 1.3980 us/op 2.3550 us/op 0.59
Simple object tree_backed -> binary 2.4000 us/op 3.7980 us/op 0.63
aggregationBits binary -> struct 761.00 ns/op 1.3540 us/op 0.56
aggregationBits binary -> tree_backed 3.4130 us/op 5.4510 us/op 0.63
aggregationBits struct -> tree_backed 4.2560 us/op 5.6340 us/op 0.76
aggregationBits tree_backed -> struct 1.7740 us/op 2.1750 us/op 0.82
aggregationBits struct -> binary 1.2840 us/op 1.6730 us/op 0.77
aggregationBits tree_backed -> binary 1.5710 us/op 1.9360 us/op 0.81
List(uint8) 100000 binary -> struct 2.0639 ms/op 2.7000 ms/op 0.76
List(uint8) 100000 binary -> tree_backed 188.03 us/op 185.88 us/op 1.01
List(uint8) 100000 struct -> tree_backed 2.2017 ms/op 2.4798 ms/op 0.89
List(uint8) 100000 tree_backed -> struct 1.5577 ms/op 1.9649 ms/op 0.79
List(uint8) 100000 struct -> binary 2.0157 ms/op 2.4895 ms/op 0.81
List(uint8) 100000 tree_backed -> binary 148.76 us/op 172.06 us/op 0.86
List(uint64Number) 100000 binary -> struct 1.7640 ms/op 1.9545 ms/op 0.90
List(uint64Number) 100000 binary -> tree_backed 6.0141 ms/op 6.0137 ms/op 1.00
List(uint64Number) 100000 struct -> tree_backed 8.7993 ms/op 8.5942 ms/op 1.02
List(uint64Number) 100000 tree_backed -> struct 3.1526 ms/op 3.6811 ms/op 0.86
List(uint64Number) 100000 struct -> binary 2.2978 ms/op 2.7027 ms/op 0.85
List(uint64Number) 100000 tree_backed -> binary 1.6586 ms/op 2.0917 ms/op 0.79
List(Uint64Bigint) 100000 binary -> struct 5.3711 ms/op 6.3737 ms/op 0.84
List(Uint64Bigint) 100000 binary -> tree_backed 6.4011 ms/op 6.6982 ms/op 0.96
List(Uint64Bigint) 100000 struct -> tree_backed 9.4677 ms/op 9.6897 ms/op 0.98
List(Uint64Bigint) 100000 tree_backed -> struct 8.2619 ms/op 7.8762 ms/op 1.05
List(Uint64Bigint) 100000 struct -> binary 2.9604 ms/op 3.4994 ms/op 0.85
List(Uint64Bigint) 100000 tree_backed -> binary 1.6413 ms/op 1.8124 ms/op 0.91
Vector(Root) 100000 binary -> struct 54.713 ms/op 63.816 ms/op 0.86
Vector(Root) 100000 binary -> tree_backed 61.525 ms/op 69.267 ms/op 0.89
Vector(Root) 100000 struct -> tree_backed 68.225 ms/op 77.996 ms/op 0.87
Vector(Root) 100000 tree_backed -> struct 76.900 ms/op 91.153 ms/op 0.84
Vector(Root) 100000 struct -> binary 3.2772 ms/op 3.8784 ms/op 0.84
Vector(Root) 100000 tree_backed -> binary 14.082 ms/op 16.427 ms/op 0.86
List(Validator) 100000 binary -> struct 204.41 ms/op 241.93 ms/op 0.84
List(Validator) 100000 binary -> tree_backed 529.08 ms/op 606.28 ms/op 0.87
List(Validator) 100000 struct -> tree_backed 545.89 ms/op 650.81 ms/op 0.84
List(Validator) 100000 tree_backed -> struct 310.74 ms/op 380.97 ms/op 0.82
List(Validator) 100000 struct -> binary 46.153 ms/op 56.705 ms/op 0.81
List(Validator) 100000 tree_backed -> binary 136.85 ms/op 162.83 ms/op 0.84
List(Validator-NS) 100000 binary -> struct 205.98 ms/op 247.78 ms/op 0.83
List(Validator-NS) 100000 binary -> tree_backed 279.87 ms/op 319.31 ms/op 0.88
List(Validator-NS) 100000 struct -> tree_backed 343.08 ms/op 394.86 ms/op 0.87
List(Validator-NS) 100000 tree_backed -> struct 287.72 ms/op 333.16 ms/op 0.86
List(Validator-NS) 100000 struct -> binary 46.967 ms/op 59.253 ms/op 0.79
List(Validator-NS) 100000 tree_backed -> binary 59.964 ms/op 68.489 ms/op 0.88
get epochStatuses - MutableVector 129.00 us/op 142.22 us/op 0.91
get epochStatuses - ViewDU 283.80 us/op 325.62 us/op 0.87
set epochStatuses - ListTreeView 2.1249 ms/op 2.4569 ms/op 0.86
set epochStatuses - ListTreeView - set() 615.16 us/op 726.72 us/op 0.85
set epochStatuses - ListTreeView - commit() 702.25 us/op 769.04 us/op 0.91
bitstring 748.74 ns/op 894.61 ns/op 0.84
bit mask 12.817 ns/op 15.300 ns/op 0.84
struct - increase slot to 1000000 2.1861 ms/op 2.6193 ms/op 0.83
UintNumberType - increase slot to 1000000 47.758 ms/op 57.420 ms/op 0.83
UintBigintType - increase slot to 1000000 621.75 ms/op 737.63 ms/op 0.84
UintBigint8 x 100000 tree_deserialize 7.6978 ms/op 14.803 ms/op 0.52
UintBigint8 x 100000 tree_serialize 2.0356 ms/op 2.4166 ms/op 0.84
UintBigint16 x 100000 tree_deserialize 8.0785 ms/op 6.9733 ms/op 1.16
UintBigint16 x 100000 tree_serialize 2.3666 ms/op 2.6234 ms/op 0.90
UintBigint32 x 100000 tree_deserialize 8.1264 ms/op 9.3372 ms/op 0.87
UintBigint32 x 100000 tree_serialize 2.1205 ms/op 2.4554 ms/op 0.86
UintBigint64 x 100000 tree_deserialize 9.2771 ms/op 9.5181 ms/op 0.97
UintBigint64 x 100000 tree_serialize 2.8292 ms/op 3.1102 ms/op 0.91
UintBigint8 x 100000 value_deserialize 870.89 us/op 1.0455 ms/op 0.83
UintBigint8 x 100000 value_serialize 1.4280 ms/op 1.3712 ms/op 1.04
UintBigint16 x 100000 value_deserialize 933.36 us/op 1.1230 ms/op 0.83
UintBigint16 x 100000 value_serialize 1.4877 ms/op 1.4747 ms/op 1.01
UintBigint32 x 100000 value_deserialize 844.69 us/op 1.0043 ms/op 0.84
UintBigint32 x 100000 value_serialize 1.5135 ms/op 1.6030 ms/op 0.94
UintBigint64 x 100000 value_deserialize 907.26 us/op 1.0838 ms/op 0.84
UintBigint64 x 100000 value_serialize 1.6733 ms/op 1.8786 ms/op 0.89
UintBigint8 x 100000 deserialize 6.8633 ms/op 8.4172 ms/op 0.82
UintBigint8 x 100000 serialize 2.5387 ms/op 3.1502 ms/op 0.81
UintBigint16 x 100000 deserialize 7.3328 ms/op 8.6463 ms/op 0.85
UintBigint16 x 100000 serialize 2.5493 ms/op 3.4129 ms/op 0.75
UintBigint32 x 100000 deserialize 8.0670 ms/op 9.3981 ms/op 0.86
UintBigint32 x 100000 serialize 4.5075 ms/op 5.2683 ms/op 0.86
UintBigint64 x 100000 deserialize 5.3712 ms/op 6.1009 ms/op 0.88
UintBigint64 x 100000 serialize 2.4495 ms/op 2.9283 ms/op 0.84
UintBigint128 x 100000 deserialize 8.4458 ms/op 9.8771 ms/op 0.86
UintBigint128 x 100000 serialize 27.868 ms/op 32.815 ms/op 0.85
UintBigint256 x 100000 deserialize 15.901 ms/op 18.242 ms/op 0.87
UintBigint256 x 100000 serialize 82.167 ms/op 98.541 ms/op 0.83
Slice from Uint8Array x25000 1.7941 ms/op 1.9105 ms/op 0.94
Slice from ArrayBuffer x25000 31.073 ms/op 34.187 ms/op 0.91
Slice from ArrayBuffer x25000 + new Uint8Array 34.510 ms/op 37.211 ms/op 0.93
Copy Uint8Array 100000 iterate 1.4876 ms/op 1.7642 ms/op 0.84
Copy Uint8Array 100000 slice 326.03 us/op 185.33 us/op 1.76
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 331.64 us/op 156.99 us/op 2.11
Copy Buffer 100000 Uint8Array.prototype.slice.call 347.49 us/op 159.32 us/op 2.18
Copy Uint8Array 100000 slice + set 683.09 us/op 433.38 us/op 1.58
Copy Uint8Array 100000 subarray + set 370.07 us/op 185.01 us/op 2.00
Copy Uint8Array 100000 slice arrayBuffer 331.51 us/op 177.11 us/op 1.87
Uint64 deserialize 100000 - iterate Uint8Array 2.3706 ms/op 2.6777 ms/op 0.89
Uint64 deserialize 100000 - by Uint32A 2.2276 ms/op 2.5292 ms/op 0.88
Uint64 deserialize 100000 - by DataView.getUint32 x2 2.2812 ms/op 2.7389 ms/op 0.83
Uint64 deserialize 100000 - by DataView.getBigUint64 6.7906 ms/op 8.2628 ms/op 0.82
Uint64 deserialize 100000 - by byte 69.116 ms/op 82.776 ms/op 0.83

by benchmarkbot/action

Copy link
Contributor

@g11tech g11tech left a comment

Choose a reason for hiding this comment

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

👍

I am hoping you were able to validate the website locally

@nflaig
Copy link
Member Author

nflaig commented May 2, 2023

@g11tech yes was able to verify it works and looks correct locally, something I noticed during testing is that there is no error shown when trying to serialize/deserialize invalid data, it only logs an error to the console. This is also the case on the live website (https://simpleserialize.com/).

For example:

caught (in promise) RangeError: Offset is outside the bounds of the DataView
    at DataView.getUint32 (<anonymous>)
    at readVariableOffsets (container.js:322:1)
    at ContainerType.getFieldRanges (container.js:290:1)
    at ContainerType.value_deserializeFromBytes (container.js:125:1)
    at ContainerType.deserialize (abstract.js:45:1)
    at Object.parse (input_types.ts:21:32)
    at Input._callee3$ (Input.tsx:117:30)
    at tryCatch (runtime.js:63:16)
    at Generator.invoke [as _invoke] (runtime.js:294:1)
    at Generator.next (runtime.js:119:1)

Maybe catch the error and show a simple browser alert?

@nflaig
Copy link
Member Author

nflaig commented May 2, 2023

I just ran yarn build from root directory, looks like there is a build issue, I haven't faced that before because I only ran build in sub directory for website specifically

➤ YN0000: [simpleserialize.com]:   ERROR in ../ssz/lib/util/merkleize.js 4:16-77
➤ YN0000: [simpleserialize.com]:   Module not found: Error: Package path ./lib/hasher/index is not exported from package /home/nico/projects/ethereum/ssz/packages/ssz/node_modules/@chainsafe/persistent-merkle-tree (see exports field in /home/nico/projects/ethereum/ssz/packages/ssz/node_modules/@chainsafe/persistent-merkle-tree/package.json)
➤ YN0000: [simpleserialize.com]:    @ ../ssz/lib/index.js 63:18-45
➤ YN0000: [simpleserialize.com]:    @ ../../node_modules/@lodestar/types/lib/utils/StringType.js 1:0-43 2:32-41
➤ YN0000: [simpleserialize.com]:    @ ../../node_modules/@lodestar/types/lib/index.js 6:0-63 6:0-63 6:0-63
➤ YN0000: [simpleserialize.com]:    @ ./src/util/types.ts 23:0-38 25:13-23 26:13-23 27:16-29 28:14-25 29:12-21 30:15-27 31:22-41 32:20-37 33:24-45 34:26-49 35:41-44
➤ YN0000: [simpleserialize.com]:    @ ./src/components/worker/helpers.ts 1:0-41 7:9-14
➤ YN0000: [simpleserialize.com]:    @ ./src/components/worker/index.ts 3:0-80 6:15-25 8:16-34 13:15-25

any ideas? might be due to changes done in #318

@g11tech
Copy link
Contributor

g11tech commented May 2, 2023

I just ran yarn build from root directory, looks like there is a build issue, I haven't faced that before because I only ran build in sub directory for website specifically

➤ YN0000: [simpleserialize.com]:   ERROR in ../ssz/lib/util/merkleize.js 4:16-77
➤ YN0000: [simpleserialize.com]:   Module not found: Error: Package path ./lib/hasher/index is not exported from package /home/nico/projects/ethereum/ssz/packages/ssz/node_modules/@chainsafe/persistent-merkle-tree (see exports field in /home/nico/projects/ethereum/ssz/packages/ssz/node_modules/@chainsafe/persistent-merkle-tree/package.json)
➤ YN0000: [simpleserialize.com]:    @ ../ssz/lib/index.js 63:18-45
➤ YN0000: [simpleserialize.com]:    @ ../../node_modules/@lodestar/types/lib/utils/StringType.js 1:0-43 2:32-41
➤ YN0000: [simpleserialize.com]:    @ ../../node_modules/@lodestar/types/lib/index.js 6:0-63 6:0-63 6:0-63
➤ YN0000: [simpleserialize.com]:    @ ./src/util/types.ts 23:0-38 25:13-23 26:13-23 27:16-29 28:14-25 29:12-21 30:15-27 31:22-41 32:20-37 33:24-45 34:26-49 35:41-44
➤ YN0000: [simpleserialize.com]:    @ ./src/components/worker/helpers.ts 1:0-41 7:9-14
➤ YN0000: [simpleserialize.com]:    @ ./src/components/worker/index.ts 3:0-80 6:15-25 8:16-34 13:15-25

any ideas? might be due to changes done in #318

yes very likely, i think you will need to update ssz version in lodestar first since its originating from lodestar types

Copy link
Contributor

@g11tech g11tech left a comment

Choose a reason for hiding this comment

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

build issues because of ssz exports refac

@nflaig
Copy link
Member Author

nflaig commented May 2, 2023

yes very likely, i think you will need to update ssz version in lodestar first since its originating from lodestar types

I created a separate issue #324 as this also fails on master branch so I don't think it is isolated to @lodestar/types as this package is not used there.

Copy link
Contributor

@g11tech g11tech left a comment

Choose a reason for hiding this comment

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

seems to be building fine locally after clearing old cached node modules

@g11tech g11tech merged commit 6d13055 into master May 3, 2023
@g11tech g11tech deleted the nflaig/support-capella-fork branch May 3, 2023 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Capella Fork on simpleserialize.com
4 participants