Skip to content

Storage-backed protocol params in the local runtime + lower-timeouts tuning script#269

Draft
x3c41a wants to merge 1 commit into
devfrom
feat/storage-backed-timeouts
Draft

Storage-backed protocol params in the local runtime + lower-timeouts tuning script#269
x3c41a wants to merge 1 commit into
devfrom
feat/storage-backed-timeouts

Conversation

@x3c41a

@x3c41a x3c41a commented Jul 7, 2026

Copy link
Copy Markdown

First slice of #267: make short protocol timing available on local/dev chains without a wasm rebuild.

Runtime

runtimes/web3-storage-local: the 13 pallet-storage-provider parameters switch from pub const to pub storage, matching the paseo runtime. Defaults are unchanged. Each parameter lives at the unhashed key twox128(":Name:"), can be overridden live via sudo(System.set_storage), and falls back to the compiled default while no override is present.

Tooling

examples/papi/lower-timeouts.ts (or pnpm --filter web3-storage-papi-demo run lower-timeouts):

  • --profile fast: minute-scale timing (challenge/settlement 10 min, request 5 min, checkpoint interval 2 min, dereg announcement 15 min, nonce age 1 h)
  • --set Name=Value for any parameter, --restore (kill_storage, back to compiled defaults), --list, --dry-run
  • re-checks the DeregisterAnnouncementPeriod > ChallengeTimeout / RequestTimeout invariants, since integrity_test only runs at build time and cannot see overrides
  • refuses to run if --suri is not the sudo key

Works against both runtimes (paseo already had storage-backed params).

Tested

Live on a local zombienet: applied the fast profile (finalized, verified by raw key readback), confirmed effective values via metadata constants from a fresh process, single-param set, restore back to compiled defaults, invariant/sudo-key/range/unreachable-endpoint guards. cargo check/clippy on the runtime crate and tsc --noEmit pass.

…cript

Switch the 13 pallet-storage-provider parameters in the local runtime
from pub const to pub storage, matching the paseo runtime: defaults are
unchanged, but each can now be overridden live via
sudo(System.set_storage) and falls back to the compiled default when
the override key is absent.

Add examples/papi/lower-timeouts.ts to drive that: --profile fast
(minute-scale timing), --set Name=Value, --restore (kill_storage),
--list, --dry-run. Re-checks the DeregisterAnnouncementPeriod
invariants that integrity_test cannot guard at override time.

First slice of #267 (short timeouts available locally).
@x3c41a
x3c41a marked this pull request as draft July 7, 2026 08:32
@x3c41a

x3c41a commented Jul 7, 2026

Copy link
Copy Markdown
Author

The check-migration (web3-storage-paseo) failure is not from this PR.

This PR only changes the local runtime (runtimes/web3-storage-local/src/storage.rs) and a TS script. It doesn't touch the paseo runtime or the Bucket type, so the paseo WASM built here is identical to dev. The paseo job is also the only migration check that runs (the local runtime's matrix entry still has "TODO: update WSS" as its URI).

The failure is try-runtime decoding live previewnet state:

try_decode_entire_state failed: StorageProvider::Buckets key 0x6b04… is undecodable
panicked in TryRuntime_on_runtime_upgrade

dev's "Check Runtime Migrations" passed at 06:24 UTC today and this run failed at 08:42 with an unchanged paseo runtime, so previewnet state diverged from the current Bucket type in between. It'll hit any runtime-touching PR until previewnet is upgraded or its state reconciled.

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.

1 participant