celestia-node icon indicating copy to clipboard operation
celestia-node copied to clipboard

[Feature Request]: `blob_get_all` could return empty `Vec` on "blob not found"

Open bkolad opened this issue 1 year ago • 5 comments

Implementation ideas

The blob_get_all RPC method yields a Result<Vec<Blob>, Error>. When no blobs are published under a specified namespace and height, I am getting the forllowing error:

error is: ErrorObject { code: ServerError(1), message: "getting blobs for namespace(00000000000000000000000000000000000000736f762d746573742d70): blob: not found\nblob: not found", data: None }.

Missing blobs feels more like a standard scenario rather than an error. Currently there is no clean way to distinguish between a missing blob or some other HTTP error, as we can't pattern match on ErrorObject. I think it would be more appropriate to return an empty Vec in this case.

version: celestia-node:v0.12.0

bkolad avatar Feb 20 '24 05:02 bkolad

thanks for the issue @bkolad!

jcstein avatar Feb 20 '24 08:02 jcstein

cc @tuxcanfly

had similar concerns

renaynay avatar Feb 23 '24 14:02 renaynay

it is misleading

jcstein avatar Feb 26 '24 14:02 jcstein

cc @vgonkivs

ramin avatar Feb 28 '24 11:02 ramin

This makes sense for the GetAll. The other methods should still return the error

Wondertan avatar Feb 28 '24 14:02 Wondertan