Open pause125 opened 10 months ago
Should we also store the source on-chain?
Should we also store the source on-chain?
I think this should be optional? Maybe some projects don't want to open source.
The designed fields of package meta:
/// Metadata for a package.
struct PackageMetadata has store, drop {
/// The upgrade policy.
upgrade_policy: UpgradePolicy,
/// The upgrade version.
version: u64,
/// The module bytes in this package.
modules: vector<vector<u8>>,
}
Any other ideas? Do we need consider adding new fields of this struct? @jolestar
Add struct field will break the compatibility.
Add PackageMetadata to the Package's dynamic field?
Keep all modules in PackageMetada is not a good idea. We can continue to keep the modules as package dynamic fields.
modules
here means the module source code. Maybe there's no need to define a new PackageMetadata
struct. We can add each meta as Package
's dynamic field. In this way, it will be easy to add more meta field in the future if needed.
The source code can use the module_name.move
as the key of the dynamic field.
There may have some meta infomations of Move packages to be stored on-chain.
For example, the upgrading policy. There are two basic policies: compatible, immutable. We need to store the configurations on-chain and check every time publish modules.