joystream icon indicating copy to clipboard operation
joystream copied to clipboard

Colossus: verify bag<>bucket assignment before sending accept extrinsic

Open kdembler opened this issue 2 years ago • 1 comments

Problem

It seems at the moment, when finalizing upload, Colossus will only verify that the storageBucketId sent with the request is assigned to the worker that operates the node. However, it will not verify that the bagId provided with the request actually belongs to specified storageBucketId. That validation happens on chain though, so if I provide wrong input, Colossus will try to send accept extrinsic which will fail and since Colossus doesn't understand what happened it will provide only Extrinsic failed message in the response, which is enigmatic and doesn't help with debugging.

Proposal

We should do this pre-validation of correct bag<>bucket assignment before trying to send accept extrinsic and if the validation fails, provide meaningful error message to the user

┆Issue is synchronized with this Asana task by Unito

kdembler avatar Sep 13 '22 12:09 kdembler

Adding this to mainnet scope, great find!

bedeho avatar Sep 20 '22 04:09 bedeho

Done.

bedeho avatar Nov 17 '22 16:11 bedeho