-
Notifications
You must be signed in to change notification settings - Fork 527
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix 2 race conditions with proposer and transaction pool (#2352)
These were causing the "Invalid user command! Error was: Nonce in account 1 different from nonce in transaction 0" errors in fake_hash:full-test. In proposer.ml we were getting the current best tip to propose off of it, then waiting for an IVar, then getting the transaction pool. If the best tip changed while we were waiting, we would see transactions that were valid against the new best tip and potentially not the one we basing our proposal on. I changed it to get the transaction pool at the same time as the best tip, before waiting. We were also waiting for the proposed transition to be accepted into the transition frontier before starting to propose again. The second race condition is when our proposed transition has been accepted and we start to propose again before the transaction pool is updated to remove now-invalid transactions. I fixed by changing it to update the diffs (and consequently the transaction pool) before calling Transition_registry.notify, which wakes up the waiting proposer. This way the transaction pool is guaranteed to be updated in time.
- Loading branch information
1 parent
3101a90
commit 6d63856
Showing
3 changed files
with
51 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters