Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.

Add compute node deregistration and stake reclamation #255

Merged
JannikSt merged 5 commits into
PrimeIntellect-ai:developfrom
marcogiglio:feature/node-deregistration
Apr 22, 2025
Merged

Add compute node deregistration and stake reclamation #255
JannikSt merged 5 commits into
PrimeIntellect-ai:developfrom
marcogiglio:feature/node-deregistration

Conversation

@marcogiglio
Copy link
Copy Markdown
Contributor

@marcogiglio marcogiglio commented Apr 13, 2025

This PR introduces full support for deregistering compute nodes from the Prime Network and reclaiming associated stakes. Changes include:

  • Added remove_compute_node method to PrimeNetworkContract
  • Implemented reclaim_stake for providers
  • Introduced new Deregister CLI command
  • Extended ComputeNodeOperations and ProviderOperations with deregistration logic

Motivation:
I've been experimenting with the protocol and running some compute nodes over the past few weeks. I realized it could be useful for providers to have a command that allows them to remove a node from an active pool and reclaim the associated stake. This can be helpful for scenarios like rotating private credentials or freeing up staked tokens for liquidity needs.

I implemented the necessary changes to support this functionality and tested it locally.

Let me know if you think this addition would be valuable, and if there's anything I can do to improve the PR.
Best,
Marco

@manveerxyz manveerxyz requested review from JannikSt and mattdf and removed request for JannikSt April 13, 2025 19:02
@manveerxyz
Copy link
Copy Markdown
Contributor

manveerxyz commented Apr 13, 2025

appreciate the PR marco!

@JannikSt wondering if it'd be a good idea to also add this to the worker setup/init process? i.e. if a user is booting up a new worker and they have old nodes that they haven't de-registered and reclaimed stake for, we can prompt them if they want to automatically do that before joining with their new node?

since i'd imagine that some users just aren't aware of the fact that they have zombie nodes with reclaimable stake.

marcogiglio and others added 5 commits April 21, 2025 17:31
- Added `remove_compute_node` method to `PrimeNetworkContract` for deregistering a node on-chain
- Added `reclaim_stake` method to allow providers to withdraw their stake
- Introduced `Deregister` CLI command to remove a compute node from a pool and reclaim stake
- Extended `ComputeNodeOperations` and `ProviderOperations` with corresponding async methods
Copy link
Copy Markdown
Member

@JannikSt JannikSt left a comment

Choose a reason for hiding this comment

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

@marcogiglio Thank you for your contribution - I've made some minor adjustments but your code already works like a charme!

@JannikSt JannikSt merged commit 39d3fdb into PrimeIntellect-ai:develop Apr 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants