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

Remove multiple best tip blocks for actions, if they exist #817

Merged
merged 3 commits into from
Apr 4, 2023

Conversation

MartinMinkov
Copy link
Contributor

@MartinMinkov MartinMinkov commented Mar 28, 2023

Description:

This PR addresses an issue with fetching action data in the case where multiple blocks are returned at the best tip. It introduces a temporary fix that filters out blocks at the best tip, ensuring that we only work with a single best tip block.

Changes:

Added distanceFromMaxBlockHeight to the blockInfo object in the FetchedActions type and in the getActionsQuery.
Implemented a temporary fix that filters out multiple best tip blocks, if they exist, while fetching actions. This fix will be removed once the related issue in the Archive-Node-API repository (o1-labs/Archive-Node-API#7) is resolved.
This change helps improve the reliability of fetching action data and ensures that the fetched data is consistent with the latest network state.

@MartinMinkov MartinMinkov marked this pull request as ready for review March 28, 2023 17:20
Copy link
Member

@Trivo25 Trivo25 left a comment

Choose a reason for hiding this comment

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

Nice! Quick and simple fix

This fix will be removed once the related issue in the Archive-Node-API repository (o1-labs/Archive-Node-API#7) is resolved

I wonder if it's worth waiting, whats the estimate on that?

@MartinMinkov
Copy link
Contributor Author

MartinMinkov commented Mar 29, 2023

Nice! Quick and simple fix

This fix will be removed once the related issue in the Archive-Node-API repository (o1-labs/Archive-Node-API#7) is resolved

I wonder if it's worth waiting, whats the estimate on that?

Good question! To implement the best-tip selection algorithm that's used, we need a redeployment of Berkeley to happen. The Archive Node schema needed two required fields to compute the algorithm, so currently, we can't do it. Once we redeploy Berkeley and migrate the block data for the old blocks, we can implement the algorithm.

Seems worth it to implement this fix right now and then patch the fix once Berkeley is redeployed :)

@MartinMinkov MartinMinkov merged commit f460877 into main Apr 4, 2023
@MartinMinkov MartinMinkov deleted the fix/duplicate-actions-best-tip branch April 4, 2023 17:48
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

Successfully merging this pull request may close these issues.

2 participants