-
Notifications
You must be signed in to change notification settings - Fork 619
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
fix: use log_assert_fail
when creating state witness with missing proof
#10673
Conversation
2b51d72
to
220f88b
Compare
@@ -102,7 +103,9 @@ impl Client { | |||
// With stateless validation chunk producer uses recording reads when validating transactions. | |||
// The storage proof must be available here. | |||
transactions_storage_proof.ok_or_else(|| { | |||
Error::Other("Missing storage proof for transactions validation".to_owned()) | |||
let message = "Missing storage proof for transactions validation"; | |||
log_assert_fail!("{message}"); |
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.
I'm wondering if we can make log_assert_fail!
and log_assert!
take arguments similar to tracing error? Can handle in independent PR.
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.
take arguments similar to tracing error
this is a bit tricky since assert
accepts narrower set or arguments, see Robin's comment: #10659 (comment)
Simonas suggested a proper solution, but it requires PhD in tracing
library, feel free to give it a try 😅
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.
Let me try to invest some time into it and see if it's relatively easily crackable.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10673 +/- ##
==========================================
- Coverage 72.31% 72.31% -0.01%
==========================================
Files 732 732
Lines 150356 150408 +52
Branches 150356 150408 +52
==========================================
+ Hits 108736 108773 +37
+ Misses 36699 36696 -3
- Partials 4921 4939 +18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Such situations indicate illegal state/programmatic error that will result in missing chunk. It is still better to avoid panic in such case, so we return
Err
instead. This PR addslog_assert_fail
which was introduced specifically for such cases.