Skip to content

fix: don't build storage access test runtime#884

Open
gilescope wants to merge 5 commits intomainfrom
giles-dont-build-storage-access-test-runtime
Open

fix: don't build storage access test runtime#884
gilescope wants to merge 5 commits intomainfrom
giles-dont-build-storage-access-test-runtime

Conversation

@gilescope
Copy link
Contributor

@gilescope gilescope commented Mar 7, 2026

Overview

Remove frame-storage-access-test-runtime from the runtime's [build-dependencies]. This polkadot-sdk test crate was accidentally included in PR #42 (Federated Authority, Sep 2025) — likely copy-pasted from a polkadot-sdk template. It was never imported in build.rs or any Rust code.

Because it had default-features = true (which enables substrate-wasm-builder), it built its own separate WASM runtime on every release build, adding ~2.5 minutes of compile time and pulling in 179 unnecessary crates including the entire parachain/cumulus/XCM stack — none of which belong in a sidechain node.

Build time improvement (clean release build):

Metric Before After Improvement
Build time 9m 18s 6m 55s -25.6%
Crate count 1,791 1,612 -179

No functional changes. The runtime WASM output is identical.

🗹 TODO before merging

  • Ready

📌 Submission Checklist

  • Changes are backward-compatible (or flagged if breaking)
  • Pull request description explains why the change is needed
  • Self-reviewed the diff
  • I have included a change file, or skipped for this reason: change only affects build time, no product impact
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • Updated AGENTS.md if build commands, architecture, or workflows changed
  • No new todos introduced

🧪 Testing Evidence

Clean release build with cargo build --timings -p midnight-node --release:

  • Before: 9m 18s, 1,791 crates, frame-storage-access-test-runtime build script (run) at 122.8s

  • After: 6m 55s, 1,612 crates, no frame-storage-access-test-runtime or parachain-related entries

  • WASM runtime artifacts produced correctly (compact, compressed variants)

  • Additional tests are provided (if possible)

🔱 Fork Strategy

  • Node Runtime Update
  • Node Client Update
  • Other:
  • N/A

Links

Signed-off-by: Giles Cope <gilescope@gmail.com>
@gilescope gilescope requested a review from a team as a code owner March 7, 2026 12:27
@gilescope gilescope changed the title fix: don't build this runtime. We don't need it fix: don't build storage access test runtime Mar 7, 2026
@gilescope gilescope requested a review from NachoPal March 7, 2026 12:28
@github-actions
Copy link
Contributor

github-actions bot commented Mar 7, 2026

kics-logo

KICS version: v2.1.19

Category Results
CRITICAL CRITICAL 0
HIGH HIGH 0
MEDIUM MEDIUM 47
LOW LOW 3
INFO INFO 59
TRACE TRACE 0
TOTAL TOTAL 109
Metric Values
Files scanned placeholder 26
Files parsed placeholder 26
Files failed to scan placeholder 0
Total executed queries placeholder 73
Queries failed to execute placeholder 0
Execution time placeholder 11

@NachoPal
Copy link
Contributor

NachoPal commented Mar 8, 2026

Ok, I got to the bottom of why it was needed:

  1. frame-storage-access-test-runtime is a dependency of frame-benchmarking-cli which is needed for running the benchmarks.
  2. Without it, cargo build -r --features runtime-benchmarks will not compile
  3. The reason we didn't notice it wasn't compiling is because in the check-rust Earthly target, RUN cargo clippy --workspace --all-targets --features runtime-benchmarks -- -D warnings was running with ENV SKIP_WASM_BUILD=1 which is wrong (we need the wasm runtime for the benchmarks)
  4. frame-storage-access-test-runtime is used for benchmark storage subcommand, which we ideally should want to use.
  5. The good news is frame-storage-access-test-runtime wasm is only used for benchmark storage --mode validate-block which is only useful for parachains block validations.
  6. Conclusion is we can remove the dependency and build the node skipping that particular wasm build:
SKIP_FRAME_STORAGE_ACCESS_TEST_RUNTIME_WASM_BUILD=1 cargo build --release --features runtime-benchmarks -p midnight-node

@gilescope
Copy link
Contributor Author

Is SKIP_FRAME_STORAGE_ACCESS_TEST_RUNTIME_WASM_BUILD a thing? I don't see any reference to it in the polkadot repo?

@NachoPal
Copy link
Contributor

NachoPal commented Mar 8, 2026

Is SKIP_FRAME_STORAGE_ACCESS_TEST_RUNTIME_WASM_BUILD a thing? I don't see any reference to it in the polkadot repo?

https://github.com/paritytech/polkadot-sdk/blob/master/substrate/utils/wasm-builder/src/builder.rs#L285

@gilescope gilescope enabled auto-merge March 9, 2026 05:41
@ozgb
Copy link
Contributor

ozgb commented Mar 9, 2026

CI Error looks unrelated:
image

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants