Skip to content

docs(platform): note that fee version numbers must stay contiguous - #5765

Merged
QuantumExplorer merged 1 commit into
v5.1-devfrom
claude/fee-versions-contiguous-note
Nov 4, 2026
Merged

QuantumExplorer merged 1 commit into
v5.1-devfrom
claude/fee-versions-contiguous-note

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Basic explanation

What this does: Adds a comment to the list of fee versions (FEE_VERSIONS) saying its entries must be numbered 1, 2, 3, ... in order, because the code that finds a fee version by its number simply takes the entry at that position. It also says when a fee schedule needs a new number, and what else must change when storage prices change.

Value: Reviewers (people and bots) have flagged the position-based lookup as a bug; #4703 rewrote it, and was closed because the lookup is correct as long as the numbering stays contiguous. Writing the rule down next to the list stops it being flagged again and tells whoever adds the next fee version what to keep true.

Risks: None. Only comments change; no code, behaviour or consensus is touched.

Issue being fixed or feature implemented

FeeVersion::get and FeeVersion::get_optional return FEE_VERSIONS[n - 1] for fee version number n. That is the entry numbered n only while the registry is contiguous from 1, which nothing documented, so the lookup kept being reported as a bug. #4703 replaced it with a lookup by carried number; it was closed because the registry holds only FEE_VERSION1, so the rewrite changes nothing.

What was done?

packages/rs-platform-version/src/version/fee/mod.rs, comments only:

  • FEE_VERSIONS: entries are numbered contiguously from 1 (index i carries number i + 1), and get/get_optional rely on it, so a new entry is appended with the next number. A new number is needed only when a value the fee history serves changes (storage, processing, hashing or signature costs), because saved state keeps only the number and reloads the registered entry; that is why FEE_VERSION2 to FEE_VERSION4 carry 1 and are not listed. Registering different storage rates also needs refunds priced at the rate active when the bytes were stored, which calculate_fee generation 0 does not do; fix(platform): resolve fee versions by registered number and price refunds at the storage epoch rate #4703 has a version of that rule.
  • get and get_optional: one line each pointing at that rule.

How Has This Been Tested?

Comment-only change. cargo fmt --all, cargo clippy -p platform-version --all-targets --all-features -- --no-deps -D warnings and cargo test -p platform-version --all-features fee:: pass. cargo doc -p platform-version resolves the new intra-doc links (its only error is an existing broken link in dpp_validation_versions).

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • My Rust, FFI, WASM, Swift or Kotlin changes follow the coding conventions
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed
  • If I added or changed GroveDB structure, I described it in the area's structure.rs, regenerated grovedb-structure.json, and checked the structure viewer link posted on this pull request
  • If I added or changed a system contract's document schemas, I checked the contract viewer link posted on this pull request

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

PR Hygiene · e8c3e45

  • Bots — thepastaclaw not yet — /skip-bots proceeds without the ones not yet reported
  • Self-review — post /self-reviewed
  • Build running
  • Approvals — you own every area touched; none needed

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

FeeVersion::get and get_optional resolve a number by its position in
FEE_VERSIONS, which is correct only while the registry is numbered 1, 2,
3, ... in order. The registry doc now states that rule, when a schedule
needs a new number (a change to the storage, processing, hashing or
signature costs the fee history serves), and that new storage rates also
need refunds priced at the storage epoch's rate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added this to the v5.1.0 milestone Nov 4, 2026
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Nov 4, 2026
@QuantumExplorer
QuantumExplorer merged commit 232e21c into v5.1-dev Nov 4, 2026
15 of 16 checks passed
@QuantumExplorer
QuantumExplorer deleted the claude/fee-versions-contiguous-note branch November 4, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-bots Waiting for the review bots to report on this head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant