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

Implement Validator database functionalities #348

Closed
3 tasks done
Tracked by #375 ...
GMKrieger opened this issue Mar 13, 2024 · 1 comment
Closed
3 tasks done
Tracked by #375 ...

Implement Validator database functionalities #348

GMKrieger opened this issue Mar 13, 2024 · 1 comment
Assignees
Labels
#feat:output-unification Feature: Output Unification
Milestone

Comments

@GMKrieger
Copy link
Contributor

GMKrieger commented Mar 13, 2024

📚 Context

The base migrations (#347) guarantee only minimal functionality for the database, and tables and functions to support it. It's, as the name implies, the first block from which other blocks can be built upon, and need nothing else to exist.

The validator will need additional support to execute its task, and the repository needs to be updated beforehand to accommodate this. We will need to create additional tables, relations, constraints, as well as implement ways to interact with this information in a safe and atomic way.

It's important to bring attention to how we interact with the data to keep the database consistent, as some transactions are only valid if all the parts move accordingly.

✔️ Solution

The database model will be updated to the following:

Image

Four new tables will be created:

  • The node_state table contains only one tuple, doesn't have any way to insert besides an initial setup, and updates with pertinent values that can be accessed by the Node as needed.
  • The epochs table contains the start block and end block of each epoch
  • The claims table contains the InputRange required to index epoch hashes by the contracts, the epoch hash and the application address
  • The proofs table contains the calculated proof, and is connected to the input that generated the output, the output that the proof was calculated and the claim that triggered the process

The validator mock (#369) has an interface on how he expects to interact with the database, and will be implemented as requested.

📈 Subtasks

  • Create new migration for the validator
  • Implement necessary repository functions
  • Create tests for the new functions
@GMKrieger GMKrieger self-assigned this Mar 13, 2024
@GMKrieger GMKrieger added #feat:output-unification Feature: Output Unification ! High priority #feat:graphql Feature: GraphQL API labels Mar 13, 2024
@GMKrieger GMKrieger added this to the 2.0.0 milestone Mar 13, 2024
@GMKrieger GMKrieger changed the title Implement ORM functions for database Implement Validator database functionalities Apr 3, 2024
@GMKrieger GMKrieger removed ! High priority #feat:graphql Feature: GraphQL API labels Apr 3, 2024
@GMKrieger GMKrieger mentioned this issue Apr 10, 2024
49 tasks
@marcelstanley
Copy link
Collaborator

Done at #433

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#feat:output-unification Feature: Output Unification
Projects
Status: Done
Development

No branches or pull requests

2 participants