Skip to content

Conversation

Sahilgill24
Copy link

@Sahilgill24 Sahilgill24 commented Aug 11, 2025

What was wrong?

Issue #572

How was it fixed?

Currently work in progress

This is currently the implementation of the MVP resource manager, more details about the implementation plan are added in the #572 itself.

1.) The main components of the resource manager are the scopes and the limits, so we will begin by just implementing them and then move on to others like metrics and garbage collection. The below diagram shows the folder structure

libp2p/rcmgr/
├── __init__.py
├── limits.py         # ResourceLimits, Limiter interface
├── scope.py          # ResourceScope base class
├── manager.py        # Main ResourceManager
├── exceptions.py     # Custom exceptions
└── allowlist.py      # allowlist manager

2.) A base ResourceManager class would be our main data structure similiar to the go-libp2p's struct and would be defined in the ⁠ manager.py ⁠ file and also include the logic for resource transfer from different scopes to their children scopes.

3.) Each scope would be a different Class as well in the ⁠ scope.py ⁠ file mimicking the structure of the go-libp2p's implementation and respectively writing the main functions corresponding to them.

4.) The limits for each scope would also be defined in the ⁠ limits.py ⁠ file along with the limiter interface. The ⁠ allowlist.py ⁠ file would manage the allowlists for all the scopes as well as contain the default parameters.

To-Do

  • Implementing various scopes
  • Creating separate allowlists
  • Adding the proper metrics
  • testing the implementation

@Sahilgill24 Sahilgill24 changed the title feat: basic template for the resource manager feat: implementing a resource manager to prevent resource exhaustion attacks Aug 12, 2025
@seetadev
Copy link
Contributor

@Sahilgill24 : Hi Sahil. Thank you for submitting the PR. Appreciate it.

Please resolve the CI/CD issues. CCing @acul71 and @sumanjeet0012, who will help you arrive at a good conclusion on the issue.

@acul71
Copy link
Contributor

acul71 commented Aug 26, 2025

@Sahilgill24 : Hi Sahil. Thank you for submitting the PR. Appreciate it.

Please resolve the CI/CD issues. CCing @acul71 and @sumanjeet0012, who will help you arrive at a good conclusion on the issue.

The CI/CD issues could be resolved, but commits are just the basic structure of the project, so let's here form @Sahilgill24 when he planned to work on this.

@seetadev
Copy link
Contributor

seetadev commented Sep 4, 2025

@acul71 : Sure, thank you for your feedback. Appreciate it.

As recommended by you in the recent maintainer call, wish to request @Sahilgill24 to add @acul71 (Luca) and @bomanaps (Mercy) as collaborators to this project. They wish to contribute alongside on this important issue raised by rust-libp2p team.

@seetadev
Copy link
Contributor

@acul71 : Please let us know if there are any bottlenecks faced in this PR. CCing @lla-dane and @sumanjeet0012.

We have been advised to have this PR landed soon.

@acul71
Copy link
Contributor

acul71 commented Sep 18, 2025

@acul71 : Please let us know if there are any bottlenecks faced in this PR. CCing @lla-dane and @sumanjeet0012.

We have been advised to have this PR landed soon.

@Sahilgill24 don't respond, and I don't think we have been added as collaborators.
Maybe kind of start from scratch looking at go impl?

@Sahilgill24
Copy link
Author

Sahilgill24 commented Sep 18, 2025

hey @acul71 @seetadev sorry for the delay,

just pushing in the changes for the basic MVP currently related to the stream scope, system scope and the connection scope first and completion of the basic templates

@seetadev also please don't run the CI/CD pipeline currently.

@acul71
Copy link
Contributor

acul71 commented Sep 18, 2025

hey @acul71 @seetadev sorry for the delay,

just pushing in the changes for the basic MVP currently related to the stream scope, system scope and the connection scope first and completion of the basic templates

@seetadev also please don't run the CI/CD pipeline currently.

can you add me and @bomanaps as collaborator (to be able to push to your repo/branch)

@Sahilgill24
Copy link
Author

Added you both @acul71 @bomanaps as a collaborator , please accept the invitation on your respective mails.

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