Skip to content

fees: the default estimate reads the mempool for 1-2 blocks and the chain history beyond (fee plan F8) - #1254

Merged
bkeroack merged 13 commits into
masterfrom
feature/fee-f8-default
Nov 16, 2026
Merged

bkeroack merged 13 commits into
masterfrom
feature/fee-f8-default

Conversation

@bkeroack

@bkeroack bkeroack commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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_rate in node/src/mempool/estimate.rs is now the default answer:

Where it applies:

  • estimatesmartfee with fee_rate_estimator=auto and Core's unset, economical or conservative, plus satd's blend mode.
  • blend is also the mode that estimatefees, Esplora /fee-estimates, Electrum blockchain.estimatefee, the MCP fee tool and the status page use. They now take near_rate and read the same economical numbers. A test checks this.
  • Electrum's -1 rule now keys on "nothing answered" (Confidence::Low), and is a small function with its own test.
  • historical mode now means the chain-history estimate. mempool mode is still the ungated simulator.

Unlike Core 32.1: Core's auto answers min(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: estimatesmartfee answers Core's Insufficient data error, Esplora leaves the target out and Electrum answers -1.

Conservative history at 97.5%. The history estimator's conservative quantile 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

2 blocks 6 blocks 24 blocks 144 blocks
this PR 67.0%, 1.02× 81.1%, 1.05× 95.3%, 1.13× 100%, 1.15×
Core's min form on satd's estimators 58.4%, 1.01× 81.1%, 1.05× 95.3%, 1.13× 100%, 1.15×
Core 32.1 auto 61.4%, 1.01× 78.2%, 1.03× 91.5%, 1.04× 100%, 1.15×

Conservative. 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:

2 blocks 6 blocks 24 blocks 144 blocks
this PR, history at 99% 98.7%, 4.66× 97.9%, 10.1× 97.8%, 1.81× 100%, 1.23×
this PR, history at 97.5% 96.1%, 4.07× 93.9%, 8.33× 97.8%, 1.30× 100%, 1.23×
Core's min form, history at 97.5% 76.2%, 1.07× 89.8%, 1.55× 97.3%, 1.23× 100%, 1.23×
Core 32.1 auto 72.1%, 1.04× 84.3%, 1.08× 92.2%, 1.04× 100%, 1.15×

Economical beats Core 32.1 at every target below 144 at about the same price, and this PR's form beats Core's min form 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):

history estimator 2 blocks 6 blocks 12 blocks 24 blocks 144 blocks
economical (95%) 94.8%, 3.23× 94.7%, 1.79× 93.9%, 1.35× 91.5%, 1.22× 90.2%, 1.06×
conservative at 99% 98.7%, 6.80× 98.6%, 4.06× 98.1%, 2.74× 96.9%, 1.35× 93.6%, 1.13×
conservative at 97.5% 97.6%, 4.38× 96.9%, 2.73× 95.7%, 1.68× 94.5%, 1.26× 91.8%, 1.06×

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:

  • the mempool side near, with history kept for conservative
  • history beyond 2 blocks
  • the floor for deep targets with no history
  • monotone, with conservative ≥ economical, across 1–1008 blocks and three pool states
  • every surface reads the default
  • an unhealthy, expensive queue leaves the answer on history
  • a mempool side below the floor gets floored on the surfaces
  • Electrum -1 only when nothing answers

The F3 test now expects auto to read the chain history.

Perturbation: I removed each of the 10 guards in default_rate, near_rate, history_rate, resolve_target, estimate_smart_fee and the Electrum rule in turn. Each time, a named test failed.

Local gates:

  • Workspace clippy is clean.
  • cargo test --workspace: everything passes except two groups that fail for local reasons, not from this change:
    • The address-index backfill tests refuse to run because /tmp is a 61 GB tmpfs. With TMPDIR on a larger disk, all 13 backfill tests and all 25 opreturn_strip tests pass.
    • One policy test failed under the full parallel run and passes on its own.

Docs

  • CHANGELOG
  • 0.8.0 notes: a Highlight, a new entry, and the earlier fee entries' "not yet the default" wording updated
  • Upgrade note: estimatefees blend no longer uses the simulator
  • Manual: a "The default estimate" section
  • CORE_DIFFERENCES.md: the auto departure

🤖 Generated with Claude Code

bkeroack and others added 13 commits November 11, 2026 14:27
…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>
@bkeroack
bkeroack merged commit 86644b6 into master Nov 16, 2026
45 checks passed
@bkeroack
bkeroack deleted the feature/fee-f8-default branch November 16, 2026 01:44
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.

1 participant