-
Notifications
You must be signed in to change notification settings - Fork 35.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lower default relay fees #13922
Lower default relay fees #13922
Conversation
Concept ACK |
This was more complicated than I expected, so careful review would probably be a good idea. Possible things worth focusing on:
|
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
src/policy/fees.cpp
Outdated
confAvg.resize(maxPeriods); | ||
for (unsigned int i = 0; i < maxPeriods; i++) { | ||
confAvg[i].resize(buckets.size()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit (here and below): You could use a C++11 for-each loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit now applies to #13990
BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), 0); | ||
// ... unless it has gone all the way to 0 (after getting past 1000/2) | ||
// ... unless it has gone all the way to 0 (after getting past minrelayfee/2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of changing all the constants in this test, couldn't you set the global min relay fee at the start of the test to 1000 and then back to what it was initially at the end of the test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it made more sense to check the default behaviour works right, though that would be plausible too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If tests don't already run in parallel, it would be nice if they did someday...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luke-jr just curious, why? Running in parallel makes it harder to debug and reason about.
src/wallet/rpcwallet.cpp
Outdated
@@ -2982,6 +2982,14 @@ static UniValue settxfee(const JSONRPCRequest& request) | |||
LOCK2(cs_main, pwallet->cs_wallet); | |||
|
|||
CAmount nAmount = AmountFromValue(request.params[0]); | |||
CFeeRate nFeeRate(nAmount, 1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Should be snake_case: tx_fee_rate
.
Also, could submit this feature independent of this pull request, i.e. create a separate pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in independent PR #13988
src/rpc/net.cpp
Outdated
@@ -169,6 +170,7 @@ static UniValue getpeerinfo(const JSONRPCRequest& request) | |||
obj.pushKV("inflight", heights); | |||
} | |||
obj.pushKV("whitelisted", stats.fWhitelisted); | |||
obj.pushKV("minfee", ValueFromAmount(stats.minFeeFilter)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing test. Also, this feature should probably be submitted in separate pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test added in separate #13987
"it changes the min tx fee to 200 s/B, and the incremental relay fee to 100 s/B" I think you mean |
src/policy/fees.cpp
Outdated
LogPrintf("%s: loaded a bunch of fee estimation data, version %d, buckets %d (target: %d\n", __func__, nVersionThatWrote, numBuckets, buckets.size()); | ||
|
||
LogPrintf("%s: buckets.size %d, buckets[0] %f, buckets[1] %f\n", __func__, buckets.size(), buckets[0], buckets[1]); | ||
LogPrintf("%s: fileBuckets.size %d, fileBuckets[0] %f, fileBuckets[1] %f\n", __func__, fileBuckets.size(), fileBuckets[0], fileBuckets[1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: whitespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, those weren't meant to be committed in the first place...
Concept ACK. Mind adding a release note? |
Rebased and release note added |
doc/release-notes-13922.md
Outdated
blockmintxfee and incrementalrelayfee options. | ||
|
||
Note that until these lower defaults are widely adopted across the | ||
network, transactions created with lower fee rates may not propogate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo found by codespell
: propogate
42e2af5
to
56251ce
Compare
test/functional/mempool_limit.py
Outdated
@@ -13,7 +13,7 @@ class MempoolLimitTest(BitcoinTestFramework): | |||
def set_test_params(self): | |||
self.setup_clean_chain = True | |||
self.num_nodes = 1 | |||
self.extra_args = [["-maxmempool=5", "-spendzeroconfchange=0"]] | |||
self.extra_args = [["-maxmempool=5", "-spendzeroconfchange=0","-minrelaytxfee=0.00001"]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./test/functional/mempool_limit.py:16:70: E231 missing whitespace after ','
Some tests assume a minrelaytxfee of 1000 satoshi/kB, so explicitly set that in preparation for lowering the default.
This changes the fee defaults to: BLOCK_MIN_TX_FEE = 200 DEFAULT_MIN_RELAY_TX_FEE = 200 DEFAULT_INCREMENTAL_RELAY_FEE = 100 DEFAULT_TRANSACTION_MINFEE = 1000 WALLET_INCREMENTAL_RELAY_FEE = 5000 These reduce default minimum network fees by a factor of 5 (from 1000s/kB to 200s/kB), which matches previous decreases in lowering the price of block data in USD to about 1c/kB: 2013-05: 50,000 to 10,000 at $100 USD/BTC: 5c/kB to 1c/kB 2014-11: 10,000 to 1,000 at $700 USD/BTC: 7c/kB to 0.7c/kB 2015-10: 1,000 to 5,000 and back to 1,000 at $250 USD/BTC: 0.25c/kB to 1.25c/kB to 0.25c/kB 2018-08: 1,000 to 200 at $6000 USD/BTC: 6c/kB to 1.2c/kB (Note that on a per-transaction basis, the witness discount generally decreases fees by about a further 50%, so for individual's a better comparison might be 3c/kB to 0.6c/kB) The incremental relay fee is lowered further, to allow cheaper updates of transactions, which makes better use of blockspace. Because it will take time for the network to broadly support these lower mining and relay fees, the wallet defaults are left unchanged at 1000s/kB and 5000s/kB.
56251ce
to
a04a014
Compare
Rebased due to conflict in python tests; fixed formatting nit; fixed amount typo in changes to mempool test (7000/5 is 1400 not 1500). |
Repeating some in-person comments:
|
Closing for now pending further progress on #13990, intending to reopen or refile later |
@ajtowns It's been two years, and The mempool has been emptying pretty much every week, and often every day. With LN interest catching on there is a larger need for "next-day" ultra-low fee on-chain TXNs. |
In the meeting of 2018-07-05, we discussed dropping the minimum fee rate below 1000 satoshi/kB. This patch set does only that, leaving related features for other PRs.
There's a bit more of an explanation for some of the choices in the individual commit messages.
Related PRs: