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

altair.processAttestation() performance issue #2618

Closed
dapplion opened this issue Jun 2, 2021 · 1 comment · Fixed by #2626
Closed

altair.processAttestation() performance issue #2618

dapplion opened this issue Jun 2, 2021 · 1 comment · Fixed by #2626
Assignees
Labels
prio-high Resolve issues as soon as possible. scope-performance Performance issue and ideas to improve performance.

Comments

@dapplion
Copy link
Contributor

dapplion commented Jun 2, 2021

Describe the bug

altair.processAttestation() calculates the total balance of the validator set for every index of every attestation.

Screenshot from 2021-06-02 14-47-01
Screenshot from 2021-06-02 14-47-20

Expected behavior

This part should be optimized, and compute that total balance the least number of times possible.

@dapplion dapplion added prio-high Resolve issues as soon as possible. scope-performance Performance issue and ideas to improve performance. labels Jun 2, 2021
@twoeths
Copy link
Contributor

twoeths commented Jun 3, 2021

  • We don't have to always call getBaseRewards if the participation is good for an epoch (i.e. the participation has timely source + target + head already)
  • Improve getBaseRewards: getBaseRewardPerIncrement() should be the same for an epoch so it should be cached in EpochContext

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prio-high Resolve issues as soon as possible. scope-performance Performance issue and ideas to improve performance.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants