Merge pull request #1433 from kilrau/reduce-default-dust-relay-fee

feat: reduce default dust relay fee
This commit is contained in:
Pablo Greco 2025-03-13 08:00:07 -07:00 committed by GitHub
commit b63f7ab9b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 2 deletions

View file

@ -55,7 +55,7 @@ static const unsigned int MAX_STANDARD_SCRIPTSIG_SIZE = 1650;
* standard and should be done with care and ideally rarely. It makes sense to
* only increase the dust limit after prior releases were already not creating
* outputs below the new threshold */
static const unsigned int DUST_RELAY_TX_FEE = 3000;
static const unsigned int DUST_RELAY_TX_FEE = 100;
/**
* Standard script verification flags that standard transactions will comply
* with. However scripts violating these flags may still be present in valid
@ -89,6 +89,9 @@ static constexpr unsigned int STANDARD_NOT_MANDATORY_VERIFY_FLAGS = STANDARD_SCR
static constexpr unsigned int STANDARD_LOCKTIME_VERIFY_FLAGS = LOCKTIME_VERIFY_SEQUENCE |
LOCKTIME_MEDIAN_TIME_PAST;
// ELEMENTS: keep a copy of the upstream default dust relay fee rate
static const unsigned int DUST_RELAY_TX_FEE_BITCOIN = 3000;
CAmount GetDustThreshold(const CTxOut& txout, const CFeeRate& dustRelayFee);
bool IsDust(const CTxOut& txout, const CFeeRate& dustRelayFee);

View file

@ -795,6 +795,7 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
CheckIsStandard(t);
// Check dust with default relay fee:
dustRelayFee = CFeeRate(DUST_RELAY_TX_FEE_BITCOIN); // ELEMENTS: use the Bitcoin default dust relay feerate
CAmount nDustThreshold = 182 * dustRelayFee.GetFeePerK() / 1000;
BOOST_CHECK_EQUAL(nDustThreshold, 546);
// dust:
@ -830,7 +831,7 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
// not dust:
t.vout[0].nValue = 674;
CheckIsStandard(t);
dustRelayFee = CFeeRate(DUST_RELAY_TX_FEE);
dustRelayFee = CFeeRate(DUST_RELAY_TX_FEE_BITCOIN); // ELEMENTS: use the Bitcoin default dust relay feerate
t.vout[0].scriptPubKey = CScript() << OP_1;
CheckIsNotStandard(t, "scriptpubkey");

View file

@ -46,6 +46,7 @@ class MempoolAcceptanceTest(BitcoinTestFramework):
'-txindex',
'-txindex','-permitbaremultisig=0',
'-multi_data_permitted=1', # Elements test
'-dustrelayfee=0.00003000', # ELEMENTS: use the Bitcoin default dust relay fee rate
]] * self.num_nodes
self.supports_cli = False