dwave-examples / dwave-examples/quantum-blockchain

Parts of Repo Should Have More Specific Exception Types

Open
#20 0 comments 0 reactions 0 assignees View on GitHub

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:

  1. 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
  2. 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
  3. 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
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.