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

[Feature]: Return a proper errors instead of a debug_asserts #1164

Open
1 task
djordon opened this issue Dec 18, 2024 · 0 comments · May be fixed by #1165
Open
1 task

[Feature]: Return a proper errors instead of a debug_asserts #1164

djordon opened this issue Dec 18, 2024 · 0 comments · May be fixed by #1165
Assignees
Labels
sbtc signer binary The sBTC Bootstrap Signer.

Comments

@djordon
Copy link
Contributor

djordon commented Dec 18, 2024

Feature - Return a proper errors instead of a debug_asserts

1. Description

We have some debug_asserts in the codebase that turn out to be conditions that can be tripped in production. We should turn some of these into proper Errors. The one that we should definitely handle is the one here:

let multi_sig = MultisigTx::new_tx(&request.contract_tx, &wallet, request.tx_fee);
let txid = multi_sig.tx().txid();
debug_assert_eq!(txid, request.txid);

1.1 Context & Purpose

We think that one of the debug_asserts is a proper error so it should be treated as such. For the others, we should at least have a look to see if they should be removed or upgraded and act on them accordingly.

2. Technical Details:

Generally speaking, we create new error variants for the debug_assert condition that we want to convert (if an error variant does not exist for the condition already) and return them when the proper condition is triggered.

2.1 Acceptance Criteria:

  • The debug assertion highlighted above is replaced with a proper error.

3. Related Issues and Pull Requests (optional):

@djordon djordon added the sbtc signer binary The sBTC Bootstrap Signer. label Dec 18, 2024
@djordon djordon added this to the sBTC: Release polish milestone Dec 18, 2024
@djordon djordon added this to sBTC Dec 18, 2024
@github-project-automation github-project-automation bot moved this to Needs Triage in sBTC Dec 18, 2024
@djordon djordon moved this from Needs Triage to Todo in sBTC Dec 18, 2024
@MCJOHN974 MCJOHN974 linked a pull request Dec 18, 2024 that will close this issue
4 tasks
@djordon djordon moved this from Todo to In Review in sBTC Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sbtc signer binary The sBTC Bootstrap Signer.
Projects
Status: In Review
Development

Successfully merging a pull request may close this issue.

3 participants