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

refactor(statesync): implement statesync peer manager #648

Merged
merged 19 commits into from
Aug 21, 2023

Conversation

shotonoff
Copy link
Collaborator

@shotonoff shotonoff commented Jun 23, 2023

Issue being fixed or feature implemented

This is PR is related to the task TD-162:

Each module that communicates with p2p peers has its own simple peer manager implementation. Usually the code is placed into a reactor. As a result of the refactoring, peer management has been moved out of the reactor and into a separate component.
The component must listen to peer up and down events and register the peer into the peer store or remove it.

What was done?

  • Migrate p2p statesync channel descriptors in p2p module
  • Declare SnapshotClient interface and implement it
  • Implement peer-manager component and peer-update subscriber
  • Additionally create LightBlockRepository

How Has This Been Tested?

Add a couple unit-tests

Breaking Changes

N/A

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@github-actions
Copy link

github-actions bot commented Jul 4, 2023

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Jul 4, 2023
@github-actions github-actions bot closed this Jul 9, 2023
@shotonoff shotonoff reopened this Jul 11, 2023
@github-actions github-actions bot removed the Stale label Jul 12, 2023
@lklimek
Copy link
Collaborator

lklimek commented Jul 14, 2023

PR title is confusing, we already have peer manager implemented in p2p

@shotonoff shotonoff changed the title refactor(statesync): implement peer manager refactor(statesync): implement statesync peer manager Jul 18, 2023
@shotonoff shotonoff changed the base branch from v0.12-dev to v0.13-dev July 20, 2023 15:39
internal/p2p/channel_params.go Show resolved Hide resolved
internal/p2p/client/client.go Show resolved Hide resolved
internal/peer/store.go Outdated Show resolved Hide resolved
internal/peer/store.go Outdated Show resolved Hide resolved
internal/statesync/peer.go Outdated Show resolved Hide resolved
internal/statesync/repo.go Outdated Show resolved Hide resolved
@shotonoff shotonoff requested a review from lklimek July 26, 2023 13:41
Copy link
Collaborator Author

@shotonoff shotonoff left a comment

Choose a reason for hiding this comment

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

PR is ready to new round review

internal/peer/store.go Outdated Show resolved Hide resolved
internal/p2p/channel_params.go Show resolved Hide resolved
internal/peer/store.go Outdated Show resolved Hide resolved
internal/statesync/peer.go Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Aug 6, 2023

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Aug 6, 2023
@github-actions github-actions bot closed this Aug 10, 2023
@shotonoff shotonoff reopened this Aug 10, 2023
@github-actions github-actions bot removed the Stale label Aug 11, 2023
lklimek
lklimek previously approved these changes Aug 14, 2023
@shotonoff shotonoff merged commit 8fe858f into v0.13-dev Aug 21, 2023
16 checks passed
@shotonoff shotonoff deleted the refactor/td-162-implement-statesync-peer-manager branch August 21, 2023 10:00
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