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

[Pallets] Remove unused storage data sets #299

Open
sea212 opened this issue Sep 13, 2021 · 0 comments
Open

[Pallets] Remove unused storage data sets #299

sea212 opened this issue Sep 13, 2021 · 0 comments
Labels
p:low Low priority, resolution of this issue can wait t:enhancement The issue described an enhancement

Comments

@sea212
Copy link
Member

sea212 commented Sep 13, 2021

Pools
Currently a pool is only set as stale and never removed. Every pool that every existed will persist in storage for all time.
This is the same for markets.
Once we have Subsquid set up to gather all this data, we can remove the swap pools and markets (and any other data sets) that are not needed anymore. This will reduce the memory requirement for nodes over a longer period of time.
To verify the correctness of the data, anyone can verify the Subsquid code and run a local instance.

Markets
Markets that reach their end of the life, for example by being resolved or closed prematurely (e.g., not approved, not enough subsidy), are currently left in storage. Over time this is not an applicable approach, because it will bloat the storage with data that can be fetched through alternative means, for example:

  • Querying the archived markets in SubSquid using GraphQL
  • Querying an archival node at a specific block

One issue that blocks the implementation of that feature is about the redemption of ZTG for winning outcome assets. Currently, the user who owns a winning outcome asset has to redeem ZTG for it manually. There is no time limit to that. Possible approaches to that are:

  • Redeem the ZTG automatically (currently every winning account is iterated anyways during resolution) - in that case some optimizations in regards to the iteration are required to execute it efficiently.
  • Create a minimal version of the market (i.e. MarketId and ResolvedOutcome) that serves as a reference for redemptions.
@sea212 sea212 added p:low Low priority, resolution of this issue can wait t:enhancement The issue described an enhancement labels Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p:low Low priority, resolution of this issue can wait t:enhancement The issue described an enhancement
Projects
None yet
Development

No branches or pull requests

1 participant