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

POC for /block #6

Merged
merged 44 commits into from
Jun 28, 2023
Merged

POC for /block #6

merged 44 commits into from
Jun 28, 2023

Conversation

andynog
Copy link
Contributor

@andynog andynog commented May 15, 2023

Closes: #1, #2, #3 and #4

This is the initial logic to insert a block into the database then expose an endpoint /block via the RPC Companion service to serve a response that matches a block response from the full node

@andynog andynog linked an issue May 15, 2023 that may be closed by this pull request
@andynog andynog changed the title Andy/4 database schema block database schema block May 15, 2023
@andynog andynog self-assigned this May 15, 2023
@andynog andynog changed the title database schema block database schema and initial logic to insert block May 15, 2023
@andynog andynog changed the title database schema and initial logic to insert block POC for /block Jun 2, 2023
@andynog andynog added the rpc label Jun 2, 2023
@andynog
Copy link
Contributor Author

andynog commented Jun 28, 2023

This POC implementation relies on the data to be normalized and stored in the database. This seemed to be a good approach initially that would provide lots of benefit in the future for indexing data or creating additional endpoints that would return the data in different shapes and formats that could cater to different use cases.

But as the work progressed, it became apparent that the effort to normalize the data was very time consuming and was not progressing as fast as expected. There are data structures that encompass various levels of nested structures such as the light client attack evidence.

Adding a database schema that could persist this normalized data was very tricky and doesn't seem the way to go. Will merge this code since the logic to return a /block works and it was almost 95% implemented. The work also done in this branch to separate the logic into services is a good start and independent of the underline logic database, which means it can still be re-used after a refactoring.

The next step would be to pivot the POC to focus on an integration test approach. For example select a use case, like a relayer client and create a POC that works with that. The data can be persisted in simpler ways (e.g. minimal structured data and blog storage for nested structure). This should make this solution more feasible and development easier. This will be tracked on a different PR/issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

POC: Implement the database schema to store a block structure POC: Implement the RPC Ingest service
1 participant