zeta-chain / protocol-contracts

Protocol contracts implementing the core logic of the protocol, deployed on ZetaChain and on connected chains
MIT License
70 stars 58 forks source link

feat: Canonical addresses JSON #129

Closed fadeev closed 8 months ago

fadeev commented 8 months ago

Right now address JSON generation is not deterministic. The two potential sources of non-determinism are:

This doesn't affect the users of the package, but it does affect the development process: every time we generate addresses they may end up in different order and it's hard to tell if the content has changed (a big deal) or only the order (not a big deal).

This PR adds simple sorting so that every time addresses are generated they are generated deterministically.

I considered using canonical JSON libs instead, but they (understandably) don't sort arrays, because in arrays order is important.

ronaldoguedess commented 8 months ago

LeonardoDicaprioClappingGIF