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

soroban-rpc: Implement Captive core usage #4682

Closed
Tracked by #43
paulbellamy opened this issue Nov 1, 2022 · 8 comments
Closed
Tracked by #43

soroban-rpc: Implement Captive core usage #4682

paulbellamy opened this issue Nov 1, 2022 · 8 comments
Assignees

Comments

@paulbellamy
Copy link
Contributor

paulbellamy commented Nov 1, 2022

epic - stellar/stellar-rpc#43

Acceptance Criteria: implement the decision from #4681

[12/16/22] scope of the data backend design in #4681 has widened to cover all data model of rpc and include usage of captive core and ingestion, this came about after RPC design discussion had consensus to go with 0.5 option

  • Horizon usage in rpc to be removed in favor of captive core and new custom ingestion to a data model and persistence layer identified by design.
@paulbellamy paulbellamy changed the title Implement Data Backend to support event streaming soroban-rpc: Implement Data Backend to support event streaming Nov 1, 2022
@paulbellamy paulbellamy moved this to Backlog in Platform Scrum Nov 1, 2022
@jcx120 jcx120 moved this from Backlog to Next Sprint Proposal in Platform Scrum Nov 3, 2022
@jcx120
Copy link

jcx120 commented Nov 3, 2022

This will be based on the final design of data backend (post v1)

@jcx120 jcx120 moved this from Next Sprint Proposal to Backlog in Platform Scrum Nov 3, 2022
@jcx120 jcx120 moved this from Backlog to Next Sprint Proposal in Platform Scrum Dec 3, 2022
@tamirms
Copy link
Contributor

tamirms commented Dec 6, 2022

In #4681 (comment) we determined that SQLite would be the best option to store events in soroban-rpc. https://github.com/tamirms/soroban-events has a prototype which ingests ethereum events into SQLite. This code from this prototype can be lifted and adapted for use in soroban-rpc

@tamirms
Copy link
Contributor

tamirms commented Dec 7, 2022

We will need to implement the following tasks to close this issue:

  • integrate captive core with soroban-rpc
  • use captive core to ingest soroban events from tx-meta into SQLite DB
  • update getEvents rpc endpoint to query events from the SQLite DB

Here is a schema we can use for the SQLite DB:

https://github.com/tamirms/soroban-events/blob/main/migrations/01_init.sql

We should consider the following schema optimizations noted in the design doc:

https://docs.google.com/document/d/1F60xINIbfKrdnGeBBxygeHU3ZlgthRJw8DLXaYDakl0/edit?disco=AAAAkizX2ek
https://docs.google.com/document/d/1F60xINIbfKrdnGeBBxygeHU3ZlgthRJw8DLXaYDakl0/edit?disco=AAAAkizX2eA

For the ingestion component we will need to implement the following sub-tasks:

  • discard any events from the SQLite DB older than the 24 hour threshold so that we retain only 24 hours of data
  • ensure soroban-rpc resumes ingestion from last recorded event in the SQLite DB when it starts up
  • include the latest ingested ledger sequence in the soroban-rpc response (similar to the Latest-Ledger header in horizon)
  • Update the health handler to include a field which indicates whether soroban-rpc has fully ingested its 24 hour window of events and is in sync with the latest ledger in the network

@sreuland sreuland moved this from Next Sprint Proposal to Blocked in Platform Scrum Dec 7, 2022
@sreuland sreuland changed the title soroban-rpc: Implement Data Backend to support event streaming soroban-rpc: Implement Data Backend Dec 16, 2022
@tsachiherman
Copy link
Contributor

per discussion on Friday:
We need to add captive core ( but not remote captive core ) to soroban-rpc. This means that soroban-rpc need to have all the command line arguments needed to support the captive core + adding the invocation of captive core. (#4682)

@sreuland sreuland changed the title soroban-rpc: Implement Data Backend soroban-rpc: Implement Captive core usage Dec 19, 2022
@tamirms tamirms removed their assignment Dec 20, 2022
@tsachiherman tsachiherman assigned tamirms and unassigned 2opremio Dec 20, 2022
@sreuland
Copy link
Contributor

@tamirms , is this still blocked or has #4681 allowed this to proceed? If so, it can go to In Progress or Current Sprint if it's just not actively being worked.

@sreuland
Copy link
Contributor

@tamirms , @2opremio , is this effectively done now? since #322 PR on tools added captive core to rpc.

@2opremio
Copy link
Contributor

This issue is for events (although it doesn’t specify it the title). The tools PR implements captive core support for ledger entries #4717 .

@tamirms
Copy link
Contributor

tamirms commented Jan 23, 2023

I'm closing this issue because we already have #4718 which is tracking supporting events in soroban-rpc

@tamirms tamirms closed this as completed Jan 23, 2023
@github-project-automation github-project-automation bot moved this from Blocked to Done in Platform Scrum Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

6 participants