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

expect.to.throw not called for ssz generic test #3480

Merged
merged 1 commit into from
Dec 6, 2021

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Dec 3, 2021

Motivation

  • expect.to.throw not called for ssz generic test

Description

  • Follow ssz generic spec test which has a better structure

Closes #3473

@codeclimate
Copy link

codeclimate bot commented Dec 3, 2021

Code Climate has analyzed commit 0785b9e and detected 0 issues on this pull request.

View more on Code Climate.

@codecov
Copy link

codecov bot commented Dec 3, 2021

Codecov Report

Merging #3480 (0785b9e) into master (b01e3de) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #3480   +/-   ##
=======================================
  Coverage   37.83%   37.83%           
=======================================
  Files         307      307           
  Lines        8095     8095           
  Branches     1246     1246           
=======================================
  Hits         3063     3063           
  Misses       4880     4880           
  Partials      152      152           

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2021

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 4de1ca1 Previous: b01e3de Ratio
BeaconState.hashTreeRoot - No change 578.00 ns/op 623.00 ns/op 0.93
BeaconState.hashTreeRoot - 1 full validator 77.979 us/op 86.477 us/op 0.90
BeaconState.hashTreeRoot - 32 full validator 1.2664 ms/op 1.3448 ms/op 0.94
BeaconState.hashTreeRoot - 512 full validator 15.235 ms/op 15.416 ms/op 0.99
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 82.384 us/op 85.864 us/op 0.96
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.3405 ms/op 1.3922 ms/op 0.96
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 16.900 ms/op 18.698 ms/op 0.90
BeaconState.hashTreeRoot - 1 balances 56.968 us/op 61.899 us/op 0.92
BeaconState.hashTreeRoot - 32 balances 494.29 us/op 548.84 us/op 0.90
BeaconState.hashTreeRoot - 512 balances 4.6241 ms/op 5.4372 ms/op 0.85
BeaconState.hashTreeRoot - 250000 balances 90.272 ms/op 96.780 ms/op 0.93
processSlot - 1 slots 51.644 us/op 36.192 us/op 1.43
processSlot - 32 slots 2.3319 ms/op 2.2134 ms/op 1.05
getCommitteeAssignments - req 1 vs - 250000 vc 4.4341 ms/op 5.4792 ms/op 0.81
getCommitteeAssignments - req 100 vs - 250000 vc 6.4077 ms/op 8.3636 ms/op 0.77
getCommitteeAssignments - req 1000 vs - 250000 vc 6.8824 ms/op 8.5312 ms/op 0.81
computeProposers - vc 250000 19.943 ms/op 22.625 ms/op 0.88
computeEpochShuffling - vc 250000 182.42 ms/op 215.97 ms/op 0.84
getNextSyncCommittee - vc 250000 326.62 ms/op 371.21 ms/op 0.88
altair processAttestation - 250000 vs - 7PWei normalcase 35.365 ms/op 32.153 ms/op 1.10
altair processAttestation - 250000 vs - 7PWei worstcase 46.183 ms/op 38.072 ms/op 1.21
altair processAttestation - setStatus - 1/6 committees join 8.8347 ms/op 8.7614 ms/op 1.01
altair processAttestation - setStatus - 1/3 committees join 18.065 ms/op 17.752 ms/op 1.02
altair processAttestation - setStatus - 1/2 committees join 30.203 ms/op 28.076 ms/op 1.08
altair processAttestation - setStatus - 2/3 committees join 47.376 ms/op 36.912 ms/op 1.28
altair processAttestation - setStatus - 4/5 committees join 40.038 ms/op 45.149 ms/op 0.89
altair processAttestation - setStatus - 100% committees join 53.197 ms/op 56.486 ms/op 0.94
altair processAttestation - updateEpochParticipants - 1/6 committees join 12.178 ms/op 9.5227 ms/op 1.28
altair processAttestation - updateEpochParticipants - 1/3 committees join 15.997 ms/op 19.172 ms/op 0.83
altair processAttestation - updateEpochParticipants - 1/2 committees join 19.938 ms/op 20.157 ms/op 0.99
altair processAttestation - updateEpochParticipants - 2/3 committees join 21.756 ms/op 21.092 ms/op 1.03
altair processAttestation - updateEpochParticipants - 4/5 committees join 27.752 ms/op 22.736 ms/op 1.22
altair processAttestation - updateEpochParticipants - 100% committees join 24.681 ms/op 27.208 ms/op 0.91
altair processAttestation - updateAllStatus 18.305 ms/op 17.201 ms/op 1.06
altair processBlock - 250000 vs - 7PWei normalcase 41.536 ms/op 37.427 ms/op 1.11
altair processBlock - 250000 vs - 7PWei worstcase 115.97 ms/op 108.83 ms/op 1.07
altair processEpoch - mainnet_e81889 938.99 ms/op 892.80 ms/op 1.05
mainnet_e81889 - altair beforeProcessEpoch 280.61 ms/op 221.92 ms/op 1.26
mainnet_e81889 - altair processJustificationAndFinalization 122.54 us/op 48.145 us/op 2.55
mainnet_e81889 - altair processInactivityUpdates 16.890 ms/op 14.837 ms/op 1.14
mainnet_e81889 - altair processRewardsAndPenalties 108.72 ms/op 98.772 ms/op 1.10
mainnet_e81889 - altair processRegistryUpdates 19.293 us/op 4.3630 us/op 4.42
mainnet_e81889 - altair processSlashings 6.2270 us/op 844.00 ns/op 7.38
mainnet_e81889 - altair processEth1DataReset 6.9180 us/op 731.00 ns/op 9.46
mainnet_e81889 - altair processEffectiveBalanceUpdates 11.496 ms/op 10.675 ms/op 1.08
mainnet_e81889 - altair processSlashingsReset 38.728 us/op 5.9290 us/op 6.53
mainnet_e81889 - altair processRandaoMixesReset 44.148 us/op 8.8280 us/op 5.00
mainnet_e81889 - altair processHistoricalRootsUpdate 9.7120 us/op 948.00 ns/op 10.24
mainnet_e81889 - altair processParticipationFlagUpdates 89.907 ms/op 129.27 ms/op 0.70
mainnet_e81889 - altair processSyncCommitteeUpdates 5.3400 us/op 791.00 ns/op 6.75
mainnet_e81889 - altair afterProcessEpoch 197.87 ms/op 239.22 ms/op 0.83
altair processInactivityUpdates - 250000 normalcase 58.504 ms/op 63.562 ms/op 0.92
altair processInactivityUpdates - 250000 worstcase 62.260 ms/op 64.420 ms/op 0.97
altair processParticipationFlagUpdates - 250000 anycase 88.732 ms/op 74.173 ms/op 1.20
altair processRewardsAndPenalties - 250000 normalcase 128.27 ms/op 97.932 ms/op 1.31
altair processRewardsAndPenalties - 250000 worstcase 104.36 ms/op 87.845 ms/op 1.19
altair processSyncCommitteeUpdates - 250000 369.76 ms/op 386.73 ms/op 0.96
Tree 40 250000 create 545.24 ms/op 443.69 ms/op 1.23
Tree 40 250000 get(125000) 277.51 ns/op 258.61 ns/op 1.07
Tree 40 250000 set(125000) 1.2455 us/op 1.4004 us/op 0.89
Tree 40 250000 toArray() 43.270 ms/op 33.872 ms/op 1.28
Tree 40 250000 iterate all - toArray() + loop 42.483 ms/op 34.169 ms/op 1.24
Tree 40 250000 iterate all - get(i) 104.87 ms/op 115.81 ms/op 0.91
MutableVector 250000 create 22.174 ms/op 18.303 ms/op 1.21
MutableVector 250000 get(125000) 12.072 ns/op 11.591 ns/op 1.04
MutableVector 250000 set(125000) 493.28 ns/op 457.72 ns/op 1.08
MutableVector 250000 toArray() 8.3274 ms/op 8.6767 ms/op 0.96
MutableVector 250000 iterate all - toArray() + loop 7.8716 ms/op 9.0350 ms/op 0.87
MutableVector 250000 iterate all - get(i) 3.1922 ms/op 3.3524 ms/op 0.95
Array 250000 create 4.5132 ms/op 4.9192 ms/op 0.92
Array 250000 clone - spread 1.9419 ms/op 1.9503 ms/op 1.00
Array 250000 get(125000) 0.94300 ns/op 1.0980 ns/op 0.86
Array 250000 set(125000) 0.99800 ns/op 1.1160 ns/op 0.89
Array 250000 iterate all - loop 115.22 us/op 151.28 us/op 0.76
aggregationBits - 2048 els - readonlyValues 196.70 us/op 196.22 us/op 1.00
aggregationBits - 2048 els - zipIndexesInBitList 34.570 us/op 38.208 us/op 0.90
regular array get 100000 times 46.935 us/op 60.578 us/op 0.77
wrappedArray get 100000 times 47.703 us/op 60.680 us/op 0.79
arrayWithProxy get 100000 times 29.316 ms/op 31.424 ms/op 0.93
ssz.Root.equals 1.0390 us/op 1.3110 us/op 0.79
ssz.Root.equals with valueOf() 1.2780 us/op 1.7280 us/op 0.74
byteArrayEquals with valueOf() 1.2910 us/op 1.6090 us/op 0.80
phase0 processBlock - 250000 vs - 7PWei normalcase 10.994 ms/op 9.7244 ms/op 1.13
phase0 processBlock - 250000 vs - 7PWei worstcase 73.953 ms/op 76.451 ms/op 0.97
phase0 afterProcessEpoch - 250000 vs - 7PWei 213.56 ms/op 242.89 ms/op 0.88
phase0 beforeProcessEpoch - 250000 vs - 7PWei 630.05 ms/op 457.05 ms/op 1.38
phase0 processEpoch - mainnet_e58758 783.16 ms/op 689.35 ms/op 1.14
mainnet_e58758 - phase0 beforeProcessEpoch 523.74 ms/op 369.39 ms/op 1.42
mainnet_e58758 - phase0 processJustificationAndFinalization 115.23 us/op 46.098 us/op 2.50
mainnet_e58758 - phase0 processRewardsAndPenalties 77.443 ms/op 85.457 ms/op 0.91
mainnet_e58758 - phase0 processRegistryUpdates 81.282 us/op 27.524 us/op 2.95
mainnet_e58758 - phase0 processSlashings 7.0210 us/op 915.00 ns/op 7.67
mainnet_e58758 - phase0 processEth1DataReset 6.5940 us/op 871.00 ns/op 7.57
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 8.5059 ms/op 8.7556 ms/op 0.97
mainnet_e58758 - phase0 processSlashingsReset 30.169 us/op 5.3670 us/op 5.62
mainnet_e58758 - phase0 processRandaoMixesReset 39.228 us/op 7.8680 us/op 4.99
mainnet_e58758 - phase0 processHistoricalRootsUpdate 8.1480 us/op 1.0170 us/op 8.01
mainnet_e58758 - phase0 processParticipationRecordUpdates 29.509 us/op 6.3900 us/op 4.62
mainnet_e58758 - phase0 afterProcessEpoch 162.69 ms/op 195.60 ms/op 0.83
phase0 processEffectiveBalanceUpdates - 250000 normalcase 9.9357 ms/op 10.250 ms/op 0.97
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.1449 s/op 1.0664 s/op 1.07
phase0 processRegistryUpdates - 250000 normalcase 86.933 us/op 27.419 us/op 3.17
phase0 processRegistryUpdates - 250000 badcase_full_deposits 2.8901 ms/op 2.6509 ms/op 1.09
phase0 processRegistryUpdates - 250000 worstcase 0.5 1.5581 s/op 1.4342 s/op 1.09
phase0 getAttestationDeltas - 250000 normalcase 41.405 ms/op 38.659 ms/op 1.07
phase0 getAttestationDeltas - 250000 worstcase 30.444 ms/op 38.761 ms/op 0.79
phase0 processSlashings - 250000 worstcase 28.286 ms/op 31.418 ms/op 0.90
shuffle list - 16384 els 11.317 ms/op 14.208 ms/op 0.80
shuffle list - 250000 els 165.17 ms/op 200.09 ms/op 0.83
getEffectiveBalances - 250000 vs - 7PWei 9.0823 ms/op 16.341 ms/op 0.56
computeDeltas 2.9711 ms/op 3.3253 ms/op 0.89
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.1210 ms/op 2.0936 ms/op 1.01
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 662.15 us/op 608.96 us/op 1.09
BLS verify - blst-native 1.7707 ms/op 2.1807 ms/op 0.81
BLS verifyMultipleSignatures 3 - blst-native 3.9076 ms/op 4.5103 ms/op 0.87
BLS verifyMultipleSignatures 8 - blst-native 8.1922 ms/op 9.7527 ms/op 0.84
BLS verifyMultipleSignatures 32 - blst-native 29.159 ms/op 35.397 ms/op 0.82
BLS aggregatePubkeys 32 - blst-native 40.201 us/op 46.770 us/op 0.86
BLS aggregatePubkeys 128 - blst-native 149.01 us/op 182.42 us/op 0.82
getAttestationsForBlock 77.129 ms/op 66.541 ms/op 1.16
CheckpointStateCache - add get delete 15.725 us/op 14.720 us/op 1.07
validate gossip signedAggregateAndProof - struct 4.3296 ms/op 5.2192 ms/op 0.83
validate gossip signedAggregateAndProof - treeBacked 4.3519 ms/op 5.2416 ms/op 0.83
validate gossip attestation - struct 2.1289 ms/op 2.4494 ms/op 0.87
validate gossip attestation - treeBacked 2.4926 ms/op 2.4618 ms/op 1.01
Object access 1 prop 0.32800 ns/op 0.34700 ns/op 0.95
Map access 1 prop 0.27900 ns/op 0.30300 ns/op 0.92
Object get x1000 14.357 ns/op 11.376 ns/op 1.26
Map get x1000 0.75000 ns/op 0.93300 ns/op 0.80
Object set x1000 71.814 ns/op 74.460 ns/op 0.96
Map set x1000 51.847 ns/op 49.109 ns/op 1.06
Return object 10000 times 0.34570 ns/op 0.43800 ns/op 0.79
Throw Error 10000 times 5.7937 us/op 5.9587 us/op 0.97

by benchmarkbot/action

@twoeths twoeths marked this pull request as ready for review December 3, 2021 14:44
@dapplion
Copy link
Contributor

dapplion commented Dec 5, 2021

@tuyennhv Could you double check that all SSZ tests are actually ran?

@twoeths
Copy link
Contributor Author

twoeths commented Dec 6, 2021

@tuyennhv Could you double check that all SSZ tests are actually ran?

@dapplion yeah it does run in the CI

mocha 'test/spec/ssz/generic/index.test.ts'


  basic_vector invalid
    ✓ vec_bool_0
    ✓ vec_bool_16_max_one_byte_less
    ✓ vec_bool_16_max_one_byte_more

@dapplion dapplion merged commit 48bff72 into master Dec 6, 2021
@dapplion dapplion deleted the tuyen/expect.to.throw branch December 6, 2021 07:02
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.

expect.to.throw not called for ssz generic test
3 participants