-
Notifications
You must be signed in to change notification settings - Fork 666
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
Conversation
…-labs/avalanchego into merkledb-test-range-proof-invariants
@@ -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] |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
…lanchego into merkledb-maybe-proof-bounds
…lanchego into merkledb-maybe-proof-bounds
closing in favor of #1872 |
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
orend
having length 0 as meaning "no lower bound" or "no upper bound" on a range, we now useMaybe[[]byte]
whereNothing
means "no bound" andSome
means "bound exists."How this was tested
Updating existing UT.