Commit 8193aeb
Fix possible regression issue caused by
Possible scenario:
* Schedule timeout for `ProposeWaitEmptyBlockTimer` on height: n
* On timeout, timer loop queues a call to `Tendermint::on_timeout` on the
timer worker
* Blocks are imported at the same time with the timeout.
* Block importer holds lock for Tendermint, calls `new_blocks`
* The worker checks whether it is cancelled, but it is not cancelled yet.
* The worker waits for the lock.
* several `move_to_height`, `move_to_step` are called by new_blocks
* height is not n anymore.
* `move_to_step` clears timer, but the check is already passed and the
worker waits for the lock.
* It finally releases the lock.
* The waiting worker calls Tendermint::on_timeout and the timeout for
`ProposeWaitEmptyBlockTimer` calls `move_to_step(Prevote)`
* The timeout was set for the height n, but the code in the timeout
reads changed height.ProposeWaitEmptyBlockTimer
1 parent f8e236d commit 8193aeb
1 file changed
+9
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1232 | 1232 | | |
1233 | 1233 | | |
1234 | 1234 | | |
1235 | | - | |
1236 | | - | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
1237 | 1244 | | |
1238 | 1245 | | |
1239 | 1246 | | |
| |||
0 commit comments