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

[WIP][Persistence][Core][Savepoints/Rollbacks] Implement KISS SavePoints - Serialize WorldState from Persistence - JSON POC - (Issue #327) #645

Closed

Conversation

deblasis
Copy link
Contributor

@deblasis deblasis commented Apr 3, 2023

Description

⚒️ work in progress - proof of concept ⚒️

This PR is meant to provide an example of how the implementation that relies on a serialized state that uses JSON would look like.

The implementation is not complete.

The test:
image
(source: persistence/test/savepoints_test.go)

and related code provide an example of how it would look like.

The steps are:

  • Given a PostgresContext, we can create a SavepointFactory
  • The SavepointFactory can create Savepoints
  • A Savepoint implements PersistenceReadContext and therefore it provides access to the state like if it was the database (this is to allow ephemeral state)
  • The test shows two examples of queries performed on this serialized state (GetAllAccounts and GetAccountAmount)

Issue

If we choose to complete the implementation, it would fix #327

Type of change

Please mark the relevant option(s):

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Major breaking change
  • Documentation
  • Other

List of changes

Testing

  • make develop_test; if any code changes were made
  • Docker Compose LocalNet; if any major functionality was changed or introduced
  • k8s LocalNet; if any infrastructure or configuration changes were made

Required Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added, or updated, godoc format comments on touched members (see: tip.golang.org/doc/comment)
  • I have tested my changes using the available tooling
  • I have updated the corresponding CHANGELOG

If Applicable Checklist

  • I have updated the corresponding README(s); local and/or global
  • I have added tests that prove my fix is effective or that my feature works
  • I have added, or updated, mermaid.js diagrams in the corresponding README(s)
  • I have added, or updated, documentation and mermaid.js diagrams in shared/docs/* if I updated shared/*README(s)

@deblasis deblasis added core Core infrastructure - protocol related utility Utility specific changes persistence Persistence specific changes labels Apr 3, 2023
@deblasis deblasis self-assigned this Apr 3, 2023
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

The changelog validation failed with the following output:
Missing changelog in module: consensus/

Missing changelog in module: persistence/

Missing changelog in module: shared/

Changelog verification failed. See error messages for more detail.

Please update the relevant CHANGELOG.md files and ensure they follow the correct format.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

The changelog validation failed with the following output:
Missing changelog in module: persistence/

Missing changelog in module: shared/

Changelog verification failed. See error messages for more detail.

Please update the relevant CHANGELOG.md files and ensure they follow the correct format.

@Olshansk
Copy link
Member

Closing out the draft PR as it'll be used as a reference and reopened if/when we fully implement it.

@Olshansk Olshansk closed this Apr 19, 2023
@reviewpad reviewpad bot added the large label Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core infrastructure - protocol related persistence Persistence specific changes utility Utility specific changes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Persistence][Core][Savepoints/Rollbacks] Implement KISS SavePoints - Serialize WorldState from Persistence
2 participants