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

Provide a suggested checkpoint if rollback_to slot doesn't exist #95

Closed
KtorZ opened this issue Dec 31, 2022 Discussed in #90 · 0 comments
Closed

Provide a suggested checkpoint if rollback_to slot doesn't exist #95

KtorZ opened this issue Dec 31, 2022 Discussed in #90 · 0 comments
Assignees
Milestone

Comments

@KtorZ
Copy link
Member

KtorZ commented Dec 31, 2022

Discussed in #90

Originally posted by Quantumplation December 10, 2022

Describe your idea, in simple words.

Suppose I want to track a new wallet, and I know the slot where I first sent it funds;

I don't want to provide that slot as the rollback point, because that will exclude the initial funds that were sent to the wallet.

So, I take the slot number (something like 79136895), and truncate it to a nice whole number (something like 79136000). This fails.

My suggestion is to either:

  • provide an alternative payload that allows me to specify ancestor_to which uses the checkpoint to find the most recent ancestor
  • update the hint message that is returned to describe this, and include a suggested slot, such as
{
  "hint":"The provided point (or slot) is unknown. Please provide an existing point from the past.  Either a block wasn't produced in that slot, or it is very recent. Note that if you provide a very recent point (e.g. 1-3 blocks old), it can happen that the point disappear should a rollback happen between the moment you looked it up and the moment you make this query.",
  "suggested_checkpoint": "79135995"
}

Why is it a good idea?

The first proposal would reduce the needed API calls by one, and save a round trip.
The second proposal would at least make the workflow, when doing things by hand, more obvious.

Are you willing to work on it yourself?

Yes, but as always, I doubt I'd have the time unless someone were to provide some hints at source files to look at. 😅

@KtorZ KtorZ added this to the v2.2.0 milestone Dec 31, 2022
@KtorZ KtorZ self-assigned this Dec 31, 2022
@KtorZ KtorZ closed this as completed in 14da8a3 Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant