Closed zaibon closed 5 years ago
I'm guessing the idea of this line is to strip the common '0x' prefix which is usually present in a hex string (though not here). The problem is however that lstrip removes all leading chars which are either '0' or 'x'. Since we don't have a '0x' prefix here when encoding coin input ids, but leading '0' and 'x' is still stripped, this causes ids with a leading 0 to have this char stripped. The result is that the id is trimmed to 63 bytes, which is no longer valid hex. Interestingly, if the second char would also be '0', there would be no evident problem because the hash would be 62 chars long, which is valid hex (although the chain would reject the resulting signature).
All in all, an average of slightly less then 1/16 ids are affected by this
Fixed in d1ddcfcc4c1c260e1fd94614e1454ab84baace00
In the grid broker, when we try to refund some token back to the user, I get this error: