Add a random delay to broadcast scheduled transactions
Created by: Technifocal
Assuming I'm reading the code correctly, scheduled transactions are broadcast immediately after a new block is mined.
For example, imagine we had a transaction scheduled for block 3:
Block height | Time | Transaction broadcast/time |
---|---|---|
1 | +0 minutes | False |
2 | +10 minutes | False |
3 | +20 minutes | True, at +20 minutes |
4 | +30 minutes | False |
An attacker could assume that this transaction might have been scheduled. Compare this to:
Block height | Time | Transaction broadcast/time |
---|---|---|
1 | +0 minutes | False |
2 | +10 minutes | False |
3 | +20 minutes | True, at +25 minutes |
4 | +30 minutes | False |
Where an attacker could be sure the transaction was not scheduled as it came between two different blocks (and thus was not triggered by a block being mined).
Adding a random time after the target block (say, 0 seconds to 20 minutes) would prevent an attacker from determining that any transactions broadcast between two blocks were not broadcasted by Dojo's implementation of scheduled transactions.