You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FEE_VERSION2 reuses fee_version_number 1 and is missing from FEE_VERSIONS #4647
FEE_VERSION2 (packages/rs-platform-version/src/version/fee/v2.rs) declares fee_version_number: 1, the same number as FEE_VERSION1, and is absent from FEE_VERSIONS (fee/mod.rs). FeeVersion::get(1) therefore always returns FEE_VERSION1, even for epochs that ran on FEE_VERSION2 (protocol v9 and later).
Why it matters
Only the fee version number is persisted for previous epochs:
PlatformStateForSavingV1 stores previous_fee_versions as epoch index -> fee_version_number (aux storage, rehydrated on every restart).
Both round trips silently substitute FEE_VERSION1 for FEE_VERSION2. It is latent today only because the two schedules have identical storage fees, and previous_fee_versions is consulted solely to price storage refunds (rs-drive/src/fees/op.rs). The first FeeVersion that changes a storage or processing fee without taking a distinct number turns this into a consensus fork between nodes that restarted (or state-synced) and nodes that did not.
Fix
Give FEE_VERSION2 its own number (2) and add it to FEE_VERSIONS at index 1. That changes what a restarted or state-synced node computes for old epochs, so it is protocol-visible and needs a versioned migration rather than an in-place edit.
The #[ignore]d test fee_version_numbers_are_unique_and_resolvable in fee/mod.rs pins the defect; un-ignore it with the fix.
Rule going forward
Every FeeVersion constant needs a unique fee_version_number and an entry in FEE_VERSIONS at the index that number implies.
Activity