Colossus: verify bag<>bucket assignment before sending accept extrinsic
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
Adding this to mainnet scope, great find!
Done.