Skip to content

Demoting locks

David Vorick requested to merge demoting-locks into master

This PR changed shapes a few times.

I wrote a new 'demotelock' package, and switched both the consensus set and the transaction pool over to that. It doesn't have deadlock safety, but I don't think that deadlock safety is necessary anymore for those packages. I feel a lot more comfortable debugging a call stack, and the number of threads in our call stack is not as imposing as it used to be. (less than a hundred as opposed to more than a thousand). That combined with much stricter locking conventions means a lot less headache.

Eventually we can probably get rid of the 'sync' package altogether.

I did end up adding testing for the sync package, but that was before I decided that we didn't need it anymore. Since the tests are already written... might as well keep them, especially since we have several packages still using the safelocks.

This PR also comments out the sanity check that causes bolt so much trouble.

This PR should be all that's needed (besides the version PR) to settle 0.4.3. Unlocking the wallet during IBD takes time, but doesn't freeze or crash the program, or trigger race conditions. Closing Sia unexpectedly will not corrupt the database.

Merge request reports