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

Add indices endpoint #90

Merged
merged 4 commits into from
Sep 6, 2024
Merged

Add indices endpoint #90

merged 4 commits into from
Sep 6, 2024

Conversation

n8maninger
Copy link
Member

@n8maninger n8maninger commented Sep 6, 2024

Ran into a major performance degredation when retrieving blocks after merging #88. Noticed an index was missing. This adds the missing index, but also refactors it a bit. (Merged in #91)

There is a transaction on mainnet that has been included in 14,000 blocks. explored takes a long time to load the block with the transaction even with the index. Sia Central crashes when trying. This brings up an interesting question of how to proceed if a transaction were to be included in every block?

One option is arbitrarily capping the indices a transaction will return. This is fine, but it may be a requirement to know every block a transaction is included in. The preferred solution is to split it into two endpoints. Data on the chain indice endpoint is capped by the usual limit and offset pagination parameters to keep responses reasonable.

@n8maninger n8maninger force-pushed the nate/add-indices-endpoint branch from 2a57c5c to 8b47464 Compare September 6, 2024 20:17
Copy link
Member

@chris124567 chris124567 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any issues with this. I didn't know there was a such a prolific transaction (14k blocks!) but given that I do now the pagination seems like the best approach.

@n8maninger n8maninger merged commit 19687fa into master Sep 6, 2024
7 checks passed
@n8maninger n8maninger deleted the nate/add-indices-endpoint branch September 6, 2024 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants