Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FRAME] Warn when using default SubstrateWeights in production #3581

Open
Tracked by #6151
ggwpez opened this issue Mar 5, 2024 · 6 comments
Open
Tracked by #6151

[FRAME] Warn when using default SubstrateWeights in production #3581

ggwpez opened this issue Mar 5, 2024 · 6 comments
Assignees
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK.

Comments

@ggwpez
Copy link
Member

ggwpez commented Mar 5, 2024

We can probably come up with a cfg clause to add a deprecation to the auto-generated SubstrateWeights to prevent them from accidentally being used in production.
Either by using production profile, on-chain-release-build, std or similar.

Idea came up here.

@kianenigma kianenigma added C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. and removed C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. labels Oct 2, 2024
@kianenigma kianenigma added C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. labels Oct 21, 2024
@kianenigma kianenigma added this to AHM Oct 21, 2024
@kianenigma kianenigma moved this to Backlog in AHM Oct 22, 2024
@kianenigma kianenigma removed this from AHM Oct 24, 2024
@Krayt78
Copy link
Contributor

Krayt78 commented Dec 8, 2024

Hi @ggwpez I would love to be assigned to this task :)

@ggwpez
Copy link
Member Author

ggwpez commented Jan 3, 2025

Sounds good (if you are still interested). Sorry i was out of office last month.
This issue just came up and should also be easy to do: #7038

@Krayt78
Copy link
Contributor

Krayt78 commented Jan 5, 2025

Sounds good (if you are still interested). Sorry i was out of office last month. This issue just came up and should also be easy to do: #7038

Thx !
Should this be done with specific flags or only std (or is it no_std like Kian suggested before ?)?

@ggwpez
Copy link
Member Author

ggwpez commented Jan 6, 2025

I think maybe starting with a deprecated warning that is triggered on #[cfg(not(feature = "std"))] would be the easiest. Our kitchensink and testing runtimes could then get an allow(deprecated) on the configuration.

Not sure if it will all work out, but maybe just playing around with it a bit will show how we can solve it. One thing is certain though: We never enable std when building our production runtimes.

@Krayt78
Copy link
Contributor

Krayt78 commented Jan 6, 2025

I think maybe starting with a deprecated warning that is triggered on #[cfg(not(feature = "std"))] would be the easiest. Our kitchensink and testing runtimes could then get an allow(deprecated) on the configuration.

Not sure if it will all work out, but maybe just playing around with it a bit will show how we can solve it. One thing is certain though: We never enable std when building our production runtimes.

Roger the warning was added to this PR #7046. Maybe later on we might have an actual "production" flag used everywhere that could replace this, but i guess that would require a lot of small code changes everywhere

@bkchr
Copy link
Member

bkchr commented Jan 6, 2025

I think maybe starting with a deprecated warning that is triggered on #[cfg(not(feature = "std"))] would be the easiest. Our kitchensink and testing runtimes could then get an allow(deprecated) on the configuration.

Warnings from the wasm build process are not propagated to the main build. (If you not enable WASM_BUILD_RUSTFLAGS=warnwhateveritiscalled)

github-merge-queue bot pushed a commit that referenced this issue Jan 7, 2025
PR for #3581 
Added a cfg to show a deprecated warning message when using std

---------

Co-authored-by: command-bot <>
Co-authored-by: Adrian Catangiu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK.
Projects
Development

No branches or pull requests

4 participants