Add `Failed` round phase instead of pruning
Since successful transactions are currently leaked this does not
introduce a new  problem but does make an existing one slightly worse,
so this is a temporary measure.
MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PhaseStepping/StepTransactionSigningTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/PhaseStepping/StepTransactionSigningTests.cs
@@ -81,7 +81,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PhaseStepping
await aliceClient1.SignTransactionAsync(signedCoinJoin, CancellationToken.None);
await aliceClient2.SignTransactionAsync(signedCoinJoin, CancellationToken.None);
await arena.TriggerAndWaitRoundAsync(TimeSpan.FromSeconds(21));
- Assert.DoesNotContain(round, arena.Rounds);
+ Assert.Equal(Phase.Failed, round.Phase);
Assert.Empty(arena.Prison.GetInmates());
await arena.StopAsync(CancellationToken.None);
@@ -119,7 +119,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PhaseStepping
await aliceClient1.SignTransactionAsync(signedCoinJoin, CancellationToken.None);
await aliceClient2.SignTransactionAsync(signedCoinJoin, CancellationToken.None);
await arena.TriggerAndWaitRoundAsync(TimeSpan.FromSeconds(21));
- Assert.DoesNotContain(round, arena.Rounds);
+ Assert.Equal(Phase.Failed, round.Phase);
// There should be no inmate, because we aren't punishing spenders with banning
// as there's no reason to ban already spent UTXOs,
@@ -160,7 +160,7 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PhaseStepping
var signedCoinJoin = round.Assert<SigningState>().CreateTransaction();
await aliceClient1.SignTransactionAsync(signedCoinJoin, CancellationToken.None);
await arena.TriggerAndWaitRoundAsync(TimeSpan.FromSeconds(21));
- Assert.DoesNotContain(round, arena.Rounds);
+ Assert.Equal(Phase.Failed, round.Phase);
Assert.Empty(arena.Rounds.Where(x => x.IsBlameRound));
Assert.Contains(aliceClient2.Coin.Outpoint, arena.Prison.GetInmates().Select(x => x.Utxo));
@@ -202,7 +202,6 @@ namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.PhaseStepping
await aliceClient1.SignTransactionAsync(signedCoinJoin, CancellationToken.None);
await aliceClient2.SignTransactionAsync(signedCoinJoin, CancellationToken.None);
await arena.TriggerAndWaitRoundAsync(TimeSpan.FromSeconds(21));
- Assert.DoesNotContain(round, arena.Rounds);
Assert.Single(arena.Rounds.Where(x => x.IsBlameRound));
var badOutpoint = alice3.Coin.Outpoint;
Assert.Contains(badOutpoint, arena.Prison.GetInmates().Select(x => x.Utxo));

MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
@@ -172,7 +172,7 @@ namespace WalletWasabi.WabiSabi.Backend.Rounds
// Broadcasting.
await Rpc.SendRawTransactionAsync(coinjoin).ConfigureAwait(false);
- round.SetPhase(Phase.TransactionBroadcasting);
+ round.SetPhase(Phase.TransactionBroadcasting); // TODO remove from Rounds after timeout?
round.LogInfo($"Successfully broadcast the CoinJoin: {coinjoin.GetHash()}.");
}
@@ -207,7 +207,7 @@ namespace WalletWasabi.WabiSabi.Backend.Rounds
}
round.Alices.RemoveAll(x => alicesWhoDidntSign.Contains(x));
- Rounds.Remove(round);
+ round.SetPhase(Phase.Failed); // TODO remove from Rounds after timeout?
if (round.InputCount >= Config.MinInputCountByRound)
{

MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/Phase.cs
WalletWasabi/WabiSabi/Backend/Rounds/Phase.cs
@@ -12,6 +12,7 @@ namespace WalletWasabi.WabiSabi.Backend.Rounds
ConnectionConfirmation,
OutputRegistration,
TransactionSigning,
- TransactionBroadcasting
+ TransactionBroadcasting,
+ Failed
}
}

Add `Failed` round phase instead of pruning

Since successful transactions are currently leaked this does not
introduce a new  problem but does make an existing one slightly worse,
so this is a temporary measure.