Alternate handover batch TOCTOU fix (#397)

* Revert "Correct the prior documented TOCTOU"

This reverts commit d50fe87801.

* Correct the prior documented TOCTOU

d50fe87801 edited the challenge for the Batch to
fix it. This won't produce Batch n+1 until Batch n is successfully published
and verified. It's an alternative strategy able to be reviewed, with a much
smaller impact to scope.
This commit is contained in:
Luke Parker
2023-10-13 12:14:59 -04:00
committed by GitHub
parent 7d0d1dc382
commit f6e8bc3352
9 changed files with 144 additions and 78 deletions

View File

@@ -146,9 +146,8 @@ async fn test_substrate_signer() {
signers.get_mut(i).unwrap().events.pop_front().unwrap()
{
assert_eq!(signed_batch.batch, batch);
// SubstrateSigner will believe this is the first batch for this set, hence `true`
assert!(Public::from_raw(keys[&participant_one].group_key().to_bytes())
.verify(&batch_message(true, &batch), &signed_batch.signature));
.verify(&batch_message(&batch), &signed_batch.signature));
} else {
panic!("didn't get signed batch back");
}