Skip to content

Conversation

@pfi79
Copy link
Contributor

@pfi79 pfi79 commented Oct 8, 2024

No description provided.

@pfi79 pfi79 requested a review from a team as a code owner October 8, 2024 19:35
Comment on lines +117 to +123
if value == nil {
value = []byte{}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this change needed? Doesn't it change the behavior in a way that may impact callers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without this change, everything stops working.

Previously the goleveldb library returned []byte{}
now it returns []byte(nil)

And in the fabric returning nil it is considered that no key is found in the database
Instead of finding and fixing all the places where this behavior is used, I simulated our old behavior.

I should probably add a comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

syndtr/goleveldb@75fe519

here's the commit that made this change

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @pfi79 , the original author @manish-sethi will review this one.

Copy link
Contributor

@manish-sethi manish-sethi Oct 9, 2024

Choose a reason for hiding this comment

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

LGTM, given the change in leveldb behavior.

@denyeart denyeart merged commit eb3a5eb into hyperledger:main Oct 9, 2024
15 checks passed
@pfi79 pfi79 deleted the bump-goleveldb branch October 9, 2024 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants