Repository navigation
fees: the default estimate reads the mempool for 1-2 blocks and the chain history beyond (fee plan F8) - #1254
Merged
Merged
Conversation
…hain history beyond (fee plan F8) estimatesmartfee under auto with Core's modes, and satd's blend mode on every surface (estimatefees, Esplora, Electrum, MCP, status page), now answer default_rate: Core 32's template percentile for 1-2 blocks while the mempool health gate passes, the chain-history estimate (#1250) for every other target and while the gate fails, held at or below the 2-block answer. Conservative never goes below the history answer at the same target. The old flat percentile stays only as the history fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…surfaces Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…as in Core, estimatefees reads the mempool side only in blend Devin round 1 on #1254: - estimate_mode=historical on estimatesmartfee answered the combined default; Core's modes now parse to Blend and historical is history_rate alone on every RPC. - near_rate returned None when the template did not reach its percentile, so a healthy quiet mempool fell back to history. Core's mempool estimator answers its floor there; near_rate now reads 0 and the floor sets it. - estimatefees computed near_rate in every mode; only blend reads it. - A broken sentence in the 0.8.0 notes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… analog answer Devin round 2 on #1254: while the store had windows for short targets but not a deep one, history_rate answered the deep target from the flat percentile, which could exceed the short targets' analog answer; the default's 2-block cap then put conservative below block_policy at the same target. history_rate now holds the fallback at or below the deepest shorter target's analog answer, so it is monotone on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Devin round 2 on #1254: Core's mode names parse to blend, and estimatefees "conservative" answered the economical default. smart_fees and resolve_target now take conservative; only estimatefees sets it, from the mode string, as estimatesmartfee does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The estimate floor is now the rolling mempool minimum or -minrelaytxfee (0.1 sat/vB by default), whichever is higher, as Core 32 floors estimatesmartfee. Mainnet blocks often confirm sub-1 sat/vB transactions, and in a quiet market the 1 sat/vB floor made every surface quote several times what those blocks took. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With -minrelaytxfee=0 the estimate floor can be 0, and an estimator answering 0 then reached the surfaces as a real feerate. Core's estimatesmartfee errors on a zero feerate; satd now answers Core's Insufficient data error, and the other surfaces read the target as Confidence::Low (Esplora leaves it out, Electrum answers -1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On mainnet, while some miners took transactions at about 0.12 sat/vB and others wanted 1 sat/vB, a 99% conservative estimate at 6 blocks covered 96.8% of samples at a median 10x the cheapest block's hurdle. At 97.5% it covers 91.0% at 5.5x (economical: 77.9% at 1.07x). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under a zero relay floor the economy rate, held between the floor and twice the floor, is 0: the same "no estimate" every target now reports as such. estimatefees and the MCP fee tool printed it as a literal 0. SmartFees carries it as an Option and both surfaces leave the field out when it is None. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its first call expects mempool_policy's no-block-data refusal, but the mempool load runs in the background at startup, and a slow runner got the "Mempool not loaded yet" refusal instead. Wait on getmempoolinfo.loaded first, as the mempool tests and Core's functional tests do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The default fee estimate now uses both new estimators. This is the last step of the 0.8.0 estimator rework (#1200, #1202, #1250).
What changes
default_rateinnode/src/mempool/estimate.rsis now the default answer:conservative).conservativenever answers below the history estimate at the same target, and so never beloweconomical.Insufficient data or no feerate found.Where it applies:
estimatesmartfeewithfee_rate_estimator=autoand Core'sunset,economicalorconservative, plus satd'sblendmode.blendis also the mode thatestimatefees, Esplora/fee-estimates, Electrumblockchain.estimatefee, the MCP fee tool and the status page use. They now takenear_rateand read the same economical numbers. A test checks this.-1rule now keys on "nothing answered" (Confidence::Low), and is a small function with its own test.historicalmode now means the chain-history estimate.mempoolmode is still the ungated simulator.Unlike Core 32.1: Core's
autoanswersmin(block_policy, mempool_policy)at every target, so its mempool side can only lower an estimate. Here the mempool side sets the 1–2 block answer, even when it is higher than history. The mainnet comparison below measured both forms; this PR keeps its own.Floor at the relay minimum. Estimates floor at
max(rolling mempool minimum, -minrelaytxfee), as Core does, instead of a fixed 1 sat/vB. With Core 32's default relay minimum of 0.1 sat/vB, a quiet mempool can now be quoted below 1 sat/vB. A floored estimate of 0 (-minrelaytxfee=0) is no estimate:estimatesmartfeeanswers Core'sInsufficient dataerror, Esplora leaves the target out and Electrum answers -1.Conservative history at 97.5%. The history estimator's
conservativequantile drops from 99% to 97.5%. At 99%, the comparison below showed a 10× median overpay at 6 blocks on mainnet, where some miners take about 0.12 sat/vB and others want about 1 sat/vB.Mainnet comparison against Core 32.1
A synced satd mainnet node on this branch ran beside a Core 32.1 node for about 3.5 days: 2,582 samples over blocks 975,482–975,987. Each sample asks both nodes for an estimate; a cell is the share of samples whose rate would have been included within the target (the block's weight-weighted 10th-percentile feerate at or above the relay minimum), then the median overpay against the cheapest rate that would have made it.
Economical
minform on satd's estimatorsautoConservative. The live node ran the history estimator at 99%; this PR's last commit lowers it to 97.5%. These rows replay the estimator at each quantile over the same samples, with a port of it that is within 2% of the live node on 98–99% of samples:
minform, history at 97.5%autoEconomical beats Core 32.1 at every target below 144 at about the same price, and this PR's form beats Core's
minform at 2 blocks for nothing. Conservative covers more than Core at every target, at a higher price, which is what conservative is for.97.5% over 30,000 blocks. The 3.5 days alone are thin for picking a quantile, so the history estimator alone was backtested over blocks 945,330–975,330 (834 estimates, one every 36 blocks; the same range as #1250's backtest):
97.5% gives up 1–2 points of coverage for about a third less overpay, and stays above economical at every target.
Tests
New tests:
conservative-1only when nothing answersThe F3 test now expects
autoto read the chain history.Perturbation: I removed each of the 10 guards in
default_rate,near_rate,history_rate,resolve_target,estimate_smart_feeand the Electrum rule in turn. Each time, a named test failed.Local gates:
cargo test --workspace: everything passes except two groups that fail for local reasons, not from this change:/tmpis a 61 GB tmpfs. WithTMPDIRon a larger disk, all 13 backfill tests and all 25opreturn_striptests pass.policytest failed under the full parallel run and passes on its own.Docs
estimatefeesblendno longer uses the simulatorCORE_DIFFERENCES.md: theautodeparture🤖 Generated with Claude Code