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

feat: implemente Msgs for SP exit #534

Merged
merged 30 commits into from
Dec 22, 2023
Merged

feat: implemente Msgs for SP exit #534

merged 30 commits into from
Dec 22, 2023

Conversation

alexgao001
Copy link
Collaborator

@alexgao001 alexgao001 commented Dec 4, 2023

Description

This PR adds required msg for SP exit.

SP graceful exit process:

  1. The SP which wants to exit to send a tx with MsgStorageProviderExit, it is status will become STATUS_GRACEFUL_EXITING
  2. All other SPs are encouraged to be the successors of the exiting SP's Global Virtual Group family(GVGF) as primary SP, or Global Virtual group(GVG) as secondary. They can send a tx with MsgReserveSwapIn to reserve the position.
  3. Once successor got all data stored properly. They will send a tx with MsgCompleteSwapIn to ack the success, within GVGF/GVG, SP replacement will take place.
  4. If the SP has no more GVGF/GVG related, anyone can send a tx with MsgCompleteStorageProviderExit to complete such SP's exit, deposit onto Greenfield will be refund to the exit SP.

SP forced exit process:

A uncooperative SP refuses to provide service will be put into STATUS_FORCED_EXITING executing MsgStorageProviderForceExit via governance. Other SP would do the same as above step 2-3. Eventually,
If the SP has no more GVGF/GVG related, anyone can send a tx with MsgCompleteStorageProviderExit to complete such SP's exit, deposit onto Greenfield will be transfer to payment module account.

Modification to current Msgs:

MsgCompleteStorageProviderExit. Anyone can trigger the tx for a graceful_exit or forced_exit SP to complete the exit process. Previous deposit onto Greenfield will be refund to the exit SP or transferred to gov module.

MsgUpdateBucketInfo. When a SP is in STATUS_GRACEFUL_EXITING or STATUS_FORCED_EXITING, buckets it served will not be allowed to update(quota).

MsgDiscontinueObject. A successor primary SP can discontinue objects that the exititng SP serves.

Rationale

Example

add an example CLI or API response...

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

Potential Impacts

  • add potential impacts for other components here
  • ...

@alexgao001 alexgao001 added the wip label Dec 4, 2023
@alexgao001 alexgao001 force-pushed the adapt-sp-exit branch 2 times, most recently from e0f9672 to a271740 Compare December 4, 2023 10:04
Copy link
Contributor

@forcodedancing forcodedancing left a comment

Choose a reason for hiding this comment

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

fix conflicts

x/virtualgroup/types/params.go Outdated Show resolved Hide resolved
x/virtualgroup/types/params.go Show resolved Hide resolved
x/virtualgroup/keeper/grpc_query.go Outdated Show resolved Hide resolved
x/virtualgroup/keeper/keeper.go Outdated Show resolved Hide resolved
x/virtualgroup/keeper/keeper.go Outdated Show resolved Hide resolved
x/virtualgroup/keeper/keeper.go Outdated Show resolved Hide resolved
x/virtualgroup/keeper/msg_server.go Outdated Show resolved Hide resolved
x/virtualgroup/keeper/msg_server.go Outdated Show resolved Hide resolved
x/virtualgroup/keeper/msg_server.go Outdated Show resolved Hide resolved
x/virtualgroup/keeper/msg_server.go Outdated Show resolved Hide resolved
e2e/core/basesuite.go Outdated Show resolved Hide resolved
app/upgrade.go Outdated

// enable bucket migration
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please don't enable Bucket migration in this release, let's leave it to the next version.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

disabled

@unclezoro unclezoro added this pull request to the merge queue Dec 22, 2023
Merged via the queue into develop with commit ee8d145 Dec 22, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants