Closed chappjc closed 2 years ago
Pursuing a resolution to this issue and https://github.com/decred/dcrdex/issues/1717. Rough plan, subject to change as I feel out the issues more:
cacheRedemptionFeeSuggestion
perhaps should not hit the wallet's FeeRate
method since it is supposed to be caching the suggestion, not the wallet's own rate. This happens every epoch for every market for every order, and it is just too frequent. Alternatively, time stamp the cached fee, which also resolves a long-standing TODO to have the fee rate expire.(*Core).redeemMatchGroup
may call FeeRate
if t.redeemFeeSuggestion
is zero (no suggestion stored)Redeem
is the one method that should still get a rate internally with the configured redeem conf target.FeeRater
s with external API source fallback to cache that rate and put a limit on the frequency of external requestsPreRedeem
to only request a fee rate internally if the suggestion is 0. The caller should provide a feeRate like we do for the other wallet methods since https://github.com/decred/dcrdex/pull/1430feeRateMethod
https://github.com/decred/dcrdex/issues/1717#issuecomment-1188363018Resolution in https://github.com/decred/dcrdex/pull/1721
Resolved by https://github.com/decred/dcrdex/pull/1721
The
feeRate
method in the above come from:I don't recall why, but
cacheRedemptionFeeSuggestion
calls theFeeRate
method if the wallet is aFeeRater
. If the wallet is aFeeRater
, why doesCore
need to cache it's own suggestion? The issue seems to be inredeemMatchGroup
where it atomic loadst.redeemFeeSuggestion
but does not callFeeRate
at all. We understandably want to avoid requesting fee rates inredeemMatchGroup
, esp. if they are from remote sources, but we cannot callFeeRate
on the ticker like we are doing now.