Skip to content

refactor and cleans up supernode code#58

Merged
j-rafique merged 1 commit intomasterfrom
cascadeSupernodeCleanup
May 13, 2025
Merged

refactor and cleans up supernode code#58
j-rafique merged 1 commit intomasterfrom
cascadeSupernodeCleanup

Conversation

@j-rafique
Copy link
Contributor

No description provided.

@j-rafique j-rafique requested a review from mateeullahmalik May 12, 2025 15:45
@j-rafique j-rafique self-assigned this May 12, 2025
@a-ok123 a-ok123 requested a review from Copilot May 12, 2025 16:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the cascade registration flow and cleans up the supernode code by removing unused constants, streamlining dependencies through adaptor interfaces, and refining task creation and error handling. Key changes include:

  • Removal of unused P2P constants and deprecation of storage-specific methods.
  • Refactoring of CascadeRegistrationTask to use adaptor services for encoding, storage, and Lumera interactions.
  • Renaming and dependency injection changes in the cascade action server for improved modularity and clearer logging.

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
supernode/services/common/p2p.go Removed obsolete P2P constant definitions.
supernode/services/cascade/task.go Removed storage initialization from task creation.
supernode/services/cascade/service.go Updated service fields and task creation using new adaptor interfaces.
supernode/services/cascade/register.go Revised error wrapping and parameter passing in the cascade registration flow.
supernode/services/cascade/helper.go Refactored encoding and artefact storage to use adaptor services.
supernode/services/cascade/adaptors/* Introduced new adaptor interfaces for Codec, P2P, and Lumera clients.
supernode/node/action/server/cascade/cascade_action_server.go Renamed server type and switched to a factory-based task creation.
pkg/logtrace/fields.go Added new fields for task and action IDs to enhance logging.
go.mod Added a module replace directive for local development.
Comments suppressed due to low confidence (2)

supernode/node/action/server/cascade/cascade_action_server.go:14

  • [nitpick] Renaming the server type from CascadeActionServer to ActionServer may reduce clarity regarding its association with cascade operations. Consider retaining 'Cascade' in the type name if the specificity is important for the public API.
type ActionServer struct {

supernode/services/cascade/adaptors/p2p.go:91

  • [nitpick] The down-sampling logic using shuffle and slicing is concise; however, it would be beneficial to double-check that the computation for the 'want' variable (based on storeSymbolsPercent) meets the intended sampling rate in all cases.
if len(keys) > loadSymbolsBatchSize {

@j-rafique j-rafique merged commit 792ed6f into master May 13, 2025
3 checks passed
@j-rafique j-rafique deleted the cascadeSupernodeCleanup branch June 3, 2025 09:20
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.

3 participants