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

clients/stellarcore: Add support for Core's new HTTP endpoints #5426

Open
Tracked by #5433
Shaptic opened this issue Aug 13, 2024 · 0 comments · Fixed by #5428
Open
Tracked by #5433

clients/stellarcore: Add support for Core's new HTTP endpoints #5426

Shaptic opened this issue Aug 13, 2024 · 0 comments · Fixed by #5428

Comments

@Shaptic
Copy link
Contributor

Shaptic commented Aug 13, 2024

Protocol 23: Core Endpoints

Epics: #5433, stellar/stellar-rpc#267


Stellar Core will have one new high-performance HTTP endpoint as part of their v22 in stellar/stellar-core#4350 which is supported as part of #5428. It will have three more in v23. We need to support them. The endpoint schemas are defined in this document and are replicated here (please check the document to ensure the following schemas are not outdated).

Request format

Each endpoint needs to be implemented into the stellarcore client as its described here. The format for every endpoint is the same POST request:

ledgerSeq=N&key=base64&key=base64...

Here, ledgerSeq is an optional uint32 number and each key is a base64-encoded xdr.LedgerKey. If the ledgerSeq is not available on the given instance, a 404 will be returned.

Response formats

Protocol 23: /getledgerentry

JSON response (as a TypeScript interface):

interface Response {
  ledger: number; // uint32
  entries: {
    e: string; // base64-encoded xdr.LedgerEntry
    state: "live" | "new_entry_no_proof" | "new_entry_proof" | "archived_no_proof" | "archived_proof"
  }[]

Note that this is REPLACING the existing endpoint, meaning we need to ensure that all code paths that use the current variant of the endpoint are updated correctly. The best way to do this, in my opinion, is to remove the stellarcore.Client.GetLedgerEntry entirely and add support into a new GetLedgerEntries, so any code referencing the old method will break.


Protocol 23: /getinvocationproof

JSON response (as a TypeScript interface):

interface Response {
  ledger: number; // uint32
  proof?: string; // base64-encoded xdr.ArchivalProof
}

Note that if a proof is not required for any of the given entries, proof will be omitted.

Protocol 23: /getrestorationproof

JSON response (as a TypeScript interface):

interface Response {
  ledger: number; // uint32
  proof?: string; // base64-encoded xdr.ArchivalProof
}

Note that if a proof is not required for any of the given entries, proof will be omitted.

Notes

Core does not have a build ready with these endpoints so they cannot be tested end-to-end (hence the Blocked label). However, we can still implement the schemas in anticipation of these interfaces.

@Shaptic Shaptic added blocked blocked by another issue go Pull requests that update Go code rpc-sdk-scrum Protocol 22 labels Aug 13, 2024
@Shaptic Shaptic added this to the platform sprint 50 milestone Aug 13, 2024
@Shaptic Shaptic moved this from Backlog to To Do in Platform Scrum Aug 13, 2024
@Shaptic Shaptic moved this from To Do to In Progress in Platform Scrum Aug 14, 2024
@Shaptic Shaptic self-assigned this Aug 14, 2024
@Shaptic Shaptic added Protocol 23 and removed go Pull requests that update Go code labels Aug 19, 2024
@Shaptic Shaptic mentioned this issue Aug 19, 2024
10 tasks
@Shaptic Shaptic added the breaking-change Breaking change tag label Aug 19, 2024
@2opremio 2opremio moved this from In Progress to Blocked in Platform Scrum Aug 27, 2024
@Shaptic Shaptic linked a pull request Sep 17, 2024 that will close this issue
7 tasks
@Shaptic Shaptic removed the blocked blocked by another issue label Nov 13, 2024
@Shaptic Shaptic moved this from Blocked to To Do in Platform Scrum Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Blocked
Development

Successfully merging a pull request may close this issue.

3 participants