Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:(api/fraud): fraud.Get returns potentially confusing error message #3407

Open
distractedm1nd opened this issue May 16, 2024 · 0 comments
Assignees
Labels
area:api Related to celestia-node API area:fraud

Comments

@distractedm1nd
Copy link
Collaborator

From a user:

in this endpoint https://node-rpc-docs.celestia.org/?version=v0.13.5#fraud.Get
What should be Proof Type? I tried to use type shown in the docs but that is throwing error.
datastore: key not found.

This makes sense to us, because we know there is no fraud available in the store so ofc it says key not found. But this is not very intuitive.

I suggest either:

  • returning an empty array when this error is encountered (haha)
  • returning an error that is user friendly, i.e. NoFraudAvailable = "no fraud proofs were found"

I am more for option one because in my mind, it is not semantically an error. For the same reasoning that I used with blob.GetAll. But I won't block if others prefer version two.

This also signifies we should write an example for how to interact with fraud proofs over the API. I have opened an issue to add an example, showing that Subscribe makes the most sense here unless you want to poll with Get.

@distractedm1nd distractedm1nd added area:fraud area:api Related to celestia-node API labels May 16, 2024
@distractedm1nd distractedm1nd self-assigned this May 16, 2024
@ramin ramin added v0.15.0 and removed v0.15.0 labels Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:api Related to celestia-node API area:fraud
Projects
None yet
Development

No branches or pull requests

2 participants