Skip to content

Deprecate RuntimeDebug and replace it with Debug#10582

Merged
bkchr merged 8 commits intomasterfrom
bkchr-deprecate-runtime-debug
Dec 11, 2025
Merged

Deprecate RuntimeDebug and replace it with Debug#10582
bkchr merged 8 commits intomasterfrom
bkchr-deprecate-runtime-debug

Conversation

@bkchr
Copy link
Copy Markdown
Member

@bkchr bkchr commented Dec 9, 2025

I compared multiple builds which each other:

Runtime RuntimeDebug .compact.wasm Debug .compact.wasm Δ bytes Δ %
westend-runtime 10,004,155 10,093,902 +89,747 +0.90%
asset-hub-westend-runtime 13,453,435 13,491,827 +38,392 +0.29%
bridge-hub-westend-runtime 6,975,911 7,078,591 +102,680 +1.47%
collectives-westend-runtime 6,660,307 6,725,426 +65,119 +0.98%
people-westend-runtime 5,639,941 5,661,539 +21,598 +0.38%
coretime-westend-runtime 5,667,343 5,689,961 +22,618 +0.40%
glutton-westend-runtime 2,502,303 2,514,727 +12,424 +0.50%
Runtime RuntimeDebug .compact.compressed.wasm Debug .compact.compressed.wasm Δ bytes Δ %
westend-runtime 1,911,531 1,918,414 +6,883 +0.36%
asset-hub-westend-runtime 2,402,348 2,408,262 +5,914 +0.25%
bridge-hub-westend-runtime 1,397,714 1,409,183 +11,469 +0.82%
collectives-westend-runtime 1,265,180 1,268,329 +3,149 +0.25%
people-westend-runtime 1,125,880 1,126,034 +154 +0.01%
coretime-westend-runtime 1,132,311 1,135,300 +2,989 +0.26%
glutton-westend-runtime 543,780 546,127 +2,347 +0.43%

With --features on-chain-release-build:

Runtime RuntimeDebug .compact.wasm Debug .compact.wasm Δ bytes Δ %
westend-runtime 10,088,725 10,088,725 0 0.00%
asset-hub-westend-runtime 13,491,318 13,491,318 0 0.00%
bridge-hub-westend-runtime 7,078,244 7,078,244 0 0.00%
collectives-westend-runtime 6,724,948 6,724,948 0 0.00%
people-westend-runtime 5,640,009 5,661,591 +21,582 +0.38%
coretime-westend-runtime 5,689,735 5,689,735 0 0.00%
glutton-westend-runtime 2,504,593 2,517,004 +12,411 +0.50%
Runtime RuntimeDebug .compact.compressed.wasm Debug .compact.compressed.wasm Δ bytes Δ %
westend-runtime 1,917,250 1,917,250 0 0.00%
asset-hub-westend-runtime 2,408,382 2,408,382 0 0.00%
bridge-hub-westend-runtime 1,409,259 1,409,259 0 0.00%
collectives-westend-runtime 1,267,981 1,267,981 0 0.00%
people-westend-runtime 1,126,034 1,130,613 +4,579 +0.41%
coretime-westend-runtime 1,135,207 1,135,207 0 0.00%
glutton-westend-runtime 545,344 548,753 +3,409 +0.63%

This shows that the size increase is neglectable and not worth the increased hassle when it comes to debuggin inside wasm.

Closes: #3005

I compared multiple builds which each other:

| Runtime | RuntimeDebug .compact.wasm | Debug .compact.wasm | Δ bytes | Δ % |
|---------|---------------------------|---------------------|---------|-----|
| westend-runtime | 10,004,155 | 10,093,902 | +89,747 | +0.90% |
| asset-hub-westend-runtime | 13,453,435 | 13,491,827 | +38,392 | +0.29% |
| bridge-hub-westend-runtime | 6,975,911 | 7,078,591 | +102,680 | +1.47% |
| collectives-westend-runtime | 6,660,307 | 6,725,426 | +65,119 | +0.98% |
| people-westend-runtime | 5,639,941 | 5,661,539 | +21,598 | +0.38% |
| coretime-westend-runtime | 5,667,343 | 5,689,961 | +22,618 | +0.40% |
| glutton-westend-runtime | 2,502,303 | 2,514,727 | +12,424 | +0.50% |

| Runtime | RuntimeDebug .compact.compressed.wasm | Debug .compact.compressed.wasm | Δ bytes | Δ % |
|---------|--------------------------------------|--------------------------------|---------|-----|
| westend-runtime | 1,911,531 | 1,918,414 | +6,883 | +0.36% |
| asset-hub-westend-runtime | 2,402,348 | 2,408,262 | +5,914 | +0.25% |
| bridge-hub-westend-runtime | 1,397,714 | 1,409,183 | +11,469 | +0.82% |
| collectives-westend-runtime | 1,265,180 | 1,268,329 | +3,149 | +0.25% |
| people-westend-runtime | 1,125,880 | 1,126,034 | +154 | +0.01% |
| coretime-westend-runtime | 1,132,311 | 1,135,300 | +2,989 | +0.26% |
| glutton-westend-runtime | 543,780 | 546,127 | +2,347 | +0.43% |

| Runtime | RuntimeDebug .compact.wasm | Debug .compact.wasm | Δ bytes | Δ % |
|---------|---------------------------|---------------------|---------|-----|
| westend-runtime | 10,088,725 | 10,088,725 | 0 | 0.00% |
| asset-hub-westend-runtime | 13,491,318 | 13,491,318 | 0 | 0.00% |
| bridge-hub-westend-runtime | 7,078,244 | 7,078,244 | 0 | 0.00% |
| collectives-westend-runtime | 6,724,948 | 6,724,948 | 0 | 0.00% |
| people-westend-runtime | 5,640,009 | 5,661,591 | +21,582 | +0.38% |
| coretime-westend-runtime | 5,689,735 | 5,689,735 | 0 | 0.00% |
| glutton-westend-runtime | 2,504,593 | 2,517,004 | +12,411 | +0.50% |

| Runtime | RuntimeDebug .compact.compressed.wasm | Debug .compact.compressed.wasm | Δ bytes | Δ % |
|---------|--------------------------------------|--------------------------------|---------|-----|
| westend-runtime | 1,917,250 | 1,917,250 | 0 | 0.00% |
| asset-hub-westend-runtime | 2,408,382 | 2,408,382 | 0 | 0.00% |
| bridge-hub-westend-runtime | 1,409,259 | 1,409,259 | 0 | 0.00% |
| collectives-westend-runtime | 1,267,981 | 1,267,981 | 0 | 0.00% |
| people-westend-runtime | 1,126,034 | 1,130,613 | +4,579 | +0.41% |
| coretime-westend-runtime | 1,135,207 | 1,135,207 | 0 | 0.00% |
| glutton-westend-runtime | 545,344 | 548,753 | +3,409 | +0.63% |

This shows that the size increase is neglectable and not worth the increased hassle when it comes to debuggin inside wasm.
@bkchr bkchr requested review from a team and acatangiu as code owners December 9, 2025 15:53
@bkchr bkchr added the T1-FRAME This PR/Issue is related to core FRAME, the framework. label Dec 9, 2025
@paritytech-review-bot paritytech-review-bot Bot requested a review from a team December 9, 2025 15:54
@bkchr
Copy link
Copy Markdown
Member Author

bkchr commented Dec 9, 2025

/cmd fmt

@paritytech-workflow-stopper
Copy link
Copy Markdown

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/20077038691
Failed job name: test-linux-stable

@bkchr
Copy link
Copy Markdown
Member Author

bkchr commented Dec 9, 2025

/cmd update-ui

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 9, 2025

Command "update-ui" has started 🚀 See logs here

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 9, 2025

Command "update-ui" has finished ✅ See logs here

@alindima
Copy link
Copy Markdown
Contributor

alindima commented Dec 10, 2025

Isn't the runtime cost of logging large data instead of "stripped" also worth investigating? For example if we were to log a candidate's commitments that can be very large and definitely take a lot of time.
This could affect how many transactions a collator can pack in the 2s of execution and therefore throughput. Or are we safe to assume that runtime logging is not enabled in production and has no effect?

github-merge-queue Bot pushed a commit that referenced this pull request Dec 10, 2025
The PR aligns types between Bulletin and SDK.

Addresses
paritytech/polkadot-bulletin-chain#86

Relates to
* paritytech/polkadot-bulletin-chain#128
* paritytech/polkadot-bulletin-chain#134
* #10582

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
paritytech-release-backport-bot Bot pushed a commit that referenced this pull request Dec 10, 2025
The PR aligns types between Bulletin and SDK.

Addresses
paritytech/polkadot-bulletin-chain#86

Relates to
* paritytech/polkadot-bulletin-chain#128
* paritytech/polkadot-bulletin-chain#134
* #10582

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
(cherry picked from commit 18cb5ee)
@bkchr bkchr enabled auto-merge December 10, 2025 20:21
@bkchr
Copy link
Copy Markdown
Member Author

bkchr commented Dec 10, 2025

Isn't the runtime cost of logging large data instead of "stripped" also worth investigating? For example if we were to log a candidate's commitments that can be very large and definitely take a lot of time.

Why are you logging something like this in the first place when you could never read it? Because before we stripped the information.

Generally RuntimeDebug was developed to ensure we don't include unnecessary data in the runtime. Also most of the people probably don't run debug logs, in which case there is no real performance hit because we filter these logs in the runtime.

Or are we safe to assume that runtime logging is not enabled in production and has no effect?

Relay chains + system chain are running this way. As most people copy our code, they have probably done the same. Generally I would assume this is the case and if not they can fix it. Still, we should not log things with debug which are clearly trace logs (remember, that we filter based on the max level inside of the runtime).

@bkchr
Copy link
Copy Markdown
Member Author

bkchr commented Dec 10, 2025

/cmd prdoc --audience runtime_dev --bump minor

@github-actions
Copy link
Copy Markdown
Contributor

Command "prdoc --audience runtime_dev --bump minor" has failed ❌! See logs here

@bkchr
Copy link
Copy Markdown
Member Author

bkchr commented Dec 10, 2025

/cmd prdoc --audience runtime_dev --bump minor

@github-actions
Copy link
Copy Markdown
Contributor

Command "prdoc --audience runtime_dev --bump minor" has failed ❌! See logs here

@bkchr bkchr added this pull request to the merge queue Dec 10, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 10, 2025
@bkchr bkchr added this pull request to the merge queue Dec 11, 2025
Merged via the queue into master with commit f8c9643 Dec 11, 2025
251 of 255 checks passed
@bkchr bkchr deleted the bkchr-deprecate-runtime-debug branch December 11, 2025 08:09
0xRVE pushed a commit that referenced this pull request Dec 11, 2025
I compared multiple builds which each other:


| Runtime | RuntimeDebug .compact.wasm | Debug .compact.wasm | Δ bytes |
Δ % |

|---------|---------------------------|---------------------|---------|-----|
| westend-runtime | 10,004,155 | 10,093,902 | +89,747 | +0.90% | 
| asset-hub-westend-runtime | 13,453,435 | 13,491,827 | +38,392 | +0.29%
|
| bridge-hub-westend-runtime | 6,975,911 | 7,078,591 | +102,680 | +1.47%
|
| collectives-westend-runtime | 6,660,307 | 6,725,426 | +65,119 | +0.98%
|
| people-westend-runtime | 5,639,941 | 5,661,539 | +21,598 | +0.38% | 
| coretime-westend-runtime | 5,667,343 | 5,689,961 | +22,618 | +0.40% | 
| glutton-westend-runtime | 2,502,303 | 2,514,727 | +12,424 | +0.50% |



| Runtime | RuntimeDebug .compact.compressed.wasm | Debug
.compact.compressed.wasm | Δ bytes | Δ % |

|---------|--------------------------------------|--------------------------------|---------|-----|
| westend-runtime | 1,911,531 | 1,918,414 | +6,883 | +0.36% |
| asset-hub-westend-runtime | 2,402,348 | 2,408,262 | +5,914 | +0.25% |
| bridge-hub-westend-runtime | 1,397,714 | 1,409,183 | +11,469 | +0.82%
|
| collectives-westend-runtime | 1,265,180 | 1,268,329 | +3,149 | +0.25%
|
| people-westend-runtime | 1,125,880 | 1,126,034 | +154 | +0.01% |
| coretime-westend-runtime | 1,132,311 | 1,135,300 | +2,989 | +0.26% |
| glutton-westend-runtime | 543,780 | 546,127 | +2,347 | +0.43% |


With `--features on-chain-release-build`:

| Runtime | RuntimeDebug .compact.wasm | Debug .compact.wasm | Δ bytes |
Δ % |

|---------|---------------------------|---------------------|---------|-----|
| westend-runtime | 10,088,725 | 10,088,725 | 0 | 0.00% | 
| asset-hub-westend-runtime | 13,491,318 | 13,491,318 | 0 | 0.00% | 
| bridge-hub-westend-runtime | 7,078,244 | 7,078,244 | 0 | 0.00% | 
| collectives-westend-runtime | 6,724,948 | 6,724,948 | 0 | 0.00% | 
| people-westend-runtime | 5,640,009 | 5,661,591 | +21,582 | +0.38% | 
| coretime-westend-runtime | 5,689,735 | 5,689,735 | 0 | 0.00% | 
| glutton-westend-runtime | 2,504,593 | 2,517,004 | +12,411 | +0.50% |



| Runtime | RuntimeDebug .compact.compressed.wasm | Debug
.compact.compressed.wasm | Δ bytes | Δ % |

|---------|--------------------------------------|--------------------------------|---------|-----|
| westend-runtime | 1,917,250 | 1,917,250 | 0 | 0.00% |
| asset-hub-westend-runtime | 2,408,382 | 2,408,382 | 0 | 0.00% |
| bridge-hub-westend-runtime | 1,409,259 | 1,409,259 | 0 | 0.00% |
| collectives-westend-runtime | 1,267,981 | 1,267,981 | 0 | 0.00% |
| people-westend-runtime | 1,126,034 | 1,130,613 | +4,579 | +0.41% |
| coretime-westend-runtime | 1,135,207 | 1,135,207 | 0 | 0.00% |
| glutton-westend-runtime | 545,344 | 548,753 | +3,409 | +0.63% |


This shows that the size increase is neglectable and not worth the
increased hassle when it comes to debuggin inside wasm.

Closes: #3005

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
RomarQ added a commit to RomarQ/polkadot-sdk that referenced this pull request Dec 12, 2025
github-merge-queue Bot pushed a commit that referenced this pull request Dec 30, 2025
Follow-up of #10582. Removes remaining uses of
`sp-debug-derive/force-debug` feature, since it is now a no-op.
sigurpol pushed a commit that referenced this pull request Dec 30, 2025
Follow-up of #10582. Removes remaining uses of
`sp-debug-derive/force-debug` feature, since it is now a no-op.
github-merge-queue Bot pushed a commit that referenced this pull request Jan 30, 2026
Bump pallet-staking-reward-fn to patch. This forces it to use local path
and the local sp-arithmetic instead of registry while running
`parity-publish`.
This aims to fix the failure in `Check publish build` job (e.g.
https://github.com/paritytech/polkadot-sdk/actions/runs/21359458014/job/61474963706?pr=10903#step:12:546)
which started to appear since #10682 got merged.

When parity-publish is used with --registry:
- If the version exists on crates.io → remove path, use registry
- If the version doesn't exist → keep path, use local
The issue is that --registry creates a hybrid state where some deps use
registry and some use local paths, causing version conflicts in case e.g
of missing trait impl in on the two.

Extended explanation, courtesy of @iulianbarbu : 
In the parity-publish CI job example we have:
- polkadot-runtime-common (crate A), depends on crate B indirectly &
crate C
- sp-arithmetic (crate B), was bumped locally (due to #10682), but not
published on the registry yet
- pallet-staking-reward-fn (crate C). depends on crate B.

polkadot-runtime-common fails to compile due to a dependency graph using
two versions of same type of crate B. What is an issue though is that
pallet-staking-reward-fn uses the previous crate B version (from the
registry), which misses a certain trait impl that is required by
polkadot-runtime-common. If polkadot-runtime-common usage of
pallet-staking-reward-fn expects the new trait impl, it means that it is
not enough to just bump pallet-staking-reward-fn, but also
polkadot-runtime-common, in this PR (to update it to depend on the new
version of pallet-staking-reward-fn). Everything compiles fine rn
because polkadot-runtime-common is already bumped in a previous PR (e.g
#10582 and maybe others), which did not make its way to a stable release
yet.
kayabaNerve added a commit to serai-dex/patch-polkadot-sdk that referenced this pull request Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T1-FRAME This PR/Issue is related to core FRAME, the framework.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Improve debuggability in wasm

6 participants