-
Notifications
You must be signed in to change notification settings - Fork 700
chore: add test coverage for InterpeterError
bug in clarity-serialization
#6427
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
chore: add test coverage for InterpeterError
bug in clarity-serialization
#6427
Conversation
I had to remove the returned error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic!
5656fdd
Codecov Report❌ Patch coverage is
❌ Your project status has failed because the head coverage (49.73%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.
Additional details and impacted files@@ Coverage Diff @@
## develop #6427 +/- ##
============================================
- Coverage 71.24% 49.73% -21.51%
============================================
Files 556 556
Lines 351138 351299 +161
============================================
- Hits 250171 174726 -75445
- Misses 100967 176573 +75606
... and 437 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Description
This PR adds test coverage for consensus-critical error conversions in
clarity-serialization
, specifically to address and prevent the type of consensus-breaking bug introduced in the first implementation of consumingclarity-serialization
fromclarity
(#6310One of the main mistakes was incorrectly treating
InterpreterError::Expects
asCheckErrors::Expect
during the conversion from CodecError -> Error. This introduced consensus-breaking behavior.The goal of this PR is to systematically add tests that:
clarity
.InterpreterError
was threaded incorrectly).clarity-serialization
inclarity
#6310 proving that the bug is resolved and that our test suite enforces these consensus-critical invariants going forward.Currently, unit test coverage in clarity-serialization is minimal (~10%), did not attempt to add full test coverage for all functions moved into clarity-serialization. I limited scope to the moved functions whose returned
InterpeterError
s. I also marked the ones that are consensus-critical.I spent a bit of time in looking into which functions were actually affected by the change in Error types and identify all that are consensus-critical. Below is a subset.
Below is a list of functions moved to clarity-serialization that returns
Result
, but the errors are not consensus-critical. Some because they are not directly used in consensus-critical code, some because they are used, but their errors are directly mapped to other types without even checking their current value.test_constructors
)Applicable issues
Additional info (benefits, drawbacks, caveats)
Checklist
docs/rpc/openapi.yaml
andrpc-endpoints.md
for v2 endpoints,event-dispatcher.md
for new events)clarity-benchmarking
repobitcoin-tests.yml