Problem
All timeouts, expiries, periods and intervals in the storage provider pallet (and drive-registry pallet) are measured in parachain blocks. They read `frame_system::Pallet::::block_number()` directly (17 sites in `pallet/src/`, 1 in `pallet-registry/src/lib.rs`), and the runtime constants derive from a 6s parachain block.
This is wrong: parachain block time is changing (6s -> 2s/3-cores, targeting AssetHub) and will change again. Anything denominated in parachain blocks silently rescales with it -- e.g. `48 * HOURS` becomes 16h of wall-clock once blocks are 2s.
Decision (per Robert): always use relay chain blocks for these durations, to stay independent of parachain block time.
Scope
Currently the bug is latent (6s == 6s) and bites the moment the parachain switches to 2s.
Affected config: `ChallengeTimeout`, `SettlementTimeout`, `RequestTimeout`, `DefaultCheckpointInterval`, `DefaultCheckpointGrace`, `DeregisterAnnouncementPeriod`, agreement durations/extensions, drive expiry.
Plan
- Add `type BlockNumberProvider: BlockNumberProvider<BlockNumber = BlockNumberFor>` to both pallet `Config`s.
- Replace all `frame_system::Pallet::::block_number()` reads with `T::BlockNumberProvider::current_block_number()`.
- Runtimes: `type BlockNumberProvider = cumulus_pallet_parachain_system::RelaychainDataProvider`.
- Mocks/tests: `type BlockNumberProvider = System`.
- Recompute the time constants from a 6s relay block, independent of parachain block time.
Notes / open questions
- User-supplied durations (agreement `duration`, extensions) change meaning to relay blocks. Client/SDK/UI and payment-per-block math must interpret them consistently -- likely a follow-up.
- `RelaychainDataProvider` returns the relay parent number from validation data (monotonic, but delta between consecutive parachain blocks can be >1). Verify checkpoint window math (`calculate_window`) doesn't assume +1 per parachain block.
TODO
Related: #113
Problem
All timeouts, expiries, periods and intervals in the storage provider pallet (and drive-registry pallet) are measured in parachain blocks. They read `frame_system::Pallet::::block_number()` directly (17 sites in `pallet/src/`, 1 in `pallet-registry/src/lib.rs`), and the runtime constants derive from a 6s parachain block.
This is wrong: parachain block time is changing (6s -> 2s/3-cores, targeting AssetHub) and will change again. Anything denominated in parachain blocks silently rescales with it -- e.g. `48 * HOURS` becomes 16h of wall-clock once blocks are 2s.
Decision (per Robert): always use relay chain blocks for these durations, to stay independent of parachain block time.
Scope
Currently the bug is latent (6s == 6s) and bites the moment the parachain switches to 2s.
Affected config: `ChallengeTimeout`, `SettlementTimeout`, `RequestTimeout`, `DefaultCheckpointInterval`, `DefaultCheckpointGrace`, `DeregisterAnnouncementPeriod`, agreement durations/extensions, drive expiry.
Plan
Notes / open questions
TODO
Related: #113