mirror of
https://github.com/serai-dex/serai.git
synced 2025-01-22 10:44:53 +00:00
Document critical race condition due to two distinct clocks operating over the same data
This commit is contained in:
parent
e8e9e212df
commit
bf41009c5a
2 changed files with 5 additions and 3 deletions
|
@ -869,6 +869,10 @@ impl<D: Db, N: Network> MultisigManager<D, N> {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Both save_forwarded_output and take_forwarded_output have to happen on the
|
||||||
|
// same clock. Right now, one occurs on Substrate block ack, one occurs on scan.
|
||||||
|
// TODO: To resolve this, this function has to create the plans for
|
||||||
|
// forwarding/refunding outputs.
|
||||||
if let Some(instruction) =
|
if let Some(instruction) =
|
||||||
MultisigsDb::<N, D>::take_forwarded_output(txn, output.balance())
|
MultisigsDb::<N, D>::take_forwarded_output(txn, output.balance())
|
||||||
{
|
{
|
||||||
|
|
|
@ -677,9 +677,7 @@ impl<N: Network, D: Db> Scanner<N, D> {
|
||||||
// - This is an activation block
|
// - This is an activation block
|
||||||
// - This is a retirement block
|
// - This is a retirement block
|
||||||
// - There's outputs
|
// - There's outputs
|
||||||
// as only those are blocks are meaningful and warrant obtaining synchrony over
|
// as only those blocks are meaningful and warrant obtaining synchrony over
|
||||||
// TODO: Consider not obtaining synchrony over the retirement block depending on how the
|
|
||||||
// hand-off is implemented on the Substrate side of things
|
|
||||||
let is_retirement_block =
|
let is_retirement_block =
|
||||||
ScannerDb::<N, D>::retirement_block(&db, &scanner.keys[0].1) == Some(block_being_scanned);
|
ScannerDb::<N, D>::retirement_block(&db, &scanner.keys[0].1) == Some(block_being_scanned);
|
||||||
let sent_block = if has_activation || is_retirement_block || (!outputs.is_empty()) {
|
let sent_block = if has_activation || is_retirement_block || (!outputs.is_empty()) {
|
||||||
|
|
Loading…
Reference in a new issue