Skip to content
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

Add sane fallback for fee estimation #7296

Merged
merged 3 commits into from Jan 13, 2016
Merged

Add sane fallback for fee estimation #7296

merged 3 commits into from Jan 13, 2016

Conversation

@morcos
Copy link
Member

morcos commented Jan 5, 2016

Make fee estimation logic respect GetRequiredFee at all times.
In addition add new commandline option "-fallbackfee" to use when fee estimation does not have sufficient data.

@MarcoFalke
Copy link
Member

MarcoFalke commented Jan 5, 2016

utACK cc99c41

@MarcoFalke
MarcoFalke reviewed Jan 5, 2016
View changes
src/wallet/wallet.cpp Outdated
@@ -47,6 +47,12 @@ bool fSendFreeTransactions = DEFAULT_SEND_FREE_TRANSACTIONS;
* Override with -mintxfee
*/
CFeeRate CWallet::minTxFee = CFeeRate(DEFAULT_TRANSACTION_MINFEE);
/**
* If fee estimation does not have enough data to provide estimates, the use this fee instead.

This comment has been minimized.

Copy link
@MarcoFalke

MarcoFalke Jan 5, 2016

Member

Nit: , then use ...

nFeeNeeded = fallbackFee.GetFee(nTxBytes);
}
// prevent user from paying a fee below minRelayTxFee or minTxFee
nFeeNeeded = std::max(nFeeNeeded, GetRequiredFee(nTxBytes));

This comment has been minimized.

Copy link
@MarcoFalke

MarcoFalke Jan 5, 2016

Member

This is important on it's own. Could you split this diff (line 2236-2237) into a separate commit?

Edit: See 995b9f3

@@ -41,6 +41,8 @@ static const unsigned int DEFAULT_KEYPOOL_SIZE = 100;
static const CAmount DEFAULT_TRANSACTION_FEE = 0;
//! -paytxfee will warn if called with a higher fee than this amount (in satoshis) per KB
static const CAmount nHighTransactionFeeWarning = 0.01 * COIN;
//! -fallbackfee default
static const CAmount DEFAULT_FALLBACK_FEE = 20000;

This comment has been minimized.

Copy link
@MarcoFalke

MarcoFalke Jan 5, 2016

Member

I'd say 11000 is enough, we can determine a "better" DEFAULT_ for 0.13

morcos added 2 commits Jan 5, 2016
Add new commandline option "-fallbackfee" to use when fee estimation does not have sufficient data.
@morcos morcos force-pushed the morcos:fallbackfee branch to e420a1b Jan 5, 2016
@morcos
Copy link
Member Author

morcos commented Jan 5, 2016

Addressed @MarcoFalke's comments.
Although left fee = 20k satoshis until the bikeshedding is finished. I don't care want goes there, but I propose using the result of estimatefee(4) with a significantly longer time decay over the last few months. I'll post the result of that once calculated.

This is meant for 0.12 backport

@MarcoFalke

This comment has been minimized.

Copy link

MarcoFalke commented on e420a1b Jan 5, 2016

@morcos Travis fails this. I guess you could add -fallbackfee=1000 to mempool_limit.py. (untested)

@morcos
Copy link
Member Author

morcos commented Jan 5, 2016

@MarcoFalke ugh.. thanks. more than just that one fail. These are probably things that should be fixed b/c the travis tests that fail are implicitly depending on estimatefee returning minrelaytxfee, which isn't a good assumption. I'm working on it

@wumpus
Copy link

wumpus commented Jan 6, 2016

Reminder: @wumpus on github is not a bitcoin person.

@morcos
Copy link
Member Author

morcos commented Jan 6, 2016

Apologies.

@laanwj I think we could use this in 0.12

@laanwj laanwj added the Wallet label Jan 7, 2016
@laanwj laanwj added this to the 0.12.0 milestone Jan 7, 2016
@laanwj
Copy link
Member

laanwj commented Jan 7, 2016

Concept ACK.

One nit: this adds yet another -XXXfee parameter.
Although it makes sense, for the wallet we already have -mintxfee, -paytxfee, -maxtxfee this wild growth of options does get a bit confusing for users, I think.
But I don't know a better solution either.

@dcousens
Copy link
Contributor

dcousens commented Jan 8, 2016

@laanwj it's also not clear whether those parameters are referring to the wallet or to relay policy (until you read the documentation in-depth, anyway).

@btcdrak
Copy link
Contributor

btcdrak commented Jan 8, 2016

Concept ACK will test later today.

@sdaftuar
Copy link
Member

sdaftuar commented Jan 12, 2016

Tested, ACK bebe58b

@MarcoFalke
Copy link
Member

MarcoFalke commented Jan 12, 2016

@laanwj
Copy link
Member

laanwj commented Jan 13, 2016

utACK

@laanwj laanwj merged commit bebe58b into bitcoin:master Jan 13, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
laanwj added a commit that referenced this pull request Jan 13, 2016
bebe58b SQUASHME: Fix rpc tests that assumed fallback to minRelayTxFee (Alex Morcos)
e420a1b Add sane fallback for fee estimation (Alex Morcos)
995b9f3 Always respect GetRequiredFee for wallet txs (Alex Morcos)
laanwj added a commit that referenced this pull request Jan 13, 2016
- Always respect GetRequiredFee for wallet txs
- Add sane fallback for fee estimation
- SQUASHME: Fix rpc tests that assumed fallback to minRelayTxFee

Add new commandline option "-fallbackfee" to use when fee estimation does not have sufficient data.

Github-Pull: #7296
Rebased-From: 995b9f3 e420a1b bebe58b
@laanwj
Copy link
Member

laanwj commented Jan 13, 2016

Cherry-picked to 0.12 as a36d79b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants
You can’t perform that action at this time.