Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

refactor: separate interface and service in bls_aggr #363

Merged
merged 17 commits into from
Feb 19, 2025

Conversation

damiramirez
Copy link

@damiramirez damiramirez commented Feb 18, 2025

What Changed?

This PR refactors the BLS Aggregator by separating its interface from the internal service logic.

  • Add new struct ServiceHandle to serve as the interface for communicating with the BLS Aggregator service. This interface provides two new methods
    • initialize_task: Sends a message to the BLS Aggregator Service to initialize a new task.
    • process_signature: Sends a message to the BLS Aggregator Service to process a signature.
  • Add new struct AggregateReceiver to receive the aggregated responses from the BLS Aggregator Service.
  • Remove channels from BlsAggregatorService
  • Add new methods to BlsAggregatorService:
    • start: Starts the BLS Aggregator Service running the main loop in background. This method return a tuple with ServiceHandle and AggregateReceiver. User can use these methods to interact with the service.
    • run: Runs the main loop of the BLS Aggregator Service.
  • Remove initialize_new_task and process_new_signature functions since their logic is now integrated in run().

Close #257

Reviewer Checklist

  • New features are tested and documented
  • PR updates the changelog with a description of changes
  • PR has one of the changelog-X labels (if applies)
  • Code deprecates any old functionality before removing it

@damiramirez damiramirez mentioned this pull request Feb 18, 2025
4 tasks
@damiramirez damiramirez marked this pull request as ready for review February 18, 2025 14:54
pablodeymo
pablodeymo previously approved these changes Feb 18, 2025
Copy link
Contributor

@MegaRedHand MegaRedHand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@MegaRedHand MegaRedHand linked an issue Feb 19, 2025 that may be closed by this pull request
@MegaRedHand MegaRedHand enabled auto-merge (squash) February 19, 2025 13:22
@MegaRedHand MegaRedHand merged commit cf37ee2 into Layr-Labs:dev Feb 19, 2025
10 of 11 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor BLS aggregation service to expose interface via handle
3 participants