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

DiskAddress is already a more efficient Option<> #341

Closed
wants to merge 3 commits into from

Conversation

rkuris
Copy link
Collaborator

@rkuris rkuris commented Nov 3, 2023

This removes Option from BranchNodes

This removes Option<DiskAddress> from BranchNodes
Dump was failing because it was attempting to read a zero address
Copy link
Contributor

@richardpringle richardpringle left a comment

Choose a reason for hiding this comment

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

Please no... I don't disagree with the change, but please not now lol

Copy link
Contributor

@xinifinity xinifinity left a comment

Choose a reason for hiding this comment

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

LGTM, although, talked to @richardpringle offline, it seems this conflicts with his major refactor/work on Merkle with #344. Not sure how easy or does it make sense to rebase on top?

@rkuris rkuris self-assigned this Nov 11, 2023
Copy link
Contributor

@richardpringle richardpringle left a comment

Choose a reason for hiding this comment

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

Upon further review, I don't think that we should do this. It doesn't make sense to have an uninitialized DiskAddress. The only valid place that I see this happening is related to Extension nodes and currently, calling serialize on a DiskAddress that has not been initialized will panic.

Instead, DiskAddress should simply wrap NonZeroUsize, and parent types can use Option<DiskAddress>.

@rkuris
Copy link
Collaborator Author

rkuris commented Nov 14, 2023

Lets change DiskAddress to not be an Option.

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

Successfully merging this pull request may close these issues.

3 participants