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

Investigate making lightwalletd's data structures immutable #288

Open
LarryRuane opened this issue Jun 16, 2020 · 0 comments
Open

Investigate making lightwalletd's data structures immutable #288

LarryRuane opened this issue Jun 16, 2020 · 0 comments
Assignees

Comments

@LarryRuane
Copy link
Collaborator

Adopting this advice may make lightwalletd more solid, could possibly fix (currently-unknown) memory-use bugs and prevent future bugs, and could improve security (reduce memory-related attacks):

https://levelup.gitconnected.com/building-immutable-data-structures-in-go-56a1068c76b2

Probably should at least investigate. I have no idea how much work this would be.

I remember once we ran into a bug that this would have prevented, which was that the bytes of a block prevhash were reversed for display purposes (we always display block hashes big-endian, but they're stored little-endian), but instead of modifying a copy, we modified the actual stored hash, and that broke code that used that hash later. (The fix was to make a copy before reversing the bytes.)

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

No branches or pull requests

1 participant