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

RPC: No good way to poll recent signatures for an address #19780

Closed
jstarry opened this issue Sep 11, 2021 · 10 comments
Closed

RPC: No good way to poll recent signatures for an address #19780

jstarry opened this issue Sep 11, 2021 · 10 comments
Labels
stale [bot only] Added to stale content; results in auto-close after a week.

Comments

@jstarry
Copy link
Member

jstarry commented Sep 11, 2021

Problem

The getSignaturesForAddress RPC method doesn't support an after option for fetching signatures for transactions that have been processed more recently than the queried signature. This makes it difficult to poll for more recent signatures.

Proposed Solution

Add an after option to getSignaturesForAddress

@CriesofCarrots
Copy link
Contributor

I think that after already exists in the form of the until parameter.
Namely: using until with no before should return all confirmed/finalized (depending on commitment) signatures more recent than the provided signature.

@CriesofCarrots
Copy link
Contributor

Is the issue that the search starts from the most recent signature, so that the limit may kick in before the until signature is reached?

@jstarry
Copy link
Member Author

jstarry commented Sep 11, 2021

Is the issue that the search starts from the most recent signature, so that the limit may kick in before the until signature is reached?

Yes, exactly

@CriesofCarrots
Copy link
Contributor

Hmm, I see. This will definitely require some new plumbing, since typically we work backward in time and only check long-term storage if whatever search is not fully satisfied by the recent ledger in blockstore. I'll think on a performant way to do this. (May want to bundle this plumbing with the blockstore-column rework discussed here: #19515 (comment))

Also, I think it will be somewhat confusing to users to have/disambiguate until and after, so let's think on the rpc interface a little. If I understand correctly, we'd want after to be mutually exclusive with before/until, right?

@jstarry
Copy link
Member Author

jstarry commented Sep 11, 2021

Hmm, I see. This will definitely require some new plumbing, since typically we work backward in time and only check long-term storage if whatever search is not fully satisfied by the recent ledger in blockstore. I'll think on a performant way to do this. (May want to bundle this plumbing with the blockstore-column rework discussed here: #19515 (comment))

Got it, I don't think the need for this is too strong so I think it would be ok if it gets deprioritized for now, especially since it requires new plumbing and it can be worked around with the current API.

If I understand correctly, we'd want after to be mutually exclusive with before/until, right?

Yes, that's what I was thinking.

@chandraprakash
Copy link

chandraprakash commented Jun 22, 2022

Hi All,
I have got a case for above issue by @jstarry , which needs after option.

Use case:
A Solana node (no vote) is running and we poll each new blocks to find relevant account transactions and record it.

If our node goes down for some time and on restarting unable to catch up to the latest slot, we need to start with snapshot (remove --no-snapshot-fetch flag).
Above action leaves gaps in ledger in our node and will miss some relevant transactions if happened.

As suggested in docs, we could use getSignaturesForAddress to fetch all the relevant transactions (if) happened during the gap period from public node or node which was healthy during that time.

Problem is, there is no 'after' parameter which from our records put the last tx that we know before the gap period.
That means, we need to unnecessarily put a bigger limit or send multiple rpc stressing the public node/another active node.

Please let me know if there is a better way to handle this if I am missing something.
If not, then having this parameter will be useful.

Thanks for the good work!

@jstarry
Copy link
Member Author

jstarry commented Jun 22, 2022

I don't believe there is a better way until this issue gets resolved

@CriesofCarrots
Copy link
Contributor

When this PR lands, we'll be in a position to start reworking the AddressSignatures column.

@chandraprakash
Copy link

Looks like the dependent PR is merged now. Any plans of picking this one in near future?

@CriesofCarrots
Copy link
Contributor

Looks like the dependent PR is merged now. Any plans of picking this one in near future?

I have started designing the new AddressSignatures column. There's still quite a bit of lower-level work there before we can start adjusting RPC parameters and behavior

@github-actions github-actions bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Jul 6, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale [bot only] Added to stale content; results in auto-close after a week.
Projects
None yet
Development

No branches or pull requests

3 participants