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

Migrate swing-store shadow copy to x/swingset cosmos store #8031

Closed
mhofman opened this issue Jul 10, 2023 · 0 comments · Fixed by #8143
Closed

Migrate swing-store shadow copy to x/swingset cosmos store #8031

mhofman opened this issue Jul 10, 2023 · 0 comments · Fixed by #8143
Assignees
Labels
cosmic-swingset package: cosmic-swingset enhancement New feature or request

Comments

@mhofman
Copy link
Member

mhofman commented Jul 10, 2023

What is the Problem Being Solved?

#7225 introduced support for state-sync, leveraging the existing vstorage API to store a copy of the swing-store in the cosmos DB.

However the semantics of the vstorage API are not the best fit for large amount of data which are actually never consumed by off-chain clients. Amongst other things vstorage uses an encoding meant for direct children enumeration which makes it expensive to iterate over all entries as needed during state-sync operations.

Description of the Design

  • Introduce a new Prefixed KVStore in the x/swingset module used for holding the "export data" of the swingstore
  • Register a port handler for the x/swingset module, and add a new bridge API for stream exporting swing-store data into this new cosmos store.
  • Update the state-sync logic to use the new store when restoring
  • Add migration logic to place existing swing-store data in the new cosmos store

Security Considerations

None. The new DB is part of the same overall cosmos multi-store, which is similarly hashed under consensus

Scaling Considerations

This is a performance improvement, mostly when performing state-sync restore, but also when streaming swing-store data into the cosmos store.

Test Plan

The existing integration test should cover the state-sync logic
The docker upgrade test should cover the migration
Add new unit tests for the new x/swingset prefixed store

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cosmic-swingset package: cosmic-swingset enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants