Storage V2 - query node schema and mappings - #2515
Conversation
…ibutionBucketFamilyMetadataSet)
cf02ca4 to
829d2a1
Compare
shamil-gadelshin
left a comment
There was a problem hiding this comment.
Looks good. All current storage node queries could be modified to the working state.
There are several issues found:
- unresolved TODOs in several files
- the
query-node/mappingsproject has failed checks (lints, formatting) - the
metadata-protobufproject fails linting - Shouldn't we use the
bagIdformat similar to the storage and distribution node (static:council) ?
| export async function storage_StorageOperatorMetadataSet({ event, store }: EventContext & StoreContext): Promise<void> { | ||
| const [bucketId, , metadataBytes] = new Storage.StorageOperatorMetadataSetEvent(event).params | ||
| const storageBucket = await getStorageBucketWithOperatorMetadata(store, bucketId.toString()) | ||
| storageBucket.operatorMetadata = await processStorageOperatorMetadata( |
There was a problem hiding this comment.
Why don't we throw an error here on invalid metadata similar to other invalid data?
There was a problem hiding this comment.
The errors are only thrown on some unexpected state which should never occur if the node is working correctly.
Invalid metadata is a different case, because the runtime does not check its validity, so it's still a normal condition that the metadata is invalid. We're just logging this and performing no action in this case.
Throwing an error here would basically shut down the query node processor.
The main reason for this is that on Comitting autogenerated files has a few disadvantages though, which can be observed for There are mutiple ways we can address this:
I would vote for option 3 as a final solution, as having chain metadata in the repo could be useful in many different ways and updating it seems quite trivial. I think that, especially during development, option number I'll try to address this issue in my next PR, since in this one the |
I couldn't reproduce this issue, I'm only getting some warnings: |
I meant the warnings. Sorry for the confusion. |
If we don't want to commit the generated code shouldn't we just add the whole |
Fixed (924da13)
Oh, I didn't realize linter will work on the project that does not build. I think this should work as a temporary solution before we decide on the metadata. |
The PR contains:
3.1.0-alpha.1)Currently only the ones that should be required for
storage-nodeanddistributor-nodeto work.GizaandSumermappings have been separated and only theGizamappings are currently beeing built.Further work on updating
Sumermappings is required and will be part of another PR.Currently two separate libraries exist:
@joystream/metadata-protobuf(Giza) and@joystream/content-metadata-protobuf(Sumer) - they will be merged together in a separate PR.@joystream/typesadjustments taken from Distributor node #2582 (fixedDynamicBagCreationPolicy, added some utility types, renamed some distribution module types)