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

Conversation

morcos
Copy link
Member

@morcos 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

@@ -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.
Copy link
Member

@MarcoFalke MarcoFalke Jan 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: , then use ...

morcos added 2 commits Jan 5, 2016
Add new commandline option "-fallbackfee" to use when fee estimation does not have sufficient data.
@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

@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
laanwj added a commit that referenced this issue 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 pushed a commit that referenced this issue 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

furszy added a commit to PIVX-Project/PIVX that referenced this issue Jun 28, 2020
fc81158 [QA] Add test_change_position case to rpc_fundrawtransaction.py (random-zebra)
dd35760 [QA] Add test_option_feerate to rpc_fundrawtransaction functional test (random-zebra)
5bca4f4 Add more clear interface for CoinControl.h regarding individual feerate (random-zebra)
169bc3b [RPC] add feerate option to fundrawtransaction (random-zebra)
87dbdf8 [QA] Test new options in rpc_fundrawtransaction functional test (random-zebra)
bc9dc67 Add lockUnspents option to fundrawtransaction (random-zebra)
a3ac191 Add change options to fundrawtransaction (random-zebra)
0c1f7ba Add strict flag to RPCTypeCheckObj (random-zebra)
d655b42 Use CCoinControl selection in CWallet::FundTransaction (random-zebra)
76c8d54 [QA] Test watchonly addrs in fundrawtransaction tests (random-zebra)
134c5d2 Implement watchonly support in fundrawtransaction (random-zebra)
1b153e5 Update importaddress help to push its use to script-only (random-zebra)
7b4eb6d Add importpubkey method to import a watch-only pubkey (random-zebra)
816dabb Add p2sh option to importaddress to import redeemScripts (random-zebra)
60a20a4 Split up importaddress into helper functions (random-zebra)
cbffa80 Add logic to track pubkeys as watch-only, not just scripts (random-zebra)
12b38b0 Add have-pubkey distinction to ISMINE flags (random-zebra)
fab6556 Exempt unspendable transaction outputs from dust checks (random-zebra)
ab407ff [Tests] Fix and enable fundrawtransaction functional tests (random-zebra)
bc44ba0 [wallet] allow transaction without change if keypool is empty (random-zebra)
a2f8071 [wallet] CreateTransaction: simplify change address check (random-zebra)
761e60e Add fundrawtransaction RPC method (random-zebra)
ccb18dd Add FundTransaction method to wallet (random-zebra)
692b827 Add DummySignatureCreator which just creates zeroed sigs (random-zebra)

Pull request description:

  based on top of
  - [x] #1662

  This introduces a new wallet function, `CWallet::FundTransaction()` (and exposes it via RPC with `fundrawtransaction`), to fill a tx containing only vouts (or not enough vins to cover the vouts) with unspent coins from the wallet.

  `fundrawtransaction` will not modify existing inputs, and will add one change output (if needed) to the outputs. It will not sign the inputs (so can include also watch-only or multi-sig inputs, if enabled).

  backported from:
  - bitcoin#6088
  - bitcoin#17219 [`*`]
  - bitcoin#6417
  - bitcoin#6444
  - bitcoin#6415
  - bitcoin#6828
  - bitcoin#7296 (only bebe58b)
  - bitcoin#7506
  - bitcoin#7518
  - bitcoin#7967

  adapting the tests for the (more recent) framework.

  [`*`] Note: this has been included to be able to call `fundrawtransaction` without the need for an unencrypted wallet (for the change address key)

ACKs for top commit:
  furszy:
    re ACK fc81158 .
  Fuzzbawls:
    ACK fc81158

Tree-SHA512: 10235ce6e672a1cfd4ae2cad9312864c82971f6a4aa1a8ed9489d85156f5c4126c293180a7f1b86b7c65d07caab484e9a6d7a87ebf032bee55adb98d3e08e7b9
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants