dwave-examples / dwave-examples/quantum-blockchain
Parts of Repo Should Have More Specific Exception Types
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1
- Forks
- 1
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 2
Description
Several parts of the repo should be modified to use more specific exception types to make exception handling and debugging easier. Possible categories include:
- Exceptions encountered by miners attempting to mine or validate blocks. These are likely to be used primarily in src/agents/miner.py, src/agents/trial_manager.py and src/protocols/proof_of_work_protocol.py
- Exceptions related by issues connecting to D-Wave solvers. These are likely to be used primarily in src/protocols/hash_calculator.py and src/utilities/quantum_cubic_utils.py
- Exceptions caused by errors in Block data structure. These should mostly be used in src/structures/block.py, though perhaps some may also be appropriate in src/agents/miner.py
- Exceptions caused by the structures managing the blockchain reaching an invalid state. These should be used in src/structures/block_score_tree.py and src/structures/score_tree_branch.py
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the exception paths in src/agents/miner.py, src/agents/trial_manager.py, and src/protocols/proof_of_work_protocol.py, then review the solver, block, and score-tree files named in the issue. Identify the existing generic exceptions and how callers handle them. Done means the listed categories use more specific exception types consistently across the affected files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- blockchain
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100