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

merkledb / sync -- Disambiguate no end root from no start root #2437

Merged
merged 3 commits into from
Dec 7, 2023

Conversation

danlaine
Copy link

@danlaine danlaine commented Dec 6, 2023

Why this should be merged

When a sync client asks a sync server for a change proof, and the server doesn't have sufficient history to generate and return a change proof, it falls back to trying to generate and return a range proof. However, we might find out while trying to generate the change proof that we lack sufficient history to return even a range proof. If this is the case, we shouldn't fall back to generating a range proof.

How this works

Add an additional ErrNoEndRoot type, which indicates that we lack sufficient history to generate even a range proof. If GetChangeProof returns ErrNoEndRoot, we immediately return drop the request instead of trying to generate a range proof.

How this was tested

Update existing UT.

@danlaine danlaine self-assigned this Dec 6, 2023
@danlaine danlaine added this to the v1.10.18 milestone Dec 6, 2023
@danlaine danlaine marked this pull request as ready for review December 7, 2023 15:26
@danlaine danlaine requested a review from darioush as a code owner December 7, 2023 15:26
@danlaine danlaine merged commit a754118 into dev Dec 7, 2023
16 checks passed
@danlaine danlaine deleted the merkledb-handle-no-end-root branch December 7, 2023 18:52
@danlaine danlaine mentioned this pull request Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants