Skip to content

Conversation

ajtowns
Copy link
Contributor

@ajtowns ajtowns commented Aug 22, 2023

On mainnet, the error message:

Fee estimation failed. Fallbackfee is disabled. Wait a few blocks or enable -fallbackfee.

is helpful, because if you aren't able to set a fee based on an external source or the internal fee estimation code, then you're likely to either waste money when the default is too high, or have a tx that won't confirm if the default is too low. On regtest and friends it's not help, and the advice may well be wrong: particularly on regtest, mining additional empty blocks won't help at all.

But for test net's there is an easy default available that is quite reliable: just use the minimum tx fee.

@DrahtBot
Copy link
Contributor

DrahtBot commented Aug 22, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
Concept ACK BrandonOdiwuor

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@ajtowns
Copy link
Contributor Author

ajtowns commented Aug 22, 2023

Test with:

$ rm -rf ~/.bitcoin/regtest && ./bitcoind -regtest -daemon
$ ./bitcoin-cli -regtest createwallet "dummy"
$ ./bitcoin-cli -regtest -generate 101 >/dev/null
$ ./bitcoin-cli -regtest sendtoaddress $(./bitcoin-cli -regtest getnewaddress) 1.0 

Copy link
Contributor

@BrandonOdiwuor BrandonOdiwuor left a comment

Choose a reason for hiding this comment

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

Tested ACK #28316

The PR fixes the 'fee estimation failed' error on regtest

pre-fix

$ ./bitcoin-cli -regtest sendtoaddress $(./bitcoin-cli -regtest getnewaddress) 1.0

error code: -6
error message:
Fee estimation failed. Fallbackfee is disabled. Wait a few blocks or enable -fallbackfee.

after the fix:

$ ./bitcoin-cli -regtest sendtoaddress $(./bitcoin-cli -regtest getnewaddress) 1.0
375bf0933754164c5da7567a6fcdb6ae34140155031cba6f6edcd404960cc835

$ ./bitcoin-cli getrawtransaction 375bf0933754164c5da7567a6fcdb6ae34140155031cba6f6edcd404960cc835
02000000000101e386af630bb3d7a9d170f07cb472c28ffe82b72f797b91a4964803c8e6546d2c0000000000fdffffff027310102401000000160014fe3eccfd9050103fbed369df8c49e5e22f37472000e1f50500000000160014ff2df796bd9ca70e89edd21b8a73c7a53d28abf3024730440220791a2399dc6a4e552902738f9c2d7fbac7bcdc521780e50fe194a922b82b1fdf02205e1c2c26667149277440e4a80a5386d327b9b3e3e6fa87232353c71cd5579a520121026bb5c51c88ad288868560702573ce7e21f6a104e46d052c283e80f37fd9ad58765000000

@instagibbs
Copy link
Member

feel like this has been modified multiple times in the past. Latest(?) I think was where it was all set to default off: #16524

earlier was turned off for mainnet: #11882

tend to be nack-ish to make more config defaults difference because it "doesn't seem very helpful", but not strong feeling either

@ajtowns
Copy link
Contributor Author

ajtowns commented Aug 29, 2023

feel like this has been modified multiple times in the past. Latest(?) I think was where it was all set to default off: #16524

earlier was turned off for mainnet: #11882

tend to be nack-ish to make more config defaults difference because it "doesn't seem very helpful", but not strong feeling either

Rephrased the OP more straightforwardly.

Having to run bitcoin-cli -regtest stop; bitcoind -daemon -fallbackfee=0.00001 just to send a transaction to myself on regtest is annoying, and seems like precisely the reason we have defaults...

OTOH, running bitcoin-cli -named -regtest sendtoaddress $ADDR 1.0 -fee_rate=3 works now, so perhaps I should just train myself to do that and ignore the suggestion in the error message.

Historically:

We already use Params().IsTestChain() in DescriptorScriptPubKeyMan::SetupDescriptorGeneration, and also use Params() for .MessageStart() and .GetChainTypeString(). Those all seem straightforward to abstract into interfaces::Chain if we care.

@maflcko
Copy link
Member

maflcko commented Aug 29, 2023

OTOH, running bitcoin-cli -named -regtest sendtoaddress $ADDR 1.0 -fee_rate=3 works now, so perhaps I should just train myself to do that and ignore the suggestion in the error message.

You can also use settxfee (to persist the config for the wallet and the duration of your RPC session), or persist your fee settings in a config file?

unrelated: I guess we can drop IsTestChain now and replace it with a check on the enum class ChainType == MAIN?

@ajtowns
Copy link
Contributor Author

ajtowns commented Aug 29, 2023

unrelated: I guess we can drop IsTestChain now and replace it with a check on the enum class ChainType == MAIN?

Better to keep IsTestChain() but replace m_is_test_chain with m_chain_type==MAIN ?

@ajtowns
Copy link
Contributor Author

ajtowns commented Sep 12, 2023

Doesn't seem to be much interest, closing

@ajtowns ajtowns closed this Sep 12, 2023
@bitcoin bitcoin locked and limited conversation to collaborators Sep 11, 2024
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.

5 participants