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 -- Use Maybe for proof bounds #1657

Closed
wants to merge 96 commits into from
Closed

Conversation

danlaine
Copy link

@danlaine danlaine commented Jun 26, 2023

Why this should be merged

Makes bounds easier to understand (I hope.) @StephenButtolph requested this in https://github.com/ava-labs/avalanchego/pull/1629/files#r1242345719.

How this works

Instead of interpreting start or end having length 0 as meaning "no lower bound" or "no upper bound" on a range, we now use Maybe[[]byte] where Nothing means "no bound" and Some means "bound exists."

How this was tested

Updating existing UT.

@danlaine danlaine self-assigned this Jun 26, 2023
joshua-kim pushed a commit to dshiell/avalanchego that referenced this pull request Jun 26, 2023
@patrick-ogrady patrick-ogrady added this to the v1.10.5 milestone Jul 18, 2023
@@ -49,14 +49,14 @@ const (
// [localRootID] is the ID of the root of this range in our database.
// If we have no local root for this range, [localRootID] is ids.Empty.
type workItem struct {
start []byte
end []byte
start merkledb.Maybe[[]byte]
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to define Maybe in a shared types package rather than just merkledb?

Copy link
Author

Choose a reason for hiding this comment

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

I can do that in a follow up PR -- this one is already kind of huge

@StephenButtolph StephenButtolph modified the milestones: v1.10.5, v1.10.6 Jul 19, 2023
@danlaine
Copy link
Author

closing in favor of #1872

@danlaine danlaine closed this Aug 17, 2023
@StephenButtolph StephenButtolph deleted the merkledb-maybe-proof-bounds branch July 24, 2024 20:47
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants