Skip to content

glightning: update FeeRates to match current CLN response schema#29

Open
Antisys wants to merge 1 commit intoElementsProject:masterfrom
Antisys:fix/feerates-response-schema
Open

glightning: update FeeRates to match current CLN response schema#29
Antisys wants to merge 1 commit intoElementsProject:masterfrom
Antisys:fix/feerates-response-schema

Conversation

@Antisys
Copy link
Copy Markdown

@Antisys Antisys commented Mar 31, 2026

Summary

The feerates RPC response changed in CLN v24.05+. The old urgent/normal/slow fields were removed and replaced by an estimates array. This caused FeeRateDetails.Urgent, .Normal, and .Slow to always return 0.

This PR updates the Go structs to match the current CLN schema:

  • Remove Urgent, Normal, Slow, DelayedToUs, HtlcResolution from FeeRateDetails
  • Add Floor, Estimates, UnilateralAnchorClose, Splice
  • Add FeeRateEstimateEntry struct for the estimates array
  • Add UnilateralCloseNonanchorSatoshis to OnchainEstimate
  • Update warning field name from warning to warning_missing_feerates
  • Update tests to use CLN v24.05+ response format

Breaking change: callers using .Details.Urgent, .Details.Normal, .Details.Slow must migrate to .Details.Estimates (indexed by blockcount).

Fixes #18.

Test plan

  • go test ./glightning/... passes
  • Test covers full perkb response with estimates array
  • Test covers perkw response with partial fields
  • Test covers missing feerates warning

The feerates RPC response changed in CLN v24.05+. The old
urgent/normal/slow fields were replaced by an estimates array
with blockcount/feerate/smoothed_feerate entries. New fields
were added (floor, unilateral_anchor_close, splice) and the
warning field was renamed to warning_missing_feerates.

Update FeeRateDetails to match the current schema and add
FeeRateEstimateEntry for the estimates array. Update
OnchainEstimate with the new nonanchor field.

Fixes ElementsProject#18.
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.

FeeRates returns Urgent: 0, Normal: 0, Slow: 0

1 participant