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

server/asset/doge: use feeConfs and reduce maxFeeBlocks #1965

Merged
merged 1 commit into from Nov 23, 2022

Conversation

chappjc
Copy link
Member

@chappjc chappjc commented Nov 18, 2022

This resolves a couple minor bugs introduced in #1597

The feeConfs arg that was previously used for estimatefee was neglected when the FeeEstimator config item was replaced with a more sophisticated (*Backend).estimateFee method. This setting was important for DOGE and BCH where a value of 1 almost always returns an estimate of -1 (failure), resulting in one of the median fee estimates. In the case it was the "hard" way that is extremely demanding in terms of RPCs to the node, making a remote dogecoind instance virtually infeasible.

A second change is reducing the max blocks in the hard median fee estimator from 50 to 16, which is plenty because if it doesn't find 101 txns in 16 blocks it should just go with the "no competition" rate.

@@ -92,7 +92,8 @@ func NewBackend(configPath string, logger dex.Logger, network dex.Network) (asse
Net: network,
ChainParams: params,
Ports: ports,
DumbFeeEstimates: true,
DumbFeeEstimates: true, // dogecoind actually has estimatesmartfee though...
Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -49,7 +49,7 @@ const (
version = 0
BipID = 3
assetName = "doge"
feeConfs = 10
feeConfs = 8
Copy link
Member Author

@chappjc chappjc Nov 18, 2022

Choose a reason for hiding this comment

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

#1558 (comment)

The table I pasted there is still accurate even today, except for the high number at 3.

@@ -14,7 +14,7 @@ import (
"github.com/btcsuite/btcd/chaincfg"
)

var maxFeeBlocks = 50
Copy link
Member Author

Choose a reason for hiding this comment

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

In practice, it hung and context times out with a remote node. This just needs to make an quick effort and fall back to the "no competition" rate it can't get 101 txns in 16 blocks or less.

@chappjc chappjc merged commit 2c2dfee into decred:master Nov 23, 2022
@chappjc chappjc deleted the server-fee-confs-set branch November 23, 2022 01:19
@chappjc chappjc added this to the 0.5.7 milestone Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants