8000 Export errors for easier programmatic use · Issue #1140 · cometbft/cometbft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Export errors for easier programmatic use #1140

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

Open
10 of 20 tasks
thanethomson opened this issue Jul 18, 2023 · 10 comments
Open
10 of 20 tasks

Export errors for easier programmatic use #1140

thanethomson opened this issue Jul 18, 2023 · 10 comments
Assignees
Labels
good first issue Good for newcomers P:consensus-engine-devs Priority: Better support consensus engine developers

Comments

@thanethomson
Copy link
Contributor
thanethomson commented Jul 18, 2023

Comet currently doesn't export many of its errors, which hinders programmatic use (i.e. by consensus engine developers). The only alternative for them is to detect specific errors by their string representations, which is prone to breakage even in patch releases of our software.

We should, package by package, ensure that all possible errors returned by publicly exported methods are defined programmatically (example) and publicly exported too.

Per package (check it off if its errors are already all publicly exported or this is not applicable):

Once the packages are implemented:

@thanethomson thanethomson added the P:consensus-engine-devs Priority: Better support consensus engine developers label Jul 18, 2023
@thanethomson thanethomson added the good first issue Good for newcomers label Jul 18, 2023
@pysel
Copy link
Contributor
pysel commented Jul 31, 2023

hey @thanethomson , is it free to pick up?

@thanethomson
Copy link
Contributor Author

hey @thanethomson , is it free to pick up?

It is! Are there particular packages you'd like to tackle, or would you like to handle the whole lot? If you'd like to tackle the issue in its entirety, I'd still recommend submitting separate PRs for each package to make review quicker.

@pysel
Copy link
Contributor
pysel commented Jul 31, 2023

sounds awesome! not sure if I will be able to tackle the whole thing, but I will go in the sequential order packages are listed in the issue. I will "reserve" abci, blocksync and config for now, just in case anyone else wants to take over some packages of the list, to avoid working on the same thing

@thanethomson
Copy link
Contributor Author

Thanks @pysel! I'll assign you to this issue for now, given the above. If anyone else wants to take on other packages, please let us know on this thread.

@0xforever9
Copy link
Contributor
0xforever9 commented Oct 5, 2023

hey @thanethomson, is it free to pick up 'mempool' package?

@allnil
Copy link
allnil commented Oct 5, 2023

hey @thanethomson!
Could you suggest a package to take to work?
Thank you!

@thanethomson
Copy link
Contributor Author

Hey @allnil and @4ever9! Feel free to pick up any of the packages from the list in the issue description that don't have PRs associated with them (currently most of them).

@akaladarshi
Copy link
Contributor

Hey @thanethomson is p2p package is free to to pickup?.

@Halimao
Copy link
Contributor
Halimao commented Dec 28, 2023

I'm working onlight, node, privval package, just to avoid someone gonna working on the same thing😀

@Halimao
Copy link
Contributor
Halimao commented Jan 4, 2024

@thanethomson @melekes Hi sir,

It would be better if there was a simple guide for exporting the errors so that successors who are going to pick up other packages could start their coding easily.

Such as telling developers if they could adjust the error message, or how to export the errors in some common cases, etc.

Also, we should add a simple code rule to CONTRIBUTING.md to ensure that all possible errors returned by publicly exported methods are defined programmatically and publicly exported too.

github-merge-queue bot pushed a commit that referenced this issue Mar 14, 2024
This PR Contributes to: #1140

Changes:

- Exports errors for rpc package

---------

Co-authored-by: Andy Nogueira <me@andynogueira.dev>
Co-authored-by: Adi Seredinschi <adizere@gmail.com>
@andynog andynog added this to CometBFT Mar 14, 2024
@github-project-automation github-project-automation bot moved this to Todo in CometBFT Mar 14, 2024
@andynog andynog moved this from Todo to In Progress in CometBFT Mar 14, 2024
github-merge-queue bot pushed a commit that referenced this issue Mar 15, 2024
Partially addresses: #1140

Exports errors for `light` package.

---------

Co-authored-by: Adi Seredinschi <adizere@gmail.com>
Co-authored-by: Daniel <daniel.cason@informal.systems>
Co-authored-by: Andy Nogueira <me@andynogueira.dev>
github-merge-queue bot pushed a commit that referenced this issue Mar 18, 2024
This PR Contributes to: #1140

Changes: 
 - Exports errors for `p2p` package

---------

Co-authored-by: Andy Nogueira <me@andynogueira.dev>
github-merge-queue bot pushed a commit that referenced this issue Jun 11, 2024
<!--
Please add a reference to the issue that this PR addresses and indicate
which
files are most critical to review. If it fully addresses a particular
issue,
please include "Closes #XXX" (where "XXX" is the issue number).

If this PR is non-trivial/large/complex, please ensure that you have
either
created an issue that the team's had a chance to respond to, or had some
discussion with the team prior to submitting substantial pull requests.
The team
can be reached via GitHub Discussions or the Cosmos Network Discord
server in
the #cometbft channel. GitHub Discussions is preferred over Discord as
it
allows us to keep track of conversations topically.
https://github.com/cometbft/cometbft/discussions

If the work in this PR is not aligned with the team's current
priorities, please
be advised that it may take some time before it is merged - especially
if it has
not yet been discussed with the team.

See the project board for the team's current priorities:
https://github.com/orgs/cometbft/projects/1

-->
Partially addresses #1140 

---

#### PR checklist

- [x] Tests written/updated
- [x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments
- [x] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec

---------

Co-authored-by: Andy Nogueira <me@andynogueira.dev>
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
github-merge-queue bot pushed a commit that referenced this issue Mar 21, 2025
Partially addresses #1140

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers P:consensus-engine-devs Priority: Better support consensus engine developers
Projects
No open projects
Status: In Progress
Status: In Progress
Development

No branches or pull requests

6 participants
0