-
Notifications
You must be signed in to change notification settings - Fork 220
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
feat: improve txo validation logic #4689
feat: improve txo validation logic #4689
Conversation
7fb78e7
to
e41d7b5
Compare
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.
It is not entirely clear how this solves the problem. I would also suggest using a semaphore instead, so that we could have X threads doing validation instead of just one.
There are a lot of warnings spread across the changes making it unclear where the actual fix is.
tokio::spawn(async move { | ||
// Note: We do not want the validation task to be queued | ||
let mut _lock = match validation_in_progress.try_lock() { |
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 is very difficult to understand the logic here, can it not be simplified?
Reviewing again, perhaps a semaphore is not correct here. Mutex is fine, but please try simplify the code |
- Fixed atomic mined height update error and implemented a recovery safety net for transaction output validation. - Stopped the TXO validation task from being executed in parallel as this will result in db operation on exactly the same data. - Added error int to allow ffi to distinguish between internal and communication errors (#12). Co-Authored-By: SW van Heerden [email protected]
* add specific already busy status, more comments
9da45e7
to
5111112
Compare
Description
Fixed atomic mined height update error and implemented a recovery safety net for transaction output validation.
Motivation and Context
Transaction validation was failing in an endless loop under certain conditions. (See #4680, #4669, #4670)
Fixes #4669
Fixes #4670
How Has This Been Tested?
Passed unit tests.
Passed cucumber tests.
System level testing.
Co-Authored-By: SW van Heerden [email protected]