Skip to content

feat(validators): display base_fee in drops on Fee Voting table (#1206)#1318

Open
tmchow wants to merge 2 commits intoripple:mainfrom
tmchow:feat/1206-fee-voting-base-fee-drops
Open

feat(validators): display base_fee in drops on Fee Voting table (#1206)#1318
tmchow wants to merge 2 commits intoripple:mainfrom
tmchow:feat/1206-fee-voting-base-fee-drops

Conversation

@tmchow
Copy link
Copy Markdown

@tmchow tmchow commented Apr 23, 2026

High Level Overview of Change

Closes #1206.

Renders validator base_fee in drops on both the Validators Fee Voting table and the Validator detail page's voting tab (for example 10 drops instead of 0.00001 XRP). Reserve voting columns (reserve_base, reserve_inc) keep their XRP formatting because those values are large enough to read as XRP already.

Context of Change

The Fee Voting table's base_fee column goes through renderFeeVoting in src/containers/Network/ValidatorsTable.tsx, which converts the raw drops value to XRP and runs it through renderXRP. For reserve_base and reserve_inc that produces readable amounts (1.00, 0.20), but base_fee defaults to 10 drops and surfaces as 0.00001, which is harder to scan and disconnected from how validator operators actually talk about the reference fee.

The fix gates the XRP conversion on the column's className. When the cell renders the base_fee column, show the raw drops value with a translated drops suffix; otherwise, keep the existing XRP path untouched. The same rule is applied to the base_fee cell on VotingTab.tsx so the individual validator page stays consistent with the table.

I also added a drops string to public/locales/en-US/translations.json. Other locale bundles fall back to the English string via the project's existing fallbackLng: 'en-US' configuration until translators catch up.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates

Codebase Modernization

  • Yes, this PR modernizes the codebase.
  • No, this PR does not modernize the codebase.

Before / After

Before: the BASE FEE cell on the validators Fee Voting table and on the individual validator's voting tab rendered 0.00001 for a typical 10-drop reference fee, because the value was divided by DROPS_TO_XRP_FACTOR and formatted through renderXRP. Downward/upward vote indicators still rendered, but the magnitude was hard to read at a glance.

After: the same cells render 10 drops (or whatever drops value the validator is voting for). Vote direction indicators are unchanged. Reserve columns (base, owner) continue to use the XRP formatting because those values are large enough to read as XRP.

Test Plan

  • npx jest --env=jsdom --testPathPatterns='Validators|Voting' — 6 test suites, 21 tests passing.
  • validatorsTable.test.js now asserts '10 drops' for the td.base_fee cell (was '0.00001').
  • VotingTab.test.tsx now asserts '10 drops' for the first .metrics .cell (was '0.00001').
  • Manual review of the rendered output against the issue description (small BASE FEE values are easier to scan as integer drops).

Future Tasks

  • Add drops translations to the other locale bundles (ja-JP, ko-KR, es-ES, fr-FR, ca-CA, my-MM). Until then those locales fall back to the English string via the project's existing fallbackLng: 'en-US' configuration.

@tmchow tmchow force-pushed the feat/1206-fee-voting-base-fee-drops branch from a9e14bc to 68fedb7 Compare April 29, 2026 00:58
Base fee values are small (typically 10 drops) and displaying them as
XRP ("0.00001 XRP") made the number hard to read at a glance. Render
the base_fee column and the base_fee metric on VotingTab as drops
instead ("10 drops") while leaving reserve_base and reserve_inc on XRP,
where the values are large enough to remain readable. Adds a `drops`
string to the en-US translation bundle.

Closes ripple#1206
@tmchow tmchow force-pushed the feat/1206-fee-voting-base-fee-drops branch from 68fedb7 to 329378c Compare May 5, 2026 03:17
"missed_validations": "{{count}} missed validations",
"incomplete": "incomplete",
"base_fee": "Base Fee",
"drops": "drops",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the null keys in the other languages

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 2cf8686. Added "drops": null to ja-JP, ko-KR, es-ES, fr-FR, ca-CA, and my-MM right after each locale's base_fee key. They keep falling back to the en-US string via fallbackLng: 'en-US' until translations land.

Adds "drops": null to ja-JP, ko-KR, es-ES, fr-FR, ca-CA, and my-MM so
translators see an explicit slot for the key introduced in the en-US
bundle for the Fee Voting table. Each locale continues to fall back to
the English string via fallbackLng: 'en-US' until a translation lands.

Addresses review feedback on PR ripple#1318.
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.

Use drops for BASE FEE in Fee Voting table

2 participants