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

Port over best tip selection algorithm to TypeScript #7

Closed
MartinMinkov opened this issue Feb 14, 2023 · 6 comments · Fixed by #80
Closed

Port over best tip selection algorithm to TypeScript #7

MartinMinkov opened this issue Feb 14, 2023 · 6 comments · Fixed by #80
Assignees
Labels
product-eng For tracking our team's issues

Comments

@MartinMinkov
Copy link
Collaborator

MartinMinkov commented Feb 14, 2023

To have a good way of selecting the best tip among multiple blocks at the tip of the network, we need to implement a selection algorithm. We can port over the current algorithm here in TypeScript to do so: https://github.com/MinaProtocol/mina/blob/bff1e117ae4740fa51d12b32736c6c63d7909bd1/src/lib/consensus/proof_of_stake.ml#L2950

@MartinMinkov MartinMinkov self-assigned this Feb 14, 2023
@nicc
Copy link
Collaborator

nicc commented Feb 15, 2023

Indirectly Irresponsible Individual: @bkase

@MartinMinkov
Copy link
Collaborator Author

This cannot be implemented now as last_vrf_output and sub_window_densities are missing from the Archive Node schema. This will have to wait until changes to the Archive Node schema are made.

@MartinMinkov
Copy link
Collaborator Author

MartinMinkov commented Mar 1, 2023

Changes to incorporate the data is located here: MinaProtocol/mina#12750

@MartinMinkov
Copy link
Collaborator Author

With the new Berkeley redeployment, this is now actionable and ready to implement 🥳

@nicc nicc added the product-eng For tracking our team's issues label Apr 17, 2023
@shimkiv
Copy link
Member

shimkiv commented May 31, 2023

@MartinMinkov should this one fix an issue when Archive-Node-API returned duplicated data for the short period of time because of the chain reorg?
Example, create zkapp txn with events/actions in env. where forks are more frequent (light network), then wait until it will be added into the block and query Archive-Node-API for events/actions. In case when forks are more frequent API will return duplicated data within the time period required to settle the best tip within the network, after which API will return data without duplicates.

@MartinMinkov
Copy link
Collaborator Author

Yeah, it will fix the duplicate data at the best-tip issue. Currently, the archive node API will return all blocks that are proposed for the best-tip but this change will change the best-tip resolver to choose the "best" block to return for the GraphQL request. Duplicate data should not be happening for blocks below the max block height, however.

MartinMinkov added a commit to o1-labs/o1js that referenced this issue Feb 8, 2024
…ta from any block at the best tip

This change was made because the issue o1-labs/Archive-Node-API#7 has been resolved, making the temporary fix redundant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product-eng For tracking our team's issues
Projects
None yet
3 participants