Skip to content

feat(platform): price storage refunds at the storing epoch's rate and drop the fee history map - #5798

Open
QuantumExplorer wants to merge 2 commits into
v5.1-devfrom
claude/drop-fee-history-map
Open

QuantumExplorer wants to merge 2 commits into
v5.1-devfrom
claude/drop-fee-history-map

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Basic explanation

What this does: when stored data is deleted, its owner gets part of the storage fee back. That refund should use the price the owner paid when the data was stored. Every stored item already records the epoch it was stored in, and Drive records each epoch's protocol version when the epoch starts. That version's fee schedule has the price. From protocol version 15, refunds look the price up that way. That makes the fee history map, which was passed through the whole fee code for this, unnecessary, so it is removed.

Value: refunds stay right if a future protocol version changes the storage price, and callers have nothing to pass in or forget. About 1,200 fewer lines. The map argument is gone from 45 functions and about 860 calls, and Drive::calculate_fee becomes a Drive method without its epochs_per_era argument. The saved map also no longer feeds block execution, so it cannot make nodes disagree (#4647).

Risks: Low.

  • Fees: no fee or refund changes at any protocol version, because every fee schedule has the same storage price. A new test checks this at every version.
  • A new read: from protocol version 15, pricing a refund reads one small record per storing epoch, and a missing record would be an error that stops the block. Every epoch that stored data had a block, and that block wrote the record. A live check found the record on every mainnet epoch and on every testnet epoch that had blocks (see below).
  • Merge conflicts: about 340 files change, so open PRs that call these functions will conflict. See "Open PRs affected".

Issue being fixed or feature implemented

A refund returns the part of an owner's storage fee that has not yet been paid out to epochs. That fee was charged at the storage rate of the epoch that stored the bytes, so the refund has to use that rate.

The code passed previous_fee_versions, a map from epoch to fee schedule kept in platform state, through Drive::calculate_fee and everything above it, 45 functions in all. The refund code then ignored it for fee_version_number 1, which every shipped schedule has, and priced against an empty map. Even its other branch looked up the removing epoch, not the storing one. The numbers were only right because the storage rate (27,000 credits per byte) never changed.

Drive already has what it needs. The storage flags give the storing epoch, and the first block of every epoch records the epoch's protocol version in the epoch's tree (KEY_PROTOCOL_VERSION, read by Drive::get_epoch_protocol_version, which fee distribution already uses). That version's fee schedule has the rate.

What was done?

Refunds at the storing epoch's rate (protocol version 15)

  • Drive::calculate_fee 1 (calculate_fee/v1, selected by DRIVE_VERSION_V10, protocol v15 note 25) prices each refund at the storage rate of the protocol version that ran the epoch that stored the bytes. It reads the version with get_epoch_protocol_version and takes the rate from PlatformVersion::get(version).fee_version.
  • Bytes stored in the block's own epoch use the block's rate. That epoch's version is the block's, and it is only recorded at the end of the epoch's first block.
  • An earlier epoch's record was committed before the block started, so it is read without a transaction.
  • LowLevelDriveOperation::consume_to_fees_v1 wraps generation 0 instead of copying it. Each sectioned removal reaches generation 0 as a basic removal of as many bytes, so processing and storage fees are computed exactly as before, and the refund and the system's removed bytes are then set from the lookup.
  • FeeRefunds::from_storage_removal takes the rate of each storing epoch from a closure instead of a schedule.

Example: 1,000 bytes stored in epoch 12, removed in epoch 15, at protocol version 15, if epoch 12 had run a schedule at twice today's rate.

Before:

// every refund at the removing block's rate
FeeRefunds::from_storage_removal(removal, epoch.index, epochs_per_era, &BTreeMap::default())? // first schedule: 27,000 per byte

After:

// each storing epoch at its own rate: epoch 12 at 54,000 per byte, epoch 15 at the block's rate
LowLevelDriveOperation::consume_to_fees_v1(ops, epoch, epochs_per_era, fee_version, |storing_epoch| {
    self.storage_rate_of_epoch(storing_epoch, epoch, platform_version)
})?

Today every epoch ran a schedule at 27,000 per byte, so both give the same refund.

Generation 0 keeps its numbers

consume_to_fees_v0 prices every refund at the block's rate, through the new closure argument. It used to price against the first schedule; for every protocol version that selects it (up to 14) the two rates are equal. See "In-place changes to shipped generations".

The map is gone

The parameter is removed from Drive::calculate_fee, apply_drive_operations, update_contract, the document, identity and token balance methods that forwarded it, and from execute_event, validate_fees_of_event and process_validation_result in drive-abci. check_tx, process_raw_state_transitions, process_block_fees_and_validate_sum_trees and update_masternode_identities stop reading it. dpp::fee::default_costs::{KnownCostItem, EpochCosts} only read through the map and are removed.

Platform state still records the map at each protocol upgrade and saves it in the same format, so saved states load as before. Nothing in block execution reads it.

calculate_fee is a Drive method

It reads state now, so it takes &self, and it no longer takes epochs_per_era, which every one of its 171 callers passed as that same Drive's config.epochs_per_era.

Before:

Drive::calculate_fee(None, Some(cost_operations), &block_info.epoch, self.config.epochs_per_era, platform_version, previous_fee_versions)

After:

self.calculate_fee(None, Some(cost_operations), &block_info.epoch, platform_version)

A test-only protocol version

TEST_PLATFORM_V4 (mocks/v4_test.rs, mock-versions only) is protocol version 15 with twice its storage rate, so a test can tell which epoch's schedule priced a refund. No network runs it.

Book

  • fees/overview.md and contributing/coding-conventions.md state the new refund rule.
  • drive/cost-tracking.md describes generation 1.
  • The calculate_fee samples in drive/batch-operations.md, drive/finalize-tasks.md, state-transitions/drive-operations.md, versioning/versioned-dispatch.md and data-model/key-limits.md follow the new signature.
  • The conventions chapter no longer lists the map as the exception to "platform_version is the last parameter".

Live network check

Each epoch's record was read with getEpochsInfo, which only returns an epoch that holds its whole record. An epoch's first block writes that record (start height, start time, fee multiplier and protocol version) in one batch.

  • Mainnet, two evonodes at height 466,915: all 88 epochs (0 to 87) have a record, with no gaps. Their versions are 1 to 13, all known to this binary.
  • Testnet, current epoch 20,191: 17,793 epochs have a record, with versions 1 to 14. The other 2,399 fall in 11 spans (the longest are 1 to 894 and 7,553 to 8,591), when the chain made no blocks. A block in one of them would have written its record.

Open PRs affected

  • #4706: its required-history rule, calculate_fee v1 and the price-before-commit generations no longer have a purpose. It also adds a calculate_fee 1. Its recorded-owner refund credits are unaffected but will conflict.
  • #4704: it records the genesis fee generation in the map and adds its own mocks/v4_test.rs. With nothing reading the map, its tests no longer exercise it, and it conflicts with this PR's mock.
  • #4648: saves the map in its reduced state. That still works, but no block execution reads the result.
  • #5736: only mechanical conflicts.

How Has This Been Tested?

New tests:

  • rs-drive, fees/calculate_fee:
    • should_price_a_refund_at_the_storage_rate_of_the_epoch_that_stored_the_bytes records epoch 12 at the doubled-rate mock and epoch 14 at the latest version. It removes bytes stored in 12, 14 and 15 at epoch 15. At protocol version 15 epoch 12 refunds at the doubled rate and 14 and 15 at the normal rate; at protocol version 14 all three use the normal rate.
    • should_price_a_refund_the_same_at_every_protocol_version runs a removal through the dispatcher at every entry of PLATFORM_VERSIONS and compares it with the first schedule's amount.
    • should_not_price_a_refund_from_an_epoch_that_recorded_no_protocol_version: protocol version 15 refuses to price bytes from an epoch with no record, and protocol version 14 still prices them.
  • rs-dpp, fee_result/refunds.rs: should_price_each_storing_epoch_at_its_own_storage_rate gives two storing epochs different rates.

Local checks, all passing:

  • cargo fmt --all, cargo clippy -p platform-version -p dpp -p drive -p drive-abci --all-targets -- -D warnings, cargo check --workspace --all-targets and cargo check -p drive --no-default-features --features verify.
  • Targeted tests:
    • platform-version with mock-versions: 30 tests.
    • dpp fee: 71 tests.
    • drive: fees, documents, contracts, identities, tokens, groups and batches, 1,655 tests.
    • The drive query test binaries (query_tests, query_tests_history): 63 tests.
    • drive-abci: block end events and refund clawbacks, fee validation, event execution, fee pools, masternode identity updates, shielded identity creation and protocol upgrade, 159 tests.

The strategy tests were only compiled locally, so CI is their first run.

In-place changes to shipped generations

Except for calculate_fee 1 and consume_to_fees_v1, which only protocol version 15 selects, every edit is in place and none changes an output:

Generation Selected by Why consensus cannot change
LowLevelDriveOperation::consume_to_fees_v0, Drive::calculate_fee_v0, and FeeRefunds::from_storage_removal (unversioned) protocol versions up to 14 They used to price a refund at FeeVersion::first()'s rate because every shipped schedule has number 1. Now they use the block schedule's rate through the closure. All schedules use FEE_STORAGE_VERSION1, so it is the same number. The else branch and its CorruptedCodeExecution needed a number other than 1, so they were unreachable.
The Drive::calculate_fee dispatcher every protocol version Generation 0 now gets self.config.epochs_per_era, which is what every caller passed.
apply_drive_operations v0, v1, v2; update_contract v0, v1, v2 the protocol versions that select each Only the parameter they forwarded is removed.
v0 of add_document_for_contract, update_document_for_contract, update_document_for_contract_id, update_document_with_serialization_for_contract, delete_document_for_contract, delete_document_for_contract_id, delete_index_only_document_for_contract, remove_from_identity_balance, update_identity_revision, remove_from_identity_token_balance, add_to_identity_token_balance the protocol versions that select each Only the parameter they forwarded is removed.
execute_event v0, v1; validate_fees_of_event v0, v1; process_validation_result v0, v1; update_masternode_identities v0, v1; process_block_fees_and_validate_sum_trees v0; process_raw_state_transitions v0; check_tx v0 the protocol versions that select each They stop reading the map from platform state and stop forwarding it. Nothing they do depends on it.

Every other edited generation only changes how it calls calculate_fee.

from_storage_removal also loses Epoch::new(current_epoch_index)?. That can only fail above MAX_EPOCH (65,279), and the index it receives comes from an existing Epoch.

Breaking Changes

None for the protocol: no fee or refund changes at any protocol version, and saved platform state is unchanged. Rust API only: the signatures above change, Drive::calculate_fee becomes a method, and dpp::fee::default_costs::{KnownCostItem, EpochCosts} are removed. No other crate in this workspace uses them.

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 · f61087d

  • Bots — thepastaclaw requested changes — dismiss the review or push a fix
  • Self-review — post /self-reviewed
  • Build failed
  • 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.

…le and drop the fee history from Drive

Drive::calculate_fee and everything above it took previous_fee_versions, a
map from epoch to fee schedule. Its only reader was the refund branch of
consume_to_fees_v0, which ignored it for fee_version_number 1, the number
of every shipped schedule. Every shipped schedule also has the same storage
rate, so no block on any network reads the map.

FeeRefunds::from_storage_removal now takes the block's FeeVersion and the
parameter is gone from 45 functions and about 860 calls, along with
KnownCostItem and EpochCosts, which only read through the map. Platform
state still records and saves the map in the same format.

No fee or refund changes at any protocol version.
should_price_a_refund_the_same_at_every_protocol_version checks that, and
should_keep_one_storage_rate_on_every_protocol_version fails on a schedule
that changes the rate, since refunds would then need the rate of the epoch
that stored the bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added this to the v5.1.0 milestone Nov 7, 2026
@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 343 files, which is 243 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

Usage-priced reviews support at most 300 files.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between f73f1b6 and f61087d.

Files selected for processing: 343

  • book/src/contributing/coding-conventions.md
  • book/src/data-model/key-limits.md
  • book/src/drive/batch-operations.md
  • book/src/drive/cost-tracking.md
  • book/src/drive/finalize-tasks.md
  • book/src/fees/overview.md
  • book/src/state-transitions/drive-operations.md
  • book/src/versioning/versioned-dispatch.md
  • packages/rs-dpp/src/fee/default_costs/mod.rs
  • packages/rs-dpp/src/fee/fee_result/refunds.rs
  • packages/rs-drive-abci/src/abci/handler/finalize_block.rs
  • packages/rs-drive-abci/src/execution/check_tx/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/block_processing_end_events/add_process_epoch_change_operations/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/block_processing_end_events/process_block_fees_and_validate_sum_trees/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/block_processing_end_events/tests.rs
  • packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/update_masternode_identities/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/update_masternode_identities/v1/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/update_masternode_identities/v1/payout_tests.rs
  • packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/update_operator_identity/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/update_owner_withdrawal_address/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/fee_pool_inwards_distribution/add_distribute_block_fees_into_pools_operations/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/fee_pool_inwards_distribution/add_distribute_block_fees_into_pools_operations/v1/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/fee_pool_inwards_distribution/add_distribute_storage_fee_to_epochs_operations/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/fee_pool_inwards_distribution/add_distribute_storage_fee_to_epochs_operations/v1/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/fee_pool_outwards_distribution/add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/fee_pool_outwards_distribution/add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations/v1/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/fee_pool_outwards_distribution/add_epoch_pool_to_proposers_payout_operations/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/fee_pool_outwards_distribution/add_epoch_pool_to_proposers_payout_operations/v1/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/addresses.rs
  • packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/v1/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/token_history_storage_flags_tests.rs
  • packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/state_transition_processing/execute_event/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/state_transition_processing/execute_event/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/state_transition_processing/execute_event/v1/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/state_transition_processing/process_raw_state_transitions/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/state_transition_processing/process_validation_result/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/state_transition_processing/process_validation_result/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/state_transition_processing/process_validation_result/v1/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/state_transition_processing/validate_fees_of_event/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/state_transition_processing/validate_fees_of_event/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/state_transition_processing/validate_fees_of_event/v1/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/voting/award_document_to_winner/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/withdrawals/calculate_core_anchored_withdrawal_limit/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/withdrawals/dequeue_and_build_unsigned_withdrawal_transactions/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/withdrawals/has_pending_withdrawal_work/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/withdrawals/pool_withdrawals_into_transactions_queue/v1/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/withdrawals/rebroadcast_expired_withdrawal_documents/v1/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/withdrawals/rebroadcast_expired_withdrawal_documents/v2/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/withdrawals/update_broadcasted_withdrawal_statuses/v0/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/common/asset_lock/proof/verify_is_not_spent/v0/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/document/document_create_transition_action/state_v1/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/document/document_index_only_delete_transition_action/state_v0/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_shielded_pool_common/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/data_triggers/triggers/withdrawals/v0/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/data_triggers/triggers/withdrawals/v2/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/state/v0/fetch_contender.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/action_fees.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/commit_reveal_lookup.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/derived_index_values.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/dpns_v3.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/duplicate_keys.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/gas_sponsorship.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/long_string_sizing.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/token_market_orders.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/shielded/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/shielded/nullifier_batch_guard.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/transformer/v0/property_constraint_aggregates.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/contract_fee_claim/tests.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/contract_user_moderation/tests/seated_team.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/contract_user_moderation/tests/seated_team/settled.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_create_from_shielded_pool/tests.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_credit_transfer_to_addresses/tests.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/shield_from_asset_lock/tests.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/shield_from_identity/tests.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/shield_from_identity/transform_into_action/v0/mod.rs
  • packages/rs-drive-abci/src/platform_types/platform_state/mod.rs
  • packages/rs-drive-abci/src/query/address_funds/address_info/v0/mod.rs
  • packages/rs-drive-abci/src/query/address_funds/addresses_branch_state/v0/mod.rs
  • packages/rs-drive-abci/src/query/address_funds/addresses_infos/v0/mod.rs
  • packages/rs-drive-abci/src/query/contract_moderation_queries/contract_document_removals/v0/mod.rs
  • packages/rs-drive-abci/src/query/contract_moderation_queries/contract_fee_pots/v0/mod.rs
  • packages/rs-drive-abci/src/query/contract_moderation_queries/contract_moderation_action_counts/v0/mod.rs
  • packages/rs-drive-abci/src/query/contract_moderation_queries/mod.rs
  • packages/rs-drive-abci/src/query/document_history/v0/mod.rs
  • packages/rs-drive-abci/src/query/document_query/v1/dispatch/chained.rs
  • packages/rs-drive-abci/src/query/document_query/v1/tests.rs
  • packages/rs-drive-abci/src/query/mod.rs
  • packages/rs-drive-abci/src/test/helpers/fast_forward_to_block.rs
  • packages/rs-drive-abci/src/test/helpers/fee_pools.rs
  • packages/rs-drive-abci/tests/document_outcome.rs
  • packages/rs-drive-abci/tests/document_query_signature.rs
  • packages/rs-drive-abci/tests/older_node_answers.rs
  • packages/rs-drive-abci/tests/query_request_errors/composite_caps.rs
  • packages/rs-drive-abci/tests/query_request_errors/document_features.rs
  • packages/rs-drive-abci/tests/query_request_errors/offset_controls.rs
  • packages/rs-drive-abci/tests/strategy_tests/test_cases/vote_extension_round_tests.rs
  • packages/rs-drive/benches/document_average_worst_case.rs
  • packages/rs-drive/benches/document_count_worst_case.rs
  • packages/rs-drive/benches/document_sum_worst_case.rs
  • packages/rs-drive/src/drive/address_funds/prove/prove_address_funds_trunk_query/v0/mod.rs
  • packages/rs-drive/src/drive/address_funds/prove/prove_balance_and_nonce/v0/mod.rs
  • packages/rs-drive/src/drive/address_funds/prove/prove_balances_with_nonces/v0/mod.rs
  • packages/rs-drive/src/drive/contract/apply/apply_contract_with_serialization/v0/mod.rs
  • packages/rs-drive/src/drive/contract/apply/apply_contract_with_serialization/v1/mod.rs
  • packages/rs-drive/src/drive/contract/fee_pots/fetch_action_fee_multiplier/v0/mod.rs
  • packages/rs-drive/src/drive/contract/fee_pots/fetch_contract_fee_pot/mod.rs
  • packages/rs-drive/src/drive/contract/fee_pots/tests.rs
  • packages/rs-drive/src/drive/contract/get_fetch/fetch_contract/v0/mod.rs
  • packages/rs-drive/src/drive/contract/get_fetch/get_contract_with_fetch_info/mod.rs
  • packages/rs-drive/src/drive/contract/get_fetch/get_contract_with_fetch_info/v0/mod.rs
  • packages/rs-drive/src/drive/contract/insert/add_contract_to_storage/v1/mod.rs
  • packages/rs-drive/src/drive/contract/insert/add_description/v0/mod.rs
  • packages/rs-drive/src/drive/contract/insert/add_new_keywords/v0/mod.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v0/mod.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v0/tests/batched_group_drain.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v0/tests/chained_query_e2e_tests.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v0/tests/composite_query_e2e_tests.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v0/tests/countable_e2e_tests.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v0/tests/index_only_array_index_e2e_tests.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v0/tests/index_only_e2e_tests.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v0/tests/index_only_scalar_terminal_e2e_tests.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v0/tests/noncounted_sibling_e2e_tests.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v0/tests/preallocated_index_e2e_tests.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v0/tests/prefix_ranked_index_e2e_tests.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v0/tests/range_countable_index_e2e_tests.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v0/tests/ranked_index_e2e_tests.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v0/tests/shared_prefix_aggregation_e2e_tests.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v0/tests/skip_if_absent_e2e_tests.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v0/tests/summable_off_count_index_e2e_tests.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v0/tests/typed_array_counter_index_e2e_tests.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v1/mod.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v2/mod.rs
  • packages/rs-drive/src/drive/contract/migration/rekey_unsigned_integer_index_values.rs
  • packages/rs-drive/src/drive/contract/mod.rs
  • packages/rs-drive/src/drive/contract/moderation/action_count_tests.rs
  • packages/rs-drive/src/drive/contract/moderation/add_contract_ban/v0/mod.rs
  • packages/rs-drive/src/drive/contract/moderation/add_contract_suspension/v0/mod.rs
  • packages/rs-drive/src/drive/contract/moderation/add_contract_warning/v0/mod.rs
  • packages/rs-drive/src/drive/contract/moderation/document_removal_tests.rs
  • packages/rs-drive/src/drive/contract/moderation/fetch_contract_document_removals/mod.rs
  • packages/rs-drive/src/drive/contract/moderation/fetch_contract_moderation_action_counts/mod.rs
  • packages/rs-drive/src/drive/contract/moderation/fetch_contract_moderation_status/mod.rs
  • packages/rs-drive/src/drive/contract/moderation/fetch_contract_team_action/mod.rs
  • packages/rs-drive/src/drive/contract/moderation/fetch_contract_team_action_signers/mod.rs
  • packages/rs-drive/src/drive/contract/moderation/remove_contract_ban/v0/mod.rs
  • packages/rs-drive/src/drive/contract/moderation/remove_contract_suspension/v0/mod.rs
  • packages/rs-drive/src/drive/contract/moderation/remove_contract_warnings/v0/mod.rs
  • packages/rs-drive/src/drive/contract/moderation/team_action_tests.rs
  • packages/rs-drive/src/drive/contract/moderation/tests.rs
  • packages/rs-drive/src/drive/contract/update/update_contract/mod.rs
  • packages/rs-drive/src/drive/contract/update/update_contract/v0/mod.rs
  • packages/rs-drive/src/drive/contract/update/update_contract/v1/mod.rs
  • packages/rs-drive/src/drive/contract/update/update_contract/v2/mod.rs
  • packages/rs-drive/src/drive/contract/update/update_description/v0/mod.rs
  • packages/rs-drive/src/drive/contract/update/update_keywords/v0/mod.rs
  • packages/rs-drive/src/drive/contract_groups/fetch/fetch_contract_group_info/v0/mod.rs
  • packages/rs-drive/src/drive/contract_groups/fetch/fetch_contract_group_memberships_for_contract/v0/mod.rs
  • packages/rs-drive/src/drive/contract_groups/insert/insert_contract_group/v0/mod.rs
  • packages/rs-drive/src/drive/contract_groups/insert/insert_contract_group_memberships/v0/mod.rs
  • packages/rs-drive/src/drive/credit_pools/pending_epoch_refunds/methods/add_delete_pending_epoch_refunds_except_specified/v0/mod.rs
  • packages/rs-drive/src/drive/credit_pools/pending_epoch_refunds/methods/fetch_and_add_pending_epoch_refunds_to_collection/v0/mod.rs
  • packages/rs-drive/src/drive/document/cost/tests.rs
  • packages/rs-drive/src/drive/document/delete/delete_document_for_contract/mod.rs
  • packages/rs-drive/src/drive/document/delete/delete_document_for_contract/v0/mod.rs
  • packages/rs-drive/src/drive/document/delete/delete_document_for_contract_id/mod.rs
  • packages/rs-drive/src/drive/document/delete/delete_document_for_contract_id/v0/mod.rs
  • packages/rs-drive/src/drive/document/delete/delete_document_for_contract_operations/mod.rs
  • packages/rs-drive/src/drive/document/delete/delete_index_only_document_for_contract_operations/mod.rs
  • packages/rs-drive/src/drive/document/delete/delete_index_only_document_for_contract_operations/v0/mod.rs
  • packages/rs-drive/src/drive/document/delete/mod.rs
  • packages/rs-drive/src/drive/document/derived_index_values.rs
  • packages/rs-drive/src/drive/document/expiration/expiration_tests.rs
  • packages/rs-drive/src/drive/document/get_fetch/fetch_document_history/mod.rs
  • packages/rs-drive/src/drive/document/index_uniqueness/internal/validate_uniqueness_of_data/v2/mod.rs
  • packages/rs-drive/src/drive/document/index_uniqueness/mod.rs
  • packages/rs-drive/src/drive/document/insert/add_document/v0/mod.rs
  • packages/rs-drive/src/drive/document/insert/add_document_for_contract/aggregating_index_fee_estimate_tests.rs
  • packages/rs-drive/src/drive/document/insert/add_document_for_contract/array_index_e2e_tests.rs
  • packages/rs-drive/src/drive/document/insert/add_document_for_contract/integer_range_index_e2e_tests.rs
  • packages/rs-drive/src/drive/document/insert/add_document_for_contract/mod.rs
  • packages/rs-drive/src/drive/document/insert/add_document_for_contract/time_range_index_e2e_tests.rs
  • packages/rs-drive/src/drive/document/insert/add_document_for_contract/v0/mod.rs
  • packages/rs-drive/src/drive/document/insert/add_document_to_primary_storage/v0/mod.rs
  • packages/rs-drive/src/drive/document/insert/mod.rs
  • packages/rs-drive/src/drive/document/insert_contested/add_contested_document/v0/mod.rs
  • packages/rs-drive/src/drive/document/insert_contested/add_contested_document_for_contract/v0/mod.rs
  • packages/rs-drive/src/drive/document/insert_contested/mod.rs
  • packages/rs-drive/src/drive/document/query/mod.rs
  • packages/rs-drive/src/drive/document/query/query_chained_documents/v0/mod.rs
  • packages/rs-drive/src/drive/document/query/query_composite_documents/v0/mod.rs
  • packages/rs-drive/src/drive/document/query/query_contested_documents_storage/v0/mod.rs
  • packages/rs-drive/src/drive/document/query/query_contested_documents_vote_state/v0/mod.rs
  • packages/rs-drive/src/drive/document/query/query_documents/v0/mod.rs
  • packages/rs-drive/src/drive/document/query/query_documents_with_flags/v0/mod.rs
  • packages/rs-drive/src/drive/document/update/mod.rs
  • packages/rs-drive/src/drive/document/update/update_document_for_contract/mod.rs
  • packages/rs-drive/src/drive/document/update/update_document_for_contract/v0/mod.rs
  • packages/rs-drive/src/drive/document/update/update_document_for_contract_id/mod.rs
  • packages/rs-drive/src/drive/document/update/update_document_for_contract_id/v0/mod.rs
  • packages/rs-drive/src/drive/document/update/update_document_with_serialization_for_contract/mod.rs
  • packages/rs-drive/src/drive/document/update/update_document_with_serialization_for_contract/v0/mod.rs
  • packages/rs-drive/src/drive/group/fetch/fetch_action_id_has_signer/v0/mod.rs
  • packages/rs-drive/src/drive/group/insert/add_group_action/v0/mod.rs
  • packages/rs-drive/src/drive/group/insert/add_new_groups/v0/mod.rs
  • packages/rs-drive/src/drive/identity/balance/update.rs
  • packages/rs-drive/src/drive/identity/contract_info/identity_contract_nonce/fetch_identity_contract_nonce/v0/mod.rs
  • packages/rs-drive/src/drive/identity/fetch/balance/fetch_identity_balance/v0/mod.rs
  • packages/rs-drive/src/drive/identity/fetch/balance/fetch_identity_balance_include_debt/v0/mod.rs
  • packages/rs-drive/src/drive/identity/fetch/full_identity/fetch_full_identity/v0/mod.rs
  • packages/rs-drive/src/drive/identity/fetch/nonce/fetch_identity_nonce/v0/mod.rs
  • packages/rs-drive/src/drive/identity/fetch/revision/fetch_identity_revision/v0/mod.rs
  • packages/rs-drive/src/drive/identity/fetch/revision/mod.rs
  • packages/rs-drive/src/drive/identity/insert/add_new_identity/v0/mod.rs
  • packages/rs-drive/src/drive/identity/key/budget/mod.rs
  • packages/rs-drive/src/drive/identity/key/fetch/fetch_identity_keys/v0/mod.rs
  • packages/rs-drive/src/drive/identity/update/methods/add_new_non_unique_keys_to_identity/v0/mod.rs
  • packages/rs-drive/src/drive/identity/update/methods/add_new_unique_keys_to_identity/v0/mod.rs
  • packages/rs-drive/src/drive/identity/update/methods/add_to_identity_balance/v0/mod.rs
  • packages/rs-drive/src/drive/identity/update/methods/add_to_identity_balance/v1/mod.rs
  • packages/rs-drive/src/drive/identity/update/methods/disable_identity_keys/v0/mod.rs
  • packages/rs-drive/src/drive/identity/update/methods/disable_identity_keys/v1/mod.rs
  • packages/rs-drive/src/drive/identity/update/methods/merge_identity_nonce/v0/mod.rs
  • packages/rs-drive/src/drive/identity/update/methods/remove_from_identity_balance/mod.rs
  • packages/rs-drive/src/drive/identity/update/methods/remove_from_identity_balance/v0/mod.rs
  • packages/rs-drive/src/drive/identity/update/methods/update_identity_key_limits/v0/mod.rs
  • packages/rs-drive/src/drive/identity/update/methods/update_identity_revision/mod.rs
  • packages/rs-drive/src/drive/identity/update/methods/update_identity_revision/v0/mod.rs
  • packages/rs-drive/src/drive/identity/update/mod.rs
  • packages/rs-drive/src/drive/identity/withdrawals/calculate_current_withdrawal_limit/v1/mod.rs
  • packages/rs-drive/src/drive/identity/withdrawals/fetch_in_flight_withdrawal_amount/v0/mod.rs
  • packages/rs-drive/src/drive/identity/withdrawals/transaction/index/mod.rs
  • packages/rs-drive/src/drive/identity/withdrawals/transaction/queue/mod.rs
  • packages/rs-drive/src/drive/prefunded_specialized_balances/fetch/single_balance/v0/mod.rs
  • packages/rs-drive/src/drive/tokens/apply_status/v0/mod.rs
  • packages/rs-drive/src/drive/tokens/balance/add_to_previous_token_balance/mod.rs
  • packages/rs-drive/src/drive/tokens/balance/add_to_previous_token_balance/v0/mod.rs
  • packages/rs-drive/src/drive/tokens/balance/fetch_identities_token_balances/mod.rs
  • packages/rs-drive/src/drive/tokens/balance/fetch_identities_token_balances/v0/mod.rs
  • packages/rs-drive/src/drive/tokens/balance/fetch_identity_token_balance/mod.rs
  • packages/rs-drive/src/drive/tokens/balance/fetch_identity_token_balance/v0/mod.rs
  • packages/rs-drive/src/drive/tokens/balance/fetch_identity_token_balances/mod.rs
  • packages/rs-drive/src/drive/tokens/balance/fetch_identity_token_balances/v0/mod.rs
  • packages/rs-drive/src/drive/tokens/balance/prove_identities_token_balances/mod.rs
  • packages/rs-drive/src/drive/tokens/balance/prove_identity_token_balances/mod.rs
  • packages/rs-drive/src/drive/tokens/balance/remove_from_identity_token_balance/mod.rs
  • packages/rs-drive/src/drive/tokens/balance/remove_from_identity_token_balance/v0/mod.rs
  • packages/rs-drive/src/drive/tokens/balance/update.rs
  • packages/rs-drive/src/drive/tokens/burn/v0/mod.rs
  • packages/rs-drive/src/drive/tokens/contract_info/fetch_token_contract_info/mod.rs
  • packages/rs-drive/src/drive/tokens/direct_purchase/fetch_token_direct_purchase_price/mod.rs
  • packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/mod.rs
  • packages/rs-drive/src/drive/tokens/distribution/add_pre_programmed_distribution/v1/mod.rs
  • packages/rs-drive/src/drive/tokens/freeze/v0/mod.rs
  • packages/rs-drive/src/drive/tokens/info/fetch_identities_token_infos/mod.rs
  • packages/rs-drive/src/drive/tokens/info/fetch_identity_token_info/mod.rs
  • packages/rs-drive/src/drive/tokens/info/fetch_identity_token_infos/mod.rs
  • packages/rs-drive/src/drive/tokens/info/prove_identities_token_infos/mod.rs
  • packages/rs-drive/src/drive/tokens/info/prove_identity_token_infos/mod.rs
  • packages/rs-drive/src/drive/tokens/mint/v0/mod.rs
  • packages/rs-drive/src/drive/tokens/mint_many/v0/mod.rs
  • packages/rs-drive/src/drive/tokens/order_escrow/mod.rs
  • packages/rs-drive/src/drive/tokens/shielded_pool/mod.rs
  • packages/rs-drive/src/drive/tokens/status/fetch_token_status/mod.rs
  • packages/rs-drive/src/drive/tokens/status/fetch_token_statuses/mod.rs
  • packages/rs-drive/src/drive/tokens/status/prove_token_statuses/mod.rs
  • packages/rs-drive/src/drive/tokens/system/add_to_token_total_supply/v0/mod.rs
  • packages/rs-drive/src/drive/tokens/system/create_token_trees/v0/mod.rs
  • packages/rs-drive/src/drive/tokens/system/fetch_token_total_aggregated_identity_balances/v0/mod.rs
  • packages/rs-drive/src/drive/tokens/system/fetch_token_total_supply/v0/mod.rs
  • packages/rs-drive/src/drive/tokens/system/prove_token_total_supply_and_aggregated_identity_balances/v0/mod.rs
  • packages/rs-drive/src/drive/tokens/system/remove_from_token_total_supply/v0/mod.rs
  • packages/rs-drive/src/drive/tokens/transfer/v0/mod.rs
  • packages/rs-drive/src/drive/tokens/unfreeze/v0/mod.rs
  • packages/rs-drive/src/drive/votes/fetch/fetch_contested_document_vote_poll_contender_count/v0/mod.rs
  • packages/rs-drive/src/drive/votes/fetch/fetch_contested_document_vote_poll_stored_info/v0/mod.rs
  • packages/rs-drive/src/drive/votes/insert/contested_resource/individual_vote/register_contested_resource_identity_vote/v0/mod.rs
  • packages/rs-drive/src/drive/votes/insert/yes_no/register_yes_no_identity_vote/v0/mod.rs
  • packages/rs-drive/src/fees/calculate_fee/mod.rs
  • packages/rs-drive/src/fees/calculate_fee/v0/mod.rs
  • packages/rs-drive/src/fees/calculate_fee/v1/mod.rs
  • packages/rs-drive/src/fees/op.rs
  • packages/rs-drive/src/query/contested_resource_votes_given_by_identity_query.rs
  • packages/rs-drive/src/query/drive_contested_document_query.rs
  • packages/rs-drive/src/query/drive_document_average_query/drive_dispatcher.rs
  • packages/rs-drive/src/query/drive_document_count_query/tests.rs
  • packages/rs-drive/src/query/drive_document_having_query/tests.rs
  • packages/rs-drive/src/query/drive_document_ranked_query/tests.rs
  • packages/rs-drive/src/query/drive_document_sum_query/tests.rs
  • packages/rs-drive/src/query/mod.rs
  • packages/rs-drive/src/query/unsigned_index_key_order_tests.rs
  • packages/rs-drive/src/query/vote_poll_contestant_votes_query.rs
  • packages/rs-drive/src/query/vote_poll_vote_state_query.rs
  • packages/rs-drive/src/query/vote_polls_by_document_type_query.rs
  • packages/rs-drive/src/query/vote_polls_by_end_date_query.rs
  • packages/rs-drive/src/state_transition_action/action_convert_to_operations/shielded/mod.rs
  • packages/rs-drive/src/state_transition_action/action_convert_to_operations/shielded/shielded_withdrawal_transition.rs
  • packages/rs-drive/src/state_transition_action/action_convert_to_operations/shielded/unshield_transition.rs
  • packages/rs-drive/src/state_transition_action/batch/batched_transition/document_transition/state_generated_properties.rs
  • packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_burn_from_pool_transition_action/v0/transformer.rs
  • packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_burn_transition_action/v0/transformer.rs
  • packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_claim_to_pool_transition_action/v0/transformer.rs
  • packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_claim_transition_action/v0/transformer.rs
  • packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_config_update_transition_action/v0/transformer.rs
  • packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_destroy_frozen_funds_transition_action/v0/transformer.rs
  • packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_to_pool_transition_action/v0/transformer.rs
  • packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs
  • packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_emergency_action_transition_action/v0/transformer.rs
  • packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_freeze_transition_action/v0/transformer.rs
  • packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_mint_to_pool_transition_action/v0/transformer.rs
  • packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_mint_transition_action/v0/transformer.rs
  • packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/transformer.rs
  • packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_shield_transition_action/v0/transformer.rs
  • packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_shielded_transfer_transition_action/v0/transformer.rs
  • packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_transfer_transition_action/v0/transformer.rs
  • packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_unfreeze_transition_action/v0/transformer.rs
  • packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_unshield_transition_action/v0/transformer.rs
  • packages/rs-drive/src/structure/tests.rs
  • packages/rs-drive/src/util/batch/drive_op_batch/drive_methods/apply_drive_operations/mod.rs
  • packages/rs-drive/src/util/batch/drive_op_batch/drive_methods/apply_drive_operations/v0/mod.rs
  • packages/rs-drive/src/util/batch/drive_op_batch/drive_methods/apply_drive_operations/v1/mod.rs
  • packages/rs-drive/src/util/batch/drive_op_batch/drive_methods/apply_drive_operations/v2/mod.rs
  • packages/rs-drive/src/util/batch/drive_op_batch/mod.rs
  • packages/rs-drive/src/util/test_helpers/setup.rs
  • packages/rs-drive/src/verify/address_funds/verify_address_info/v0/mod.rs
  • packages/rs-drive/src/verify/document/verify_proof/v0/mod.rs
  • packages/rs-drive/src/verify/document/verify_proof_keep_serialized/v0/mod.rs
  • packages/rs-drive/src/verify/document/verify_start_at_document_in_proof/v0/mod.rs
  • packages/rs-drive/src/verify/single_document/verify_proof/v0/mod.rs
  • packages/rs-drive/src/verify/single_document/verify_proof_keep_serialized/v0/mod.rs
  • packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rs
  • packages/rs-drive/tests/compound_cursor_tests.rs
  • packages/rs-drive/tests/query_tests.rs
  • packages/rs-drive/tests/query_tests_history.rs
  • packages/rs-platform-version/src/version/drive_versions/v10.rs
  • packages/rs-platform-version/src/version/fee/mod.rs
  • packages/rs-platform-version/src/version/mocks/mod.rs
  • packages/rs-platform-version/src/version/mocks/v4_test.rs
  • packages/rs-platform-version/src/version/protocol_version.rs
  • packages/rs-platform-version/src/version/system_limits/mod.rs
  • packages/rs-platform-version/src/version/v15.rs

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 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 7, 2026 •

Copy link
Copy Markdown
Contributor

📖 Book Preview built successfully.

Download the preview from the workflow artifacts.
To view locally: download the artifact, unzip, and open index.html.

Updated at 2026-11-07T09:16:13.796Z

@github-actions

github-actions Bot commented Nov 7, 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 7, 2026
@thepastaclaw

thepastaclaw commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

⛔ Final review complete — 2 blocking finding(s) (commit f61087d) · triage: critical

@thepastaclaw thepastaclaw left a comment

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.

Final validation — Phase 1 + Phase 2

At head 3e41c7f, the refund-pricing refactor preserves results for all configured protocol versions because their storage rates match. One non-blocking regression remains: the public refund helper loses its current-epoch range validation. This was a static review; current CI reports passing code checks, including Rust workspace and wasm32 tests, with PR Hygiene and automated review still pending.

🟡 1 suggestion(s)

1 finding(s) not shown inline (GitHub refused the PR diff as too large)

🟡 Suggestion: Preserve epoch validation in the public refund helper
packages/rs-dpp/src/fee/fee_result/refunds.rs:60-62

Removing Epoch::new(current_epoch_index)? also removes the range validation previously performed by this public, fallible API. EpochIndex is a u16 alias, so callers can supply values above MAX_EPOCH. For example, refunding 100 bytes stored in epoch 1 with current_epoch_index = u16::MAX, epochs_per_era = 20, and the first fee schedule previously returned ProtocolError::Overflow. It now reaches current_epoch_index + 1 in calculate_storage_fee_refund_amount_and_leftovers, which panics with overflow checks enabled or wraps to zero and produces an incorrect positive refund without them. The existing Drive execution path supplies a validated epoch, so this is not a current consensus blocker. Retain the epoch validation independently of the removed history lookup and add a regression test asserting that an invalid current epoch returns an error.

source: gpt-6.1-sol (phase2-reviewer: rust-quality)

Review provenance

Source: reviewer 1: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 3: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: platform-versioning); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); reviewer 6: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); reviewer 7: gpt-6.1-sol (agent: phase2-reviewer, role: tenderdash-consensus-security); reviewer 8: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: critical by gpt-6.1-sol (effort low) — The cross-cutting refactor directly changes funds-refund pricing in FeeRefunds::from_storage_removal and its consensus-execution callers, requiring verification that historical protocol versions retain identical monetary results.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer, muse-spark-1.3-contributor — rust-quality (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity quota lookup failed), glm-5.3-flash (not used above high effort; tier asks max)
  • Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — architecture-layering (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — platform-versioning (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — rust-quality (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — security-auditor (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — tenderdash-consensus-security (completed, effort xhigh); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `packages/rs-dpp/src/fee/fee_result/refunds.rs`:
- [SUGGESTION] packages/rs-dpp/src/fee/fee_result/refunds.rs:60-62: Preserve epoch validation in the public refund helper
  Removing `Epoch::new(current_epoch_index)?` also removes the range validation previously performed by this public, fallible API. `EpochIndex` is a `u16` alias, so callers can supply values above `MAX_EPOCH`. For example, refunding 100 bytes stored in epoch 1 with `current_epoch_index = u16::MAX`, `epochs_per_era = 20`, and the first fee schedule previously returned `ProtocolError::Overflow`. It now reaches `current_epoch_index + 1` in `calculate_storage_fee_refund_amount_and_leftovers`, which panics with overflow checks enabled or wraps to zero and produces an incorrect positive refund without them. The existing Drive execution path supplies a validated epoch, so this is not a current consensus blocker. Retain the epoch validation independently of the removed history lookup and add a regression test asserting that an invalid current epoch returns an error.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Bots are done — your move: post /self-reviewed.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed and removed waiting-bots Waiting for the review bots to report on this head labels Nov 7, 2026
…m protocol version 15

A refund returns the part of an owner's storage fee not yet paid out to
epochs, and that fee was charged at the storage rate of the epoch that
stored the bytes. calculate_fee 1, selected by DRIVE_VERSION_V10, reads
the protocol version that epoch recorded at its first block
(get_epoch_protocol_version) and takes the rate from that version's fee
schedule. Bytes stored in the block's own epoch use the block's rate,
since that epoch is only recorded at the end of its first block.
consume_to_fees_v1 wraps generation 0, handing it each sectioned removal
as a basic removal of as many bytes, and prices the refunds itself.

calculate_fee reads state now, so it is a Drive method and drops
epochs_per_era, which all 171 callers passed from that Drive's config.
FeeRefunds::from_storage_removal takes a rate per storing epoch, and
generation 0 passes the block's rate for every epoch, as before.

Every schedule so far has the same storage rate, so no fee changes at any
protocol version. TEST_PLATFORM_V4 (mock-versions only) doubles it, so
should_price_a_refund_at_the_storage_rate_of_the_epoch_that_stored_the_bytes
can tell the epochs apart. The pin on one storage rate is no longer needed
and is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@QuantumExplorer QuantumExplorer changed the title refactor(platform): price storage refunds from the block's fee schedule and drop the fee history from Drive feat(platform): price storage refunds at the storing epoch's rate and drop the fee history map Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 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 waiting-bots Waiting for the review bots to report on this head and removed waiting-self-review Waiting for the author to post /self-reviewed labels Nov 7, 2026

@thepastaclaw thepastaclaw left a comment

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.

Re-review — Final validation — Phase 1 + Phase 2

At f61087d, historical refund pricing is correctly gated to protocol version 15 and storage access remains in Drive. Two blockers remain: historical metadata reads bypass processing-cost accounting, and the new metadata prerequisite breaks a cross-epoch fixture, as confirmed by the current-head Rust workspace CI log. The prior public-helper validation concern also remains a suggestion; this verification was static, with no local builds or tests.

🔴 2 blocking | 🟡 1 suggestion(s)

3 finding(s) not shown inline (GitHub refused the PR diff as too large)

🔴 Blocking: Account for historical epoch reads in the processing fee
packages/rs-drive/src/fees/calculate_fee/v1/mod.rs:64-65

This introduces user-dependent GroveDB reads without carrying their costs into the fee result. get_epoch_protocol_version_v0 uses grove.get(...).unwrap(); in the pinned GroveDB dependency, this is CostContext::unwrap, which explicitly discards OperationCost. Generation 1 computes processing fees from the original operations and then replaces only refunds and removed-system-byte counts, so the additional seeks and loaded bytes are never charged. The callback also runs for every qualifying owner/epoch entry in every sectioned-removal operation, repeating the same historical lookup across entries. Preserve the read cost in a Drive-owned accessor and include its deterministic processing charge in generation 1, with estimation and execution coverage while leaving generation 0 unchanged. A per-calculation cache of successful historical rates would additionally avoid repeated reads of the same immutable record; caching is an optimization, not a substitute for accounting for the reads that remain.

source: muse-spark-1.3-contributor (phase1-reviewer: general, rust-quality); gpt-6.1-sol (phase2-reviewer: general, architecture-layering, platform-versioning, rust-quality, security-auditor, tenderdash-consensus-security); gpt-6-astra (phase2-reviewer: general, architecture-layering, platform-versioning, rust-quality, security-auditor, tenderdash-consensus-security)

🔴 Blocking: Initialize historical epoch metadata in cross-epoch fixtures
packages/rs-drive/src/fees/calculate_fee/v1/mod.rs:64-65

The new mandatory lookup breaks the existing latest-version cross-epoch replacement test. In replacement.rs, test_double_document_replace_different_height_different_epoch enters epoch 1 with fast_forward_to_block(..., 1, false) at line 2861, then creates and replaces its document there. That branch updates platform state without processing epoch initialization. Genesis records epoch 0's protocol version; the later processed transition into epoch 2 initializes epoch 2 and its next-epoch record, not epoch 1. Refunding epoch-1 bytes therefore fails here. The current-head Rust workspace tests / Tests log confirms failure at replacement.rs:3091: valid_count() is 0 instead of 1, cancelling the remaining run (https://github.com/dashpay/platform/actions/runs/42358995597/job/128363462330). Update this fixture and equivalent synthetic-epoch setups to initialize and commit the storing epoch's metadata before leaving it. Retain the production missing-record error rather than substituting a guessed rate.

source: muse-spark-1.3-contributor (phase1-reviewer: general, rust-quality); gpt-6.1-sol (phase2-reviewer: general, architecture-layering, platform-versioning, rust-quality, security-auditor, tenderdash-consensus-security); gpt-6-astra (phase2-reviewer: general, architecture-layering, platform-versioning, rust-quality, security-auditor, tenderdash-consensus-security)

🟡 Suggestion: Preserve epoch validation in the public refund helper
packages/rs-dpp/src/fee/fee_result/refunds.rs:62-64

Drive supplies the current index from an existing Epoch, which protects normal block execution, but this public DPP helper still accepts an unrestricted EpochIndex (u16). Replacing Epoch::new(current_epoch_index)? with the storing-rate callback removes the helper's previous current-epoch validation; the callback receives only the storing index and cannot establish that invariant. With a qualifying 100-byte removal from epoch 0, a positive rate, and epochs_per_era = 20, MAX_EPOCH + 1 now returns a result instead of the former ProtocolError::Overflow. At u16::MAX, the distribution callback reaches unchecked current_epoch_index + 1, which panics with overflow checks or wraps without them. Restore current-epoch validation on the retained, non-dust path, or require a validated Epoch, and add boundary regression coverage. This is a public-API robustness issue, not a demonstrated network-reachable consensus defect.

source: muse-spark-1.3-contributor (phase1-reviewer: general, rust-quality); gpt-6.1-sol (phase2-reviewer: general, architecture-layering, platform-versioning, rust-quality); gpt-6-astra (phase2-reviewer: general, architecture-layering, platform-versioning, rust-quality)

Review provenance

Source: reviewer 1: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: platform-versioning); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); reviewer 6: gpt-6.1-sol (agent: phase2-reviewer, role: tenderdash-consensus-security); reviewer 7: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 8: gpt-6-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 9: gpt-6-astra (agent: phase2-reviewer, role: platform-versioning); reviewer 10: gpt-6-astra (agent: phase2-reviewer, role: rust-quality); reviewer 11: gpt-6-astra (agent: phase2-reviewer, role: security-auditor); reviewer 12: gpt-6-astra (agent: phase2-reviewer, role: tenderdash-consensus-security); reviewer 13: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 14: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: critical by gpt-6.1-sol (effort low) — The cross-cutting refactor also changes funds-refund calculation in Drive::calculate_fee v1 and LowLevelDriveOperation::consume_to_fees_v1, introducing protocol-gated historical epoch reads on block execution paths.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer, muse-spark-1.3-contributor — rust-quality (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity quota lookup failed), glm-5.3-flash (not used above high effort; tier asks max)
  • Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — architecture-layering (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — platform-versioning (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — rust-quality (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — security-auditor (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — tenderdash-consensus-security (completed, effort xhigh); agent phase2-reviewer, gpt-6-astra — general (completed, effort xhigh); agent phase2-reviewer, gpt-6-astra — architecture-layering (completed, effort xhigh); agent phase2-reviewer, gpt-6-astra — platform-versioning (completed, effort xhigh); agent phase2-reviewer, gpt-6-astra — rust-quality (completed, effort xhigh); agent phase2-reviewer, gpt-6-astra — security-auditor (completed, effort xhigh); agent phase2-reviewer, gpt-6-astra — tenderdash-consensus-security (completed, effort xhigh); agent phase2-reviewer
  • Model comparison: every Phase-2 reviewer also ran on gpt-6-astra; the verifier weighed both sets without knowing which model wrote which
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `packages/rs-drive/src/fees/calculate_fee/v1/mod.rs`:
- [BLOCKING] packages/rs-drive/src/fees/calculate_fee/v1/mod.rs:64-65: Account for historical epoch reads in the processing fee
  This introduces user-dependent GroveDB reads without carrying their costs into the fee result. `get_epoch_protocol_version_v0` uses `grove.get(...).unwrap()`; in the pinned GroveDB dependency, this is `CostContext::unwrap`, which explicitly discards `OperationCost`. Generation 1 computes processing fees from the original operations and then replaces only refunds and removed-system-byte counts, so the additional seeks and loaded bytes are never charged. The callback also runs for every qualifying owner/epoch entry in every sectioned-removal operation, repeating the same historical lookup across entries. Preserve the read cost in a Drive-owned accessor and include its deterministic processing charge in generation 1, with estimation and execution coverage while leaving generation 0 unchanged. A per-calculation cache of successful historical rates would additionally avoid repeated reads of the same immutable record; caching is an optimization, not a substitute for accounting for the reads that remain.
- [BLOCKING] packages/rs-drive/src/fees/calculate_fee/v1/mod.rs:64-65: Initialize historical epoch metadata in cross-epoch fixtures
  The new mandatory lookup breaks the existing latest-version cross-epoch replacement test. In `replacement.rs`, `test_double_document_replace_different_height_different_epoch` enters epoch 1 with `fast_forward_to_block(..., 1, false)` at line 2861, then creates and replaces its document there. That branch updates platform state without processing epoch initialization. Genesis records epoch 0's protocol version; the later processed transition into epoch 2 initializes epoch 2 and its next-epoch record, not epoch 1. Refunding epoch-1 bytes therefore fails here. The current-head `Rust workspace tests / Tests` log confirms failure at `replacement.rs:3091`: `valid_count()` is 0 instead of 1, cancelling the remaining run (https://github.com/dashpay/platform/actions/runs/42358995597/job/128363462330). Update this fixture and equivalent synthetic-epoch setups to initialize and commit the storing epoch's metadata before leaving it. Retain the production missing-record error rather than substituting a guessed rate.

In `packages/rs-dpp/src/fee/fee_result/refunds.rs`:
- [SUGGESTION] packages/rs-dpp/src/fee/fee_result/refunds.rs:62-64: Preserve epoch validation in the public refund helper
  Drive supplies the current index from an existing `Epoch`, which protects normal block execution, but this public DPP helper still accepts an unrestricted `EpochIndex` (`u16`). Replacing `Epoch::new(current_epoch_index)?` with the storing-rate callback removes the helper's previous current-epoch validation; the callback receives only the storing index and cannot establish that invariant. With a qualifying 100-byte removal from epoch 0, a positive rate, and `epochs_per_era = 20`, `MAX_EPOCH + 1` now returns a result instead of the former `ProtocolError::Overflow`. At `u16::MAX`, the distribution callback reaches unchecked `current_epoch_index + 1`, which panics with overflow checks or wraps without them. Restore current-epoch validation on the retained, non-dust path, or require a validated `Epoch`, and add boundary regression coverage. This is a public-API robustness issue, not a demonstrated network-reachable consensus defect.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Your move: thepastaclaw requested changes on this head; dismiss the review or push a fix.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed and removed waiting-bots Waiting for the review bots to report on this head labels Nov 7, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-self-review Waiting for the author to post /self-reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants