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

feat(sync): bifurcation for syncTarget #219

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

cristaloleg
Copy link
Contributor

@cristaloleg cristaloleg commented Sep 24, 2024

Fixes #217

@cristaloleg cristaloleg self-assigned this Sep 24, 2024
it applies 1000 as the subjective head.
If not, it downloads the halfway point and retries the process.
*/
func (s *Syncer[H]) verifySkipping(ctx context.Context, subjHeight uint64, networkHeader H) error {
Copy link
Member

Choose a reason for hiding this comment

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

From sync discussion:

In the 500(sbjHead) and 1000(netHead) example, the current algo fetches 750 and verifies 1000. However, the 750 is taken for granted without verification with 500.

Instead, the algo should fetch 750, verify it, and set it as new sbjHead to initiate the sync loop fetching 500-750, while bifurcation continues until 1000 is reached.

Copy link
Member

Choose a reason for hiding this comment

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

There is one more minor question to answer. What happens to new incoming heads if bifurcation takes more than a block time? Do we discard them or queue for verification once the bifurcation finishes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement bifurcation for syncTarget estimation / verification
2 participants