OriginProtocol / origin-js

We've moved to a monorepo: https://github.com/OriginProtocol/origin
MIT License
81 stars 33 forks source link

Fix overflow bug when adding more than 4 attestations #598

Closed tyleryasaka closed 6 years ago

tyleryasaka commented 6 years ago

Checklist:

Description:

The 5th atttestation will be at i=4 (0-indexed). 3 65 = 195 (no problem). 4 65 = 260... This is a problem because i is a uint8; 260 > 256, therefore overflow. :grimacing:

Thanks @crazybuster for figuring this out.

We do not need to rerun migrations, but we do need to update origin-js with this fix, so that new identities that users create do not have this bug.

Resolves #413

franckc commented 6 years ago

Based on discussion, we'll write a migration script and add that to this PR before merging.