provenance-io / provenance

A distributed, proof of stake blockchain designed for the financial services industry.
https://provenance.io
Apache License 2.0
87 stars 37 forks source link

Shorten Metadata module index keys. #542

Open dwedul-figure opened 2 years ago

dwedul-figure commented 2 years ago

Summary

The index keys for the Metadata module can all be shortened by one or two bytes.

Problem Definition

The indexes in the Metadata module all contain a full metadata address (or two). However, the type byte of the Metadata Addresses can be inferred by the type byte of the index. That means these index keys can be reduced by one or two bytes. This results in less storage needed.

Proposal

Basically, anywhere a full metadata address is part of an index key, change it so it's not including its type byte anymore. We'll also need new type bytes for each index.

Make the following changes to the Metadata index key formats:

This change will require a migration and will probably be associated with bug #541


For Admin Use

iramiller commented 1 year ago

this could be part of a larger refresh of the metadata module to align with the more nft/erc-721 style management of off-chain digital asset records...