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

Abstract Repair Service Actions #4996

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

bw-solana
Copy link

@bw-solana bw-solana commented Feb 14, 2025

Problem

fn run in RepairService is over 200 lines and super hard to understand the first time. It would be a little easier to understand things by abstracting away the large chunks of actions that are happening.

Given we have plans to improve the repair algorithm, making it easier for more people to understand seems worthwhile.

Summary of Changes

This list maps to the commits to help make it easier to digest

  1. Add repair iteration function to abstract everything happening inside the run loop (except reporting stats/sleeping)
  2. cleanup a few things and un-nest the stuff that was under let repair = {. Not sure why we ever needed that...
  3. Sub-function for update weighting heuristic
  4. Sub-function for handle popular pruned forks
  5. Sub-function for build and send repair
  6. Sub-function for identify repairs
  7. Cleanup some places where we are using an intermediate var when it's not necessary

@bw-solana bw-solana mentioned this pull request Feb 15, 2025
@bw-solana bw-solana changed the title repair iteration function Abstract Repair Service Actions Feb 15, 2025
@bw-solana bw-solana marked this pull request as ready for review February 15, 2025 02:21
@bw-solana bw-solana requested a review from steviez February 15, 2025 02:21
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.

1 participant