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

Simplify epochProcess creation #2942

Merged
merged 1 commit into from
Aug 11, 2021
Merged

Simplify epochProcess creation #2942

merged 1 commit into from
Aug 11, 2021

Conversation

dapplion
Copy link
Contributor

Motivation

epochProcess creation is weird, it creates and empty object first to the mutate it. It would be simpler and easier to reason about to compute the values and return them as const directly.

Description

Return a new epochProcess object directly instead of mutate an empty object.

@codeclimate
Copy link

codeclimate bot commented Aug 10, 2021

Code Climate has analyzed commit 9bf4da5 and detected 0 issues on this pull request.

View more on Code Climate.

@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 53d2db0 Previous: c09ea9a Ratio
getCommitteeAssignments - req 1000 vs - 250000 vc 8.1562 ms/op 9.2084 ms/op 0.89
processBlock altair 250000 vs - 7PWei - maxed ops 487.11 ms/op 563.59 ms/op 0.86
processBlock altair 250000 vs - 7PWei - average 190.51 ms/op 220.05 ms/op 0.87
epoch altair - 250000 vs - 7PWei - processInactivityUpdates 2.5989 s/op 2.6754 s/op 0.97
epoch altair - 250000 vs - 7PWei - processRewardsAndPenalties 1.1092 s/op 1.1298 s/op 0.98
epoch altair - 250000 vs - 7PWei - processParticipationFlagUpdates 489.21 ms/op 578.71 ms/op 0.85
processBlock phase0 250000 vs - 7PWei - maxed ops 219.71 ms/op 240.26 ms/op 0.91
processBlock phase0 250000 vs - 7PWei - average 32.484 ms/op 30.951 ms/op 1.05
epoch phase0 - 250000 vs - 7PWei - beforeProcessEpoch 1.7458 s/op 2.0031 s/op 0.87
epoch phase0 - 250000 vs - 7PWei - processRewardsAndPenalties 876.92 ms/op 918.98 ms/op 0.95
epoch phase0 - 250000 vs - 7PWei - processEffectiveBalanceUpdates 134.04 ms/op 135.53 ms/op 0.99
getAttestationDeltas - 250000 vs - 7PWei 124.38 ms/op 124.54 ms/op 1.00
processSlots - 250000 vs - 7PWei - 32 empty slots 3.4435 s/op 3.6104 s/op 0.95
shuffle list - 16384 els 29.937 ms/op 30.941 ms/op 0.97
shuffle list - 250000 els 416.54 ms/op 298.32 ms/op 1.40
getPubkeys - persistent - req 1000 vs - 250000 vc 22.850 us/op 20.070 us/op 1.14
BLS verify - blst-native 2.3294 ms/op 2.3405 ms/op 1.00
BLS verifyMultipleSignatures 3 - blst-native 4.6112 ms/op 4.8100 ms/op 0.96
BLS verifyMultipleSignatures 8 - blst-native 9.9415 ms/op 10.355 ms/op 0.96
BLS verifyMultipleSignatures 32 - blst-native 35.995 ms/op 37.961 ms/op 0.95
BLS aggregatePubkeys 32 - blst-native 51.363 us/op 78.616 us/op 0.65
BLS aggregatePubkeys 128 - blst-native 190.87 us/op 210.14 us/op 0.91
getAttestationsForBlock 102.99 ms/op 89.045 ms/op 1.16
validate gossip signedAggregateAndProof - struct 5.3454 ms/op 5.7115 ms/op 0.94
validate gossip signedAggregateAndProof - treeBacked 5.3098 ms/op 5.6947 ms/op 0.93
validate gossip attestation - struct 2.4834 ms/op 2.6666 ms/op 0.93
validate gossip attestation - treeBacked 2.6817 ms/op 2.6806 ms/op 1.00

by benchmarkbot/action

@twoeths twoeths merged commit 63de147 into master Aug 11, 2021
@twoeths twoeths deleted the dapplion/epochProcess-init branch August 11, 2021 00:40
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.

None yet

3 participants