-
Notifications
You must be signed in to change notification settings - Fork 2k
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
optimize launcher_id_to_p2_puzzle_hash() #17961
Conversation
e375fcb
to
012c839
Compare
Pull Request Test Coverage Report for Build 8937938907Details
💛 - Coveralls |
Seems reasonable. The nice thing about this sort of optimization is if it produces the correct value once, it almost certainly will work every time. A trick that I like to do for changes like this is to calculate the value both the old and new way and assert they are the same. Then run the test suite (or run it on a wallet with a lot of these addresses). If you do this, there's a pretty high confidence it works correctly. |
012c839
to
a3cb749
Compare
a3cb749
to
1ced693
Compare
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.
Seems reasonable.
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.
aok
Purpose:
the wallet spends a fair amount of time generating these puzzle hashes repeatedly.
launcher_id_to_p2_puzzle_hash()
Current Behavior:
launcher_id_to_p2_puzzle_hash()
generates the full puzzle, just to tree-hash it.New Behavior:
launcher_id_to_p2_puzzle_hash()
generates the puzzle hash directly.profile before:
profile after: