-
Notifications
You must be signed in to change notification settings - Fork 410
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
Relaxed address strength restrictions for legacy 20 byte addresses #772
Conversation
Codecov Report
@@ Coverage Diff @@
## master #772 +/- ##
==========================================
+ Coverage 58.47% 58.62% +0.15%
==========================================
Files 49 49
Lines 5828 5830 +2
==========================================
+ Hits 3408 3418 +10
+ Misses 2170 2163 -7
+ Partials 250 249 -1
|
Thanks @iramiller - keen to get this tested at our end :) |
Many thanks @iramiller |
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.
This looks good to me. Surprised if there are not other places that need to be adjusted.
I guess it is theoretically possible that a 32 byte address overlaps with a 20 bytes address (the first 20 bytes match the other one exactly) and this will cause some issues for prefix scans on the shorter one.
However, these are hashes and the chance of such a collision is something like 2^160 and currently technically impossible (harder than rewriting bitcoin's history)
We have been running with this change on our testnet... it was all that we required based on our testing... we have contracts with both length addresses now. |
LGTM. |
Some more comments/tests coverage makes sense. When I opened this PR I only wanted the two initial commits that we are actually running on Provenance @channa-figure and I discussed the unit test angle this morning and it should be straight forward to add some extra comments and a test that asserts the 20 byte form is accepted here as well as the 32 byte version in |
I added a new test and a test case to the keys_test.go file. I also left a comment with in the test for a little clarification. |
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.
Very nice. Thanks for the contribution and the additional test. 🥇
This PR upstreams the changes required for addressing #758 on the Provenance Blockchain.
By removing the assumption that a valid address would always be 32 bytes long per the current standard, the previous shorter 20 byte addresses can be used for accessing existing instances. All new instances will conform to the new 32 byte form.
(PR opened by request of @the-frey, also CC @channa-figure )