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

NOD-525: Optimize baker finalization awake updates #1322

Merged
merged 2 commits into from
Feb 14, 2025

Conversation

drsk0
Copy link
Contributor

@drsk0 drsk0 commented Feb 10, 2025

Prevent redundant writes in bsoMarkFinalizationAwakeBakers by only updating BakerPoolRewardDetails when a baker's finalization state actually changes. This avoids unnecessary tree rehashing on each block.

Technical details:

  • Added check before updating BakerPoolRewardDetails

Checklist

  • My code follows the style of this project.
  • The code compiles without warnings.
  • I have performed a self-review of the changes.
  • I have documented my code, in particular the intent of the
    hard-to-understand areas.
  • (If necessary) I have updated the CHANGELOG.

CLA acceptance

_Remove if not applicable.

By submitting the contribution I accept the terms and conditions of the
Contributor License Agreement v1.0

@drsk0 drsk0 requested review from eb-concordium and td202 February 10, 2025 16:06
@td202
Copy link
Contributor

td202 commented Feb 13, 2025

If you haven't, could you double check that we have appropriate test coverage for this? e.g. if you break the test for skipping the update then it gets caught by some test.

Prevent redundant writes in bsoMarkFinalizationAwakeBakers by only
updating  BakerPoolRewardDetails when a baker's finalization state
actually changes. This  avoids unnecessary tree rehashing on each block.

Technical details:
- Added check before updating BakerPoolRewardDetails
@drsk0 drsk0 force-pushed the optimize_mark_finalization_awake_bakers branch from 677586c to b2ed3ae Compare February 13, 2025 14:01
@drsk0
Copy link
Contributor Author

drsk0 commented Feb 13, 2025

@td202 I can't find any coverage for this. Do you have an idea where this could be tested?

@drsk0
Copy link
Contributor Author

drsk0 commented Feb 13, 2025

I added a test to KonsensusV1/EpochTransition.hs.

@drsk0 drsk0 force-pushed the optimize_mark_finalization_awake_bakers branch from 0bbf0f0 to ee40d9e Compare February 13, 2025 17:37
@drsk0 drsk0 merged commit f05da96 into main Feb 14, 2025
3 checks passed
@drsk0 drsk0 deleted the optimize_mark_finalization_awake_bakers branch February 14, 2025 11:05
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.

2 participants