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

blockchain, utreexobackends: move nodesmapslice and cachedleavesmapslice to utreexobackends #168

Conversation

kcalvinalvin
Copy link
Contributor

Moving these two to a separate package allows us to better control access to private fields. There was a runtime panic due to an unexported field being accessed, leading to a concurrent map read and write. Moving it into a separate package avoids this issue completely.

Moving nodesMapSlice to a separate package ensures that private fields
don't get accessed and the code is safer for concurrency due to this.
This addresses a bug that was noticed that resulted in a runtime panic
due to concurrent access of a map in nodesMapSlice.
Moving cached leaves map to a separate package ensures that private
fields do not get accessed. This achieves better concurrency guarantees
as the exported functions of cached leaves map are concurrency safe but
if the fields get accessed directly, it bypasses the safety measures.
@kcalvinalvin kcalvinalvin merged commit 3eaada9 into utreexo:main Apr 22, 2024
8 checks passed
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.

None yet

1 participant