Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions qa/rpc-tests/llmq-is-spark.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ def run_test(self):
self.nodes[0].generate(501 - self.nodes[0].getblockcount())

sparkaddress = self.nodes[0].getnewsparkaddress()[0]
# Mint a few larger single coins so spendspark can cover amount+fee from
# one coin (multi-input Spark spends are disabled).
# Mint coins large enough that spendspark covers amount and fee.
for i in range(0, 3):
mintTxids = self.nodes[0].mintspark({sparkaddress: {"amount": 5, "memo":"Test memo"}})

Expand Down
5 changes: 2 additions & 3 deletions qa/rpc-tests/spark_mintspend.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ def run_test(self):
sparkAddress = self.nodes[0].getsparkdefaultaddress()[0]

mint_trans = list()
# Mint one large coin that can alone cover later spend amount + fee
# (multi-input Spark spends are disabled), plus a second mint for the
# confirmation / balance accounting checks below.
# Mint one coin large enough to cover a later spend and its fee,
# plus a second mint for the confirmation and balance checks below.
mint_trans.append(self.nodes[0].mintspark({sparkAddress: {"amount": 5, "memo": "Test memo"}}))
mint_trans.append(self.nodes[0].mintspark({sparkAddress: {"amount": 2, "memo":"Test memo"}}))

Expand Down
3 changes: 1 addition & 2 deletions qa/rpc-tests/spark_spend_gettransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ def run_test(self):

valid_address = self.nodes[0].getnewaddress()

# Mint a few large single coins so each spendspark can fund amount+fee
# from one coin (multi-input Spark spends are disabled).
# Mint coins large enough that each spendspark covers amount and fee.
for _ in range(2):
self.nodes[0].mintspark({sparkAddress: {"amount": 5, "memo": "Test memo"}})

Expand Down
4 changes: 2 additions & 2 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1273,8 +1273,8 @@ class CRegTestParams : public CChainParams {
consensus.nLelantusStartBlock = 1;
consensus.nLelantusFixesStartBlock = 1;
consensus.nSparkStartBlock = 100;
consensus.nSparkSingleInputStartBlock = 500;
consensus.nSparkChaumV2StartBlock = 700;
consensus.nSparkSingleInputStartBlock = 1;
Comment thread
reubenyap marked this conversation as resolved.
consensus.nSparkChaumV2StartBlock = 1;
consensus.nExchangeAddressStartBlock = 1000;
consensus.nLelantusGracefulPeriod = 600;
consensus.nSigmaEndBlock = 1;
Expand Down
19 changes: 1 addition & 18 deletions src/qt/bitcoinstrings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,28 +215,13 @@ QT_TRANSLATE_NOOP("firo-core", ""
"Sets the serialization of raw transaction or block hex returned in non-"
"verbose mode, non-segwit(0) or segwit(1) (default: %d)"),
QT_TRANSLATE_NOOP("firo-core", ""
"Spark Coin Control temporarily supports selecting at most one coin. Clear "
"the selection to let the wallet split the payment automatically."),
QT_TRANSLATE_NOOP("firo-core", ""
"Spark batch verification failed. The invalid spend transactions are listed "
"in debug.log. Restart the node: batching is disabled and a reindex is "
"started automatically so chainstate is rebuilt and Spark proofs are checked "
"block by block."),
QT_TRANSLATE_NOOP("firo-core", ""
"Spark multi-input spends are temporarily disabled. No single available Spark "
"coin can fund this transaction."),
QT_TRANSLATE_NOOP("firo-core", ""
"Spark spend batch failed after committing %u of %u transactions: %s. Do not "
"retry the whole payment. Already sent: %s"),
QT_TRANSLATE_NOOP("firo-core", ""
"Subtracting the fee from the amount is temporarily unavailable when a Spark "
"spend must be split across multiple transactions."),
QT_TRANSLATE_NOOP("firo-core", ""
"Support filtering of blocks and transaction with bloom filters (default: %u)"),
QT_TRANSLATE_NOOP("firo-core", ""
"The available Spark coins cannot cover the amount and the required "
"transaction fees."),
QT_TRANSLATE_NOOP("firo-core", ""
"The block database contains a block which appears to be from the future. "
"This may be due to your computer's date and time being set incorrectly. Only "
"rebuild the block database if you are sure that your computer's date and "
Expand Down Expand Up @@ -347,7 +332,6 @@ QT_TRANSLATE_NOOP("firo-core", "(default: %u)"),
QT_TRANSLATE_NOOP("firo-core", "-maxmempool must be at least %d MB"),
QT_TRANSLATE_NOOP("firo-core", "-wallet parameter must only specify a filename (not a path)"),
QT_TRANSLATE_NOOP("firo-core", "<category> can be:"),
QT_TRANSLATE_NOOP("firo-core", "A Spark payment may use at most %u transactions."),
QT_TRANSLATE_NOOP("firo-core", "Accept command line and JSON-RPC commands"),
QT_TRANSLATE_NOOP("firo-core", "Accept public REST requests (default: %u)"),
QT_TRANSLATE_NOOP("firo-core", "Add Pay To n-of-m Multi-sig output to TX. n = REQUIRED, m = PUBKEYS"),
Expand Down Expand Up @@ -461,6 +445,7 @@ QT_TRANSLATE_NOOP("firo-core", "Maximum per-connection receive buffer, <n>*1000
QT_TRANSLATE_NOOP("firo-core", "Maximum per-connection send buffer, <n>*1000 bytes (default: %u)"),
QT_TRANSLATE_NOOP("firo-core", "Need to specify a port with -whitebind: '%s'"),
QT_TRANSLATE_NOOP("firo-core", "No Spark spend recipients were provided."),
QT_TRANSLATE_NOOP("firo-core", "No single available Spark coin can fund this Spark V1 spend."),
QT_TRANSLATE_NOOP("firo-core", "No such coin in set"),
QT_TRANSLATE_NOOP("firo-core", "Node relay options:"),
QT_TRANSLATE_NOOP("firo-core", "Not enough fee estimated"),
Expand Down Expand Up @@ -510,7 +495,6 @@ QT_TRANSLATE_NOOP("firo-core", "Signing transaction failed"),
QT_TRANSLATE_NOOP("firo-core", "Spark V2 spends are limited to %1% inputs"),
QT_TRANSLATE_NOOP("firo-core", "Spark address doesn't belong to the wallet"),
QT_TRANSLATE_NOOP("firo-core", "Spark coin selection changed during transaction construction; retry"),
QT_TRANSLATE_NOOP("firo-core", "Spark fee estimate did not match the wallet (planned %s, wallet %s)."),
QT_TRANSLATE_NOOP("firo-core", "Spark name transaction size is out of range"),
QT_TRANSLATE_NOOP("firo-core", "Spark shielded output limit exceeded."),
QT_TRANSLATE_NOOP("firo-core", "Spark spend amount is out of range"),
Expand Down Expand Up @@ -555,7 +539,6 @@ QT_TRANSLATE_NOOP("firo-core", "Transaction not allowed in mempool"),
QT_TRANSLATE_NOOP("firo-core", "Transaction too large for fee policy"),
QT_TRANSLATE_NOOP("firo-core", "Unable to bind to %s on this computer (bind returned error %s)"),
QT_TRANSLATE_NOOP("firo-core", "Unable to bind to %s on this computer. %s is probably already running."),
QT_TRANSLATE_NOOP("firo-core", "Unable to create a single-input Spark transaction."),
QT_TRANSLATE_NOOP("firo-core", "Unable to create a valid Spark name transaction"),
QT_TRANSLATE_NOOP("firo-core", "Unable to create spend transaction."),
QT_TRANSLATE_NOOP("firo-core", "Unable to estimate the final Spark name transaction fee"),
Expand Down
32 changes: 12 additions & 20 deletions src/qt/coincontroldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "walletmodel.h"

#include "wallet/coincontrol.h"
#include "wallet/sparkbatchplanner.h"
#include "init.h"
#include "policy/policy.h"
#include "validation.h" // For mempool
Expand Down Expand Up @@ -64,25 +63,18 @@ unsigned int CoinControlDialog::estimateSparkTxBytes(
: left * right;
};

uint64_t estimatedSize;
if (selectedInputs == 1) {
estimatedSize = spark::EstimateSingleInputSparkSize(
privateOutputs,
transparentOutputs);
} else {
estimatedSize = 924;
estimatedSize = saturatingAdd(
estimatedSize,
saturatingMultiply(1803, selectedInputs));
estimatedSize = saturatingAdd(
estimatedSize,
saturatingMultiply(
322,
saturatingAdd(privateOutputs, 1)));
estimatedSize = saturatingAdd(
estimatedSize,
saturatingMultiply(34, transparentOutputs));
}
uint64_t estimatedSize = 924;
estimatedSize = saturatingAdd(
estimatedSize,
saturatingMultiply(1803, selectedInputs));
estimatedSize = saturatingAdd(
estimatedSize,
saturatingMultiply(
322,
saturatingAdd(privateOutputs, 1)));
estimatedSize = saturatingAdd(
estimatedSize,
saturatingMultiply(34, transparentOutputs));
if (versionedSpend) {
estimatedSize = saturatingAdd(estimatedSize, 32);
if (selectedInputs > 1) {
Expand Down
112 changes: 1 addition & 111 deletions src/qt/locale/bitcoin_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4479,12 +4479,7 @@ Also you can choose wallet birth date for more faster and optimised wallet scan.
<translation type="unfinished"></translation>
</message>
<message>
<location line="+54"/>
<source>Private transaction staging produced an unexpected transaction count</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+24"/>
<location line="+78"/>
<source>Intermediate address was not found in the transaction</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -4615,16 +4610,6 @@ Also you can choose wallet birth date for more faster and optimised wallet scan.
<source>Error</source>
<translation type="unfinished">Error</translation>
</message>
<message>
<location line="+1"/>
<source>Sending private funds to an exchange address is temporarily unavailable. Move the funds to a transparent address first, then send from there.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+303"/>
<source>This payment does not fit in one Spark coin and will be sent as %1 separate transactions. Each pays its own fee, they can be linked to each other, and if one of them is rejected the recipients will have been paid only in part.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
Expand Down Expand Up @@ -6076,41 +6061,11 @@ Raw data: %1</source>
<source>The entered address does not belong to this wallet.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+141"/>
<source>Spark Coin Control temporarily supports selecting at most one coin. Clear the selection to let the wallet split the payment automatically.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+30"/>
<source>Subtracting the fee from the amount is temporarily unavailable for Spark spends.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+112"/>
<source>Spend to transparent address limit exceeded.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>A Spark payment may use at most %1 transactions.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>The available Spark coins cannot cover the amount and the required transaction fees.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+52"/>
<source>Unable to create a single-input Spark transaction.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Spark fee estimate did not match the wallet (planned %1, wallet %2).</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+135"/>
<source>Unable to create a versioned Spark transaction.</source>
Expand All @@ -6121,21 +6076,6 @@ Raw data: %1</source>
<source>Chain height changed during Spark name construction; retry</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<source>Spark name registration temporarily uses a single Spark coin. Please select at most one.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Unable to select a Spark coin.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+26"/>
<source>Spark name registration temporarily requires one Spark coin large enough to cover the registration and transaction fees.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+17"/>
<source>Unable to create the expected Spark transaction format.</source>
Expand All @@ -6148,16 +6088,6 @@ Raw data: %1</source>
<source>Refusing to commit an incompatible Spark transaction format.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-48"/>
<source>Refusing to commit an incomplete Spark transaction.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+70"/>
<source> This payment was split across %1 transactions and %2 of them were already sent, so the recipients have been paid only in part. Do not retry the whole payment. Already sent: %3</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>WalletView</name>
Expand Down Expand Up @@ -6430,36 +6360,11 @@ Raw data: %1</source>
<source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Spark Coin Control temporarily supports selecting at most one coin. Clear the selection to let the wallet split the payment automatically.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Spark batch verification failed. The invalid spend transactions are listed in debug.log. Restart the node: batching is disabled and a reindex is started automatically so chainstate is rebuilt and Spark proofs are checked block by block.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Spark multi-input spends are temporarily disabled. No single available Spark coin can fund this transaction.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Spark spend batch failed after committing %u of %u transactions: %s. Do not retry the whole payment. Already sent: %s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Subtracting the fee from the amount is temporarily unavailable when a Spark spend must be split across multiple transactions.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>The available Spark coins cannot cover the amount and the required transaction fees.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>The block database contains a block which appears to be from the future. This may be due to your computer&apos;s date and time being set incorrectly. Only rebuild the block database if you are sure that your computer&apos;s date and time are correct</source>
Expand Down Expand Up @@ -6595,11 +6500,6 @@ Raw data: %1</source>
<source>&lt;category&gt; can be:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>A Spark payment may use at most %u transactions.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Add Pay To n-of-m Multi-sig output to TX. n = REQUIRED, m = PUBKEYS</source>
Expand Down Expand Up @@ -7016,11 +6916,6 @@ Raw data: %1</source>
<source>Unable to bind to %s on this computer. %s is probably already running.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Unable to create a single-input Spark transaction.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Unable to create a valid Spark name transaction</source>
Expand Down Expand Up @@ -7521,11 +7416,6 @@ Raw data: %1</source>
<source>Spark coin selection changed during transaction construction; retry</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Spark fee estimate did not match the wallet (planned %s, wallet %s).</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Spark name transaction size is out of range</source>
Expand Down
Loading
Loading