Add extensive commentary on mutable to the processor's main file

Clearly establishes why consistency is guaranteed from a Rust borrow-checker
mindset. While there are plenty of... 'violations', they're clearly explained.

Hopefully, this method of thinking helps promote/ensure consistency in the
future.
This commit is contained in:
Luke Parker
2023-04-17 19:20:47 -04:00
parent 92a868e574
commit 059e79c98a
4 changed files with 293 additions and 178 deletions

View File

@@ -144,7 +144,8 @@ impl<C: Coin, D: Db> Signer<C, D> {
// Check the attempt lines up
match self.attempt.get(&id.id) {
// If we don't have an attempt logged, it's because the coordinator is faulty OR because we
// rebooted
// rebooted OR we detected the signed transaction on chain, so there's notable network
// latency/a malicious validator
None => {
warn!(
"not attempting {} #{}. this is an error if we didn't reboot",