Skip to content

fix: widen remote-fee median to parent ledger and full validations only#1237

Draft
LeJamon wants to merge 1 commit into
mainfrom
fix/issue-1194-remote-fee-median
Draft

fix: widen remote-fee median to parent ledger and full validations only#1237
LeJamon wants to merge 1 commit into
mainfrom
fix/issue-1194-remote-fee-median

Conversation

@LeJamon

@LeJamon LeJamon commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • refreshRemoteFee now mirrors rippled's LedgerMaster/Validations::fees: the remote load-fee median is taken over the union of the validated ledger's and its parent ledger's trusted validations, and restricted to full validations only.
  • Previously it sampled the current ledger's hash alone and let trusted partial validations leak into the median, producing a smaller, differently-composed sample than rippled — diverging fee-escalation reporting (not ledger validity).
  • Extracted collectValidationFees helper; parent hash is resolved via GetLedgerByHash(ledgerID).ParentHash(), degrading gracefully to the current-ledger sample when the ledger isn't in history.

Test plan

  • go test ./internal/consensus/adaptor/... (full package green)
  • New TestRefreshRemoteFee_ExcludesPartialValidations — trusted partial dropped from the median
  • New TestRefreshRemoteFee_FoldsParentLedgerValidations — parent-ledger validations folded into the sample
  • Updated TestRefreshRemoteFee_MedianOverTrustedValidations for the full-only filter
  • go vet + golangci-lint run --config .golangci.yml clean

Fixes #1194

…ly (#1194)

refreshRemoteFee sampled only the validated ledger's trusted validations
and let trusted partials through, so the derived remote load fee drew
from a smaller, differently-composed set than rippled. Fold in the
parent ledger's validations and restrict to full validations to match
LedgerMaster::fees / Validations::fees.

Fixes #1194
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.

consensus: remote fee median omits parent-ledger validations and the full-only filter (rippled Validations::fees)

1 participant