-
Notifications
You must be signed in to change notification settings - Fork 687
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
Introduce storage attr macro #[disable_try_decode_storage]
and set it on System::Events
and ParachainSystem::HostConfiguration
#3454
Introduce storage attr macro #[disable_try_decode_storage]
and set it on System::Events
and ParachainSystem::HostConfiguration
#3454
Conversation
@@ -834,7 +834,7 @@ pub fn expand_storages(def: &mut Def) -> proc_macro2::TokenStream { | |||
.storages | |||
.iter() | |||
.filter_map(|storage| { | |||
if storage.cfg_attrs.is_empty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kianenigma do you remember why we check if storage.cfg_attrs.is_empty()
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems it's to avoid this compile error https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/5317738
I wonder if there's a better way to handle that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea we should probably re-expand the attributes here.
It seems to be only used only for testing.
#[disable_try_decode_storage]
and set it on System::Events
#[disable_try_decode_storage]
and set it on System::Events
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole macro changes look good
I thought an off-band discussion concluded that we don't want to expose this to the end-user facing API, and just hardcode somewhere that This PR is not doing that, but it is neatly done. I would like to see:
Before merge tho |
Basti requested this to be done as an attribute macro rather than a hardcoded exception for |
@liamaharon can you quote it instead of private link |
My point basically was/is that the same thing can happen to downstream users. Like some storage item that is always deleted at the beginning of the next block. Thus, you don't really care if you can still decode it. |
In that case it is the try runtime tool should call initialize hook before validate storage entries. |
83c339a
to
06ff03b
Compare
…om:paritytech/polkadot-sdk into liam-disable-try-decode-storage-attr-macro
…om:paritytech/polkadot-sdk into liam-disable-try-decode-storage-attr-macro
#[disable_try_decode_storage]
and set it on System::Events
#[disable_try_decode_storage]
and set it on System::Events
and ParachainSystem::HostConfiguration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be great if you can help address my concerns before merge #2560 (comment)
…head-data * origin/master: (51 commits) Runtime Upgrade ref docs and Single Block Migration example pallet (#1554) Collator overseer builder unification (#3335) Introduce storage attr macro `#[disable_try_decode_storage]` and set it on `System::Events` and `ParachainSystem::HostConfiguration` (#3454) Add Polkadotters bootnoders per IBP application (#3423) Add documentation around FRAME Origin (#3362) Bridge zombienet tests: Check amount received at destination (#3490) Snowbridge benchmark tests fix (#3424) fix(zombienet): increase timeout in download artifacts (#3376) Cleanup String::from_utf8 (#3446) [prdoc] Validate crate names (#3467) Limit max execution time for `test-linux-stable` CI jobs (#3483) Introduce Notification block pinning limit (#2935) frame-support: Improve error reporting when having too many pallets (#3478) add Encointer as trusted teleporter for Westend (#3411) [pallet-xcm] Adjust benchmarks (teleport_assets/reserve_transfer_assets) not relying on ED (#3464) Add more debug logs to understand if statement-distribution misbehaving (#3419) Remove redundant parachains assigner pallet. (#3457) Use generic hash for runtime wasm in resolve_state_version_from_wasm (#3447) Runtime: allow backing multiple candidates of same parachain on different cores (#3231) Bridge zombienet tests: move all "framework" files under one folder (#3462) ...
…it on `System::Events` and `ParachainSystem::HostConfiguration` (paritytech#3454) Closes paritytech#2560 Allows marking storage items with `#[disable_try_decode_storage]`, and uses it with `System::Events`. Question: what's the recommended way to write a test for this? I couldn't find a test for similar existing macro `#[whitelist_storage]`.
Closes #2560
Allows marking storage items with
#[disable_try_decode_storage]
, and uses it withSystem::Events
.Question: what's the recommended way to write a test for this? I couldn't find a test for similar existing macro
#[whitelist_storage]
.