Add MaxSuggestedAmount
MODIFY
WalletWasabi.Tests/Helpers/WabiSabiFactory.cs
WalletWasabi.Tests/Helpers/WabiSabiFactory.cs
@@ -260,7 +260,7 @@ public static class WabiSabiFactory
}
public static BlameRound CreateBlameRound(Round round, WabiSabiConfig cfg)
- => new(new(cfg, round.Network, new InsecureRandom(), round.FeeRate, round.CoordinationFeeRate, round.SuggestedMaxAmount), round, round.Alices.Select(x => x.Coin.Outpoint).ToHashSet());
+ => new(new(cfg, round.Network, new InsecureRandom(), round.FeeRate, round.CoordinationFeeRate, round.MaxSuggestedAmount), round, round.Alices.Select(x => x.Coin.Outpoint).ToHashSet());
public static (IKeyChain, SmartCoin, SmartCoin) CreateCoinKeyPairs()
{

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/Rounds/MultipartyTransactionStateTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/Rounds/MultipartyTransactionStateTests.cs
@@ -90,7 +90,7 @@ public class MultipartyTransactionStateTests
_ => baseAmount,
};
- Assert.Equal(expected, Arena.GetSuggestedMaxAmount(i));
+ Assert.Equal(expected, Arena.GetMaxSuggestedAmount(i));
}
}
}

MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
@@ -332,7 +332,7 @@ public partial class Arena : PeriodicRunner
private async Task CreateBlameRoundAsync(Round round, CancellationToken cancellationToken)
{
var feeRate = (await Rpc.EstimateSmartFeeAsync((int)Config.ConfirmationTarget, EstimateSmartFeeMode.Conservative, simulateIfRegTest: true, cancellationToken).ConfigureAwait(false)).FeeRate;
- RoundParameters parameters = new(Config, Network, Random, feeRate, round.CoordinationFeeRate, round.SuggestedMaxAmount);
+ RoundParameters parameters = new(Config, Network, Random, feeRate, round.CoordinationFeeRate, round.MaxSuggestedAmount);
var blameWhitelist = round.Alices
.Select(x => x.Coin.Outpoint)
.Where(x => !Prison.IsBanned(x))
@@ -348,13 +348,13 @@ public partial class Arena : PeriodicRunner
{
var feeRate = (await Rpc.EstimateSmartFeeAsync((int)Config.ConfirmationTarget, EstimateSmartFeeMode.Conservative, simulateIfRegTest: true, cancellationToken).ConfigureAwait(false)).FeeRate;
- RoundParameters roundParams = new(Config, Network, Random, feeRate, Config.CoordinationFeeRate, GetSuggestedMaxAmount(ConnectionConfirmationStartedCounter));
+ RoundParameters roundParams = new(Config, Network, Random, feeRate, Config.CoordinationFeeRate, GetMaxSuggestedAmount(ConnectionConfirmationStartedCounter));
Round r = new(roundParams);
Rounds.Add(r);
}
}
- internal static Money GetSuggestedMaxAmount(int roundCounter)
+ internal static Money GetMaxSuggestedAmount(int roundCounter)
{
Money baseAmount = Money.Coins(0.1m);

MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/Round.cs
WalletWasabi/WabiSabi/Backend/Rounds/Round.cs
@@ -33,7 +33,7 @@ public class Round
ConnectionConfirmationTimeFrame = TimeFrame.Create(RoundParameters.ConnectionConfirmationTimeout);
OutputRegistrationTimeFrame = TimeFrame.Create(RoundParameters.OutputRegistrationTimeout);
TransactionSigningTimeFrame = TimeFrame.Create(RoundParameters.TransactionSigningTimeout);
- SuggestedMaxAmount = roundParameters.SuggestedMaxAmount;
+ MaxSuggestedAmount = roundParameters.MaxSuggestedAmount;
}
public uint256 Id => _id ??= CalculateHash();
@@ -65,7 +65,7 @@ public class Round
protected RoundParameters RoundParameters { get; }
public Script CoordinatorScript { get; set; }
- public Money SuggestedMaxAmount { get; }
+ public Money MaxSuggestedAmount { get; }
public TState Assert<TState>() where TState : MultipartyTransactionState =>
CoinjoinState switch
@@ -145,6 +145,7 @@ public class Round
MaxAmountCredentialValue,
MaxVsizeCredentialValue,
MaxVsizeAllocationPerAlice,
+ MaxSuggestedAmount,
AmountCredentialIssuerParameters,
VsizeCredentialIssuerParameters);
}

MODIFY
WalletWasabi/WabiSabi/Backend/Rounds/RoundParameters.cs
WalletWasabi/WabiSabi/Backend/Rounds/RoundParameters.cs
@@ -12,7 +12,7 @@ public class RoundParameters
WasabiRandom random,
FeeRate feeRate,
CoordinationFeeRate coordinationFeeRate,
- Money suggestedMaxAmount)
+ Money maxSuggestedAmount)
{
Network = network;
Random = random;
@@ -30,7 +30,7 @@ public class RoundParameters
OutputRegistrationTimeout = wabiSabiConfig.OutputRegistrationTimeout;
TransactionSigningTimeout = wabiSabiConfig.TransactionSigningTimeout;
BlameInputRegistrationTimeout = wabiSabiConfig.BlameInputRegistrationTimeout;
- SuggestedMaxAmount = suggestedMaxAmount;
+ MaxSuggestedAmount = maxSuggestedAmount;
}
public WasabiRandom Random { get; }
@@ -46,5 +46,5 @@ public class RoundParameters
public TimeSpan OutputRegistrationTimeout { get; }
public TimeSpan TransactionSigningTimeout { get; }
public TimeSpan BlameInputRegistrationTimeout { get; }
- public Money SuggestedMaxAmount { get; }
+ public Money MaxSuggestedAmount { get; }
}

MODIFY
WalletWasabi/WabiSabi/Crypto/RoundHasher.cs
WalletWasabi/WabiSabi/Crypto/RoundHasher.cs
@@ -26,6 +26,7 @@ public static class RoundHasher
long maxAmountCredentialValue,
long maxVsizeCredentialValue,
long maxVsizeAllocationPerAlice,
+ long maxSuggestedAmount,
CredentialIssuerParameters amountCredentialIssuerParameters,
CredentialIssuerParameters vsizeCredentialIssuerParameters)
=> StrobeHasher.Create(ProtocolConstants.RoundStrobeDomain)
@@ -46,6 +47,7 @@ public static class RoundHasher
.Append(ProtocolConstants.RoundMaxAmountCredentialValueStrobeLabel, maxAmountCredentialValue)
.Append(ProtocolConstants.RoundMaxVsizeCredentialValueStrobeLabel, maxVsizeCredentialValue)
.Append(ProtocolConstants.RoundMaxVsizePerAliceStrobeLabel, maxVsizeAllocationPerAlice)
+ .Append(ProtocolConstants.RoundMaxSuggestedAmount, maxSuggestedAmount)
.Append(ProtocolConstants.RoundAmountCredentialIssuerParametersStrobeLabel, amountCredentialIssuerParameters)
.Append(ProtocolConstants.RoundVsizeCredentialIssuerParametersStrobeLabel, vsizeCredentialIssuerParameters)
.GetHash();

MODIFY
WalletWasabi/WabiSabi/Models/RoundState.cs
WalletWasabi/WabiSabi/Models/RoundState.cs
@@ -23,6 +23,7 @@ public record RoundState(
long MaxAmountCredentialValue,
long MaxVsizeCredentialValue,
long MaxVsizeAllocationPerAlice,
+ long MaxSuggestedAmount,
MultipartyTransactionState CoinjoinState)
{
private uint256 _id;
@@ -48,7 +49,9 @@ public record RoundState(
round.MaxAmountCredentialValue,
round.MaxVsizeCredentialValue,
round.MaxVsizeAllocationPerAlice,
- round.CoinjoinState.GetStateFrom(stateId));
+ round.MaxSuggestedAmount,
+ round.CoinjoinState.GetStateFrom(stateId)
+ );
public TState Assert<TState>() where TState : MultipartyTransactionState =>
CoinjoinState switch
@@ -82,6 +85,7 @@ public record RoundState(
MaxAmountCredentialValue,
MaxVsizeCredentialValue,
MaxVsizeAllocationPerAlice,
+ MaxSuggestedAmount,
AmountCredentialIssuerParameters,
VsizeCredentialIssuerParameters);
}

MODIFY
WalletWasabi/WabiSabi/ProtocolContants.cs
WalletWasabi/WabiSabi/ProtocolContants.cs
@@ -11,6 +11,7 @@ public static class ProtocolConstants
// Round hashing labels
public const string RoundStrobeDomain = "round-parameters";
+
public const string RoundAllowedInputAmountsStrobeLabel = "allowed-input-amounts";
public const string RoundAllowedOutputAmountsStrobeLabel = "allowed-output-amounts";
public const string RoundAllowedInputTypesStrobeLabel = "allowed-input-types";
@@ -31,9 +32,11 @@ public static class ProtocolConstants
public const string RoundConnectionConfirmationTimeoutStrobeLabel = "connection-confirmation-timeout";
public const string RoundOutputRegistrationTimeoutStrobeLabel = "output-registration-timeout";
public const string RoundTransactionSigningTimeoutStrobeLabel = "transaction-signing-timeout";
+ public const string RoundMaxSuggestedAmount = "maximum-suggested-amount";
// Alice hashing labels
public const string AliceStrobeDomain = "alice-parameters";
+
public const string AliceCoinTxOutStrobeLabel = "coin-txout";
public const string AliceCoinOutpointStrobeLabel = "coin-outpoint";
public const string AliceOwnershipProofStrobeLabel = "ownership-proof";

Add MaxSuggestedAmount