elys-network / elys

Elys Network is the first All-In-One DEFI platform to join the Atom Economic Zone, backed by Informal Systems and the Cosmos Hub. Built on Cosmos and CometBFT, leveraging the latest blockchain technologies to provide a premier user experience. Visit our official site at https://elys.network
https://elys.network
Apache License 2.0
57 stars 51 forks source link

Optimizing masterchef keys #714

Closed avkr003 closed 1 month ago

avkr003 commented 1 month ago

In the case of user rewards, for secp256k1 type addresses, the earlier key took 43 bytes for hrp = "elys" as it converted the bech32 address string to a byte array. Now it directly utilises sdk.AccAddress type is a byte array of length 20 bytes for secp2556k1 addresses. + 1 byte for length

For secp256r1, it will take 32 bytes + 1 byte for length. (the bec32 address string for this type will be higher than 43 characters)