Skip to content

Commit

Permalink
Remove CoinJoinArchiver (WalletWasabi#12998) (WalletWasabi#13233)
Browse files Browse the repository at this point in the history
The coinjoin archiver is simple a logger and as such it should be
implemented using the logging infrastructure.
  • Loading branch information
lontivero authored Jul 9, 2024
1 parent 59b908c commit a6c1e14
Show file tree
Hide file tree
Showing 14 changed files with 0 additions and 123 deletions.
1 change: 0 additions & 1 deletion WalletWasabi.Tests/Helpers/ArenaBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using WalletWasabi.WabiSabi.Backend;
using WalletWasabi.WabiSabi.Backend.DoSPrevention;
using WalletWasabi.WabiSabi.Backend.Rounds;
using WalletWasabi.WabiSabi.Backend.Rounds.CoinJoinStorage;
using WalletWasabi.WabiSabi.Models.MultipartyTransaction;

namespace WalletWasabi.Tests.Helpers;
Expand Down
1 change: 0 additions & 1 deletion WalletWasabi.Tests/Helpers/WabiSabiFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
using WalletWasabi.WabiSabi.Backend.DoSPrevention;
using WalletWasabi.WabiSabi.Backend.Models;
using WalletWasabi.WabiSabi.Backend.Rounds;
using WalletWasabi.WabiSabi.Backend.Rounds.CoinJoinStorage;
using WalletWasabi.WabiSabi.Client;
using WalletWasabi.WabiSabi.Client.RoundStateAwaiters;
using WalletWasabi.WabiSabi.Models;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using WalletWasabi.WabiSabi.Backend.DoSPrevention;
using WalletWasabi.WabiSabi.Backend.Models;
using WalletWasabi.WabiSabi.Backend.Rounds;
using WalletWasabi.WabiSabi.Backend.Rounds.CoinJoinStorage;
using WalletWasabi.WabiSabi.Backend.Statistics;
using Xunit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using WalletWasabi.WabiSabi.Backend;
using WalletWasabi.WabiSabi.Backend.Models;
using WalletWasabi.WabiSabi.Backend.Rounds;
using WalletWasabi.WabiSabi.Backend.Rounds.CoinJoinStorage;
using WalletWasabi.WabiSabi.Models;
using Xunit;
using WalletWasabi.WabiSabi.Client.CoinJoin.Client;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using System.Threading;
using System.Threading.Tasks;
using Moq;
using NBitcoin;
using WalletWasabi.Helpers;
using WalletWasabi.Tests.Helpers;
using WalletWasabi.WabiSabi;
using WalletWasabi.WabiSabi.Backend.DoSPrevention;
using WalletWasabi.WabiSabi.Backend.Rounds.CoinJoinStorage;
using Xunit;

namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
using WalletWasabi.WabiSabi.Models.MultipartyTransaction;
using WalletWasabi.Wallets;
using Xunit;
using WalletWasabi.WabiSabi.Backend.Rounds.CoinJoinStorage;
using WalletWasabi.BitcoinCore.Mempool;
using WalletWasabi.WabiSabi.Client.CoinJoin.Client;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using WalletWasabi.WabiSabi;
using WalletWasabi.WabiSabi.Backend;
using WalletWasabi.WabiSabi.Backend.Rounds;
using WalletWasabi.WabiSabi.Backend.Rounds.CoinJoinStorage;
using WalletWasabi.WabiSabi.Backend.Statistics;
using WalletWasabi.WabiSabi.Client;
using WalletWasabi.WabiSabi.Client.CoinJoin.Client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
using WalletWasabi.WabiSabi.Backend;
using WalletWasabi.WabiSabi.Backend.DoSPrevention;
using WalletWasabi.WabiSabi.Backend.Rounds;
using WalletWasabi.WabiSabi.Backend.Rounds.CoinJoinStorage;
using WalletWasabi.WabiSabi.Backend.Statistics;
using WalletWasabi.WabiSabi.Client;
using WalletWasabi.WabiSabi.Models;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
using WalletWasabi.WabiSabi.Backend;
using WalletWasabi.WabiSabi.Backend.Models;
using WalletWasabi.WabiSabi.Backend.Rounds;
using WalletWasabi.WabiSabi.Backend.Rounds.CoinJoinStorage;
using WalletWasabi.WabiSabi.Backend.Statistics;
using WalletWasabi.WabiSabi.Client;
using WalletWasabi.WabiSabi.Client.CoinJoinProgressEvents;
Expand Down
1 change: 0 additions & 1 deletion WalletWasabi/WabiSabi/Backend/DoSPrevention/Prison.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Threading.Channels;
using WalletWasabi.Logging;
using WalletWasabi.WabiSabi.Backend.Rounds;
using WalletWasabi.WabiSabi.Backend.Rounds.CoinJoinStorage;

namespace WalletWasabi.WabiSabi.Backend.DoSPrevention;

Expand Down
10 changes: 0 additions & 10 deletions WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using WalletWasabi.Crypto.Randomness;
using WalletWasabi.WabiSabi.Backend.Models;
using WalletWasabi.WabiSabi.Models.MultipartyTransaction;
using WalletWasabi.WabiSabi.Backend.Rounds.CoinJoinStorage;
using WalletWasabi.WabiSabi.Backend.Statistics;
using System.Collections.Immutable;
using WalletWasabi.WabiSabi.Models;
Expand All @@ -30,13 +29,11 @@ public Arena(
IRPCClient rpc,
Prison prison,
RoundParameterFactory roundParameterFactory,
CoinJoinTransactionArchiver? archiver = null,
CoinJoinScriptStore? coinJoinScriptStore = null ) : base(period)
{
Config = config;
Rpc = rpc;
Prison = prison;
TransactionArchiver = archiver;
CoinJoinScriptStore = coinJoinScriptStore;
RoundParameterFactory = roundParameterFactory;
MaxSuggestedAmountProvider = new(Config);
Expand All @@ -51,7 +48,6 @@ public Arena(
private WabiSabiConfig Config { get; }
internal IRPCClient Rpc { get; }
private Prison Prison { get; }
private CoinJoinTransactionArchiver? TransactionArchiver { get; }
public CoinJoinScriptStore? CoinJoinScriptStore { get; }
private RoundParameterFactory RoundParameterFactory { get; }
public MaxSuggestedAmountProvider MaxSuggestedAmountProvider { get; }
Expand Down Expand Up @@ -311,12 +307,6 @@ private async Task StepTransactionSigningPhaseAsync(CancellationToken cancellati
round.LogInfo(
$"There are {indistinguishableOutputs.Count(x => x.count == 1)} occurrences of unique outputs.");

// Store transaction.
if (TransactionArchiver is not null)
{
await TransactionArchiver.StoreJsonAsync(coinjoin).ConfigureAwait(false);
}

// Broadcasting.
await Rpc.SendRawTransactionAsync(coinjoin, cancellationToken).ConfigureAwait(false);
EndRound(round, EndRoundState.TransactionBroadcasted);
Expand Down

This file was deleted.

4 changes: 0 additions & 4 deletions WalletWasabi/WabiSabi/WabiSabiCoordinator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using NBitcoin;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using WalletWasabi.BitcoinCore.Rpc;
Expand All @@ -13,7 +12,6 @@
using WalletWasabi.WabiSabi.Backend;
using WalletWasabi.WabiSabi.Backend.DoSPrevention;
using WalletWasabi.WabiSabi.Backend.Rounds;
using WalletWasabi.WabiSabi.Backend.Rounds.CoinJoinStorage;
using WalletWasabi.WabiSabi.Backend.Statistics;
using WalletWasabi.WabiSabi.Models.MultipartyTransaction;

Expand All @@ -27,7 +25,6 @@ public WabiSabiCoordinator(CoordinatorParameters parameters, IRPCClient rpc, Co
RpcClient = rpc;
Warden = new(parameters.PrisonFilePath, Config);
ConfigWatcher = new(parameters.ConfigChangeMonitoringPeriod, Config, () => Logger.LogInfo("WabiSabi configuration has changed."));
CoinJoinTransactionArchiver transactionArchiver = new(Path.Combine(parameters.CoordinatorDataDir, "CoinJoinTransactions"));

CoinJoinFeeRateStatStore = CoinJoinFeeRateStatStore.LoadFromFile(parameters.CoinJoinFeeRateStatStoreFilePath, Config, rpc);
IoHelpers.EnsureContainingDirectoryExists(Parameters.CoinJoinFeeRateStatStoreFilePath);
Expand All @@ -42,7 +39,6 @@ public WabiSabiCoordinator(CoordinatorParameters parameters, IRPCClient rpc, Co
rpc,
Warden.Prison,
roundParameterFactory,
transactionArchiver,
coinJoinScriptStore);

IoHelpers.EnsureContainingDirectoryExists(Parameters.CoinJoinIdStoreFilePath);
Expand Down

0 comments on commit a6c1e14

Please sign in to comment.