Astar icon indicating copy to clipboard operation
Astar copied to clipboard

Complete dApp removal from dApp staking v3

Open Dinonard opened this issue 1 year ago • 0 comments

Description

Even after dApp has been unregistered from the dApp staking v3, it will still occupy space inside the protocol. It's kept under IntegratedDApps storage, only the state is changed into Unregistered.

All of the unclaimed rewards will also remain in storage.

The problems here are:

  • dApp Id is u16, and it's not a limitless number 🙂
  • if after dAPp unregistration, Id would also be released and reused by a new dApp, it would allow new dApp owner to potentially claim old unclaimed dApp rewards, which is wrong

There should be a system in place which frees up dApp Ids for reuse, after enough time has passed (i.e. rewards have expired) after old dApp unregistration.

Alternative is to use u32 instead of u16 but that would make it more problematic in respect to PoV size so for now this isn't an option.

This isn't something that needs to be addressed soon since we're unlikely to hit this wall anytime soon.

Dinonard avatar Jan 23 '24 16:01 Dinonard