Skip to content

Commit

Permalink
Reduce wallet and relay min rate to 100 sat/vkB
Browse files Browse the repository at this point in the history
  • Loading branch information
instagibbs committed Oct 4, 2019
1 parent 591a493 commit c82fbe7
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/policy/policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extern CAsset policyAsset;
/** Default for -blockmaxweight, which controls the range of block weights the mining code will create **/
static const unsigned int DEFAULT_BLOCK_MAX_WEIGHT = MAX_BLOCK_WEIGHT - 4000;
/** Default for -blockmintxfee, which sets the minimum feerate for a transaction in blocks created by mining code **/
static const unsigned int DEFAULT_BLOCK_MIN_TX_FEE = 1000;
static const unsigned int DEFAULT_BLOCK_MIN_TX_FEE = 100;
/** The maximum weight for transactions we're willing to relay/mine */
static const unsigned int MAX_STANDARD_TX_WEIGHT = 400000;
/** The minimum non-witness size for transactions we're willing to relay/mine (1 segwit input + 1 P2WPKH output = 82 bytes) */
Expand All @@ -34,7 +34,7 @@ static const unsigned int MAX_STANDARD_TX_SIGOPS_COST = MAX_BLOCK_SIGOPS_COST/5;
/** Default for -maxmempool, maximum megabytes of mempool memory usage */
static const unsigned int DEFAULT_MAX_MEMPOOL_SIZE = 300;
/** Default for -incrementalrelayfee, which sets the minimum feerate increase for mempool limiting or BIP 125 replacement **/
static const unsigned int DEFAULT_INCREMENTAL_RELAY_FEE = 1000;
static const unsigned int DEFAULT_INCREMENTAL_RELAY_FEE = 100;
/** Default for -bytespersigop */
static const unsigned int DEFAULT_BYTES_PER_SIGOP = 20;
/** The maximum number of witness stack items in a standard P2WSH script */
Expand Down
2 changes: 1 addition & 1 deletion src/validation.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static const bool DEFAULT_WHITELISTRELAY = true;
/** Default for -whitelistforcerelay. */
static const bool DEFAULT_WHITELISTFORCERELAY = false;
/** Default for -minrelaytxfee, minimum relay fee for transactions */
static const unsigned int DEFAULT_MIN_RELAY_TX_FEE = 1000;
static const unsigned int DEFAULT_MIN_RELAY_TX_FEE = 100;
//! -maxtxfee default
static const CAmount DEFAULT_TRANSACTION_MAXFEE = COIN / 10;
//! Discourage users to set fees higher than this amount (in satoshis) per kB
Expand Down
4 changes: 2 additions & 2 deletions src/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ static const CAmount DEFAULT_FALLBACK_FEE = 20000;
//! -discardfee default
static const CAmount DEFAULT_DISCARD_FEE = 10000;
//! -mintxfee default
static const CAmount DEFAULT_TRANSACTION_MINFEE = 1000;
static const CAmount DEFAULT_TRANSACTION_MINFEE = 100;
//! minimum recommended increment for BIP 125 replacement txs
static const CAmount WALLET_INCREMENTAL_RELAY_FEE = 5000;
static const CAmount WALLET_INCREMENTAL_RELAY_FEE = 500;
//! Default for -spendzeroconfchange
static const bool DEFAULT_SPEND_ZEROCONF_CHANGE = true;
//! Default for -walletrejectlongchains
Expand Down
2 changes: 1 addition & 1 deletion test/functional/feature_bip68_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def test_sequence_lock_confirmed_inputs(self):
value += utxos[j]["amount"]*COIN
# Overestimate the size of the tx - signatures should be less than 120 bytes, and leave 50 for the output
tx_size = len(ToHex(tx))//2 + 120*num_inputs + 150 # ELEMENTS: overestimate more for output witnesses
tx.vout.append(CTxOut(int(value-self.relayfee*tx_size*COIN/1000), CScript([b'a'])))
tx.vout.append(CTxOut(int(value)-int(self.relayfee*tx_size*COIN/1000), CScript([b'a'])))
tx.vout.append(CTxOut(int(self.relayfee*tx_size*COIN/1000))) # fee
rawtx = self.nodes[0].signrawtransactionwithwallet(ToHex(tx))["hex"]

Expand Down
8 changes: 4 additions & 4 deletions test/functional/mempool_limit.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def run_test(self):
relayfee = self.nodes[0].getnetworkinfo()['relayfee']

self.log.info('Check that mempoolminfee is minrelytxfee')
assert_equal(self.nodes[0].getmempoolinfo()['minrelaytxfee'], Decimal('0.00001000'))
assert_equal(self.nodes[0].getmempoolinfo()['mempoolminfee'], Decimal('0.00001000'))
assert_equal(self.nodes[0].getmempoolinfo()['minrelaytxfee'], Decimal('0.00000100'))
assert_equal(self.nodes[0].getmempoolinfo()['mempoolminfee'], Decimal('0.00000100'))

txids = []
utxos = create_confirmed_utxos(relayfee, self.nodes[0], 91)
Expand Down Expand Up @@ -52,8 +52,8 @@ def run_test(self):
assert(txdata['confirmations'] == 0) #confirmation should still be 0

self.log.info('Check that mempoolminfee is larger than minrelytxfee')
assert_equal(self.nodes[0].getmempoolinfo()['minrelaytxfee'], Decimal('0.00001000'))
assert_greater_than(self.nodes[0].getmempoolinfo()['mempoolminfee'], Decimal('0.00001000'))
assert_equal(self.nodes[0].getmempoolinfo()['minrelaytxfee'], Decimal('0.00000100'))
assert_greater_than(self.nodes[0].getmempoolinfo()['mempoolminfee'], Decimal('0.00000100'))

self.log.info('Create a mempool tx that will not pass mempoolminfee')
us0 = utxos.pop()
Expand Down
3 changes: 1 addition & 2 deletions test/functional/rpc_fundrawtransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def run_test(self):
# than a minimum sized signature.

# = 2 bytes * minRelayTxFeePerByte
feeTolerance = 2 * min_relay_tx_fee/1000
feeTolerance = 2 * min_relay_tx_fee/100
# ELEMENTS NOTE: fee deltas will be negative due to blinding and no blinding in rawtransaction

self.nodes[2].generate(1)
Expand Down Expand Up @@ -472,7 +472,6 @@ def run_test(self):

mSigObj = self.nodes[2].addmultisigaddress(2, [addr1Obj['pubkey'], addr2Obj['pubkey']])['address']


# send 1.2 BTC to msig addr
txId = self.nodes[0].sendtoaddress(mSigObj, 1.2)
self.sync_all()
Expand Down
4 changes: 2 additions & 2 deletions test/functional/wallet_bumpfee.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ def test_dust_to_fee(rbf_node, dest_address):


def test_settxfee(rbf_node, dest_address):
assert_raises_rpc_error(-8, "txfee cannot be less than min relay tx fee", rbf_node.settxfee, Decimal('0.000005'))
assert_raises_rpc_error(-8, "txfee cannot be less than wallet min fee", rbf_node.settxfee, Decimal('0.000015'))
assert_raises_rpc_error(-8, "txfee cannot be less than min relay tx fee", rbf_node.settxfee, Decimal('0.0000005'))
assert_raises_rpc_error(-8, "txfee cannot be less than wallet min fee", rbf_node.settxfee, Decimal('0.0000015'))
# check that bumpfee reacts correctly to the use of settxfee (paytxfee)
rbfid = spend_one_input(rbf_node, dest_address)
requested_feerate = Decimal("0.00025000")
Expand Down

0 comments on commit c82fbe7

Please sign in to comment.