Closed bedeho closed 3 years ago
This should also be considered for being added, either right away, or in later iteration, if it passes review. https://github.com/Joystream/joystream/issues/178
Same for this https://github.com/Joystream/joystream/issues/179
Already implemented in babylon
Content Directory 2.0
Background
Our current content directory model consists of three modules
Versioned Linked Object Store (VLOS): Models the data store that holds the data model for our content directory.
VLOS Permissions: Models and guards write access to the VLOS.
Working Group: Governance layer which organises the actors that interact with the permissions module and VLOS
The two first modules are a result of wanting to have a metadata layer which hash high integrity guarantee in a multi-writer scenario, and also deal well with changing schemas in-flight, without having to do runtime upgrades. The basic architecture appears to be the best compromise of our goals at present, however there are implementation issues with all three that require attention.
Proposal
VLOS
Drop all events.
Enforce unique class names. <= Why? perhaps we should even drop them?
Enforce unique property names within each class. <= Why? perhaps we should even drop them?
Rename
PropertyType::Internal
toPropertyType::Reference
, and same forPropertyValue::Internal
, as we are dropping the notion of external references.Remove
PropertyType::None
, was added to have some value for requiredDefault
trait, but has no semantic content. Instead just return some other value needed, we should not sacrifice our type safety due to a bad Substrate design decision.Remove
Class::id
andEntity::id
, as per convention https://github.com/Joystream/joystream/issues/36#issuecomment-527891032.Raw index types
u16
are used for index types, replace with aliases for each use case, e.g.ClassId
,EntityId
,PropertyId
etc. for clarity. Also make publicAdd boolean field in
ClassSchema
which indicates whether a schema is active or not. It is only possible to add schema support to an entity for an active schema. Introduce method for updating this status also.ClassSchema
->Schema
Change
values
field ofEntity
toBTreeMap<u16, PropertyValue>
where key is index of property in class, and killClassPropertyValue
.Change
in_class_schema_indexes
inEntity
toBTreeSet
, and give better name to field, likesupported_schemas
.https://github.com/Joystream/substrate-versioned-store-module/issues/13
https://github.com/Joystream/substrate-versioned-store-module/issues/22
Drop from storage these from storage, they need not be tuneable at runtime, just make them configurable through runtime trait. Also remove InputValidationLengthConstraint, as it is no longer needed.
Module
, so that other modules depending on VLOS can consume this trait on runtime, which also allows for mocking.Housekeeping
VLOS Permissions
Impl sketch
Housekeeping
Working Group
Most importantly, it needs to be refactored to follow this approach
https://github.com/Joystream/joystream/issues/163
but this depends on someone building the Bureaucracy module first.
Version tool
TBD.