Conversation
| impl pallet_sudo::Config for Runtime { | ||
| type RuntimeEvent = RuntimeEvent; | ||
| type RuntimeCall = RuntimeCall; | ||
| type WeightInfo = pallet_sudo::weights::SubstrateWeight<Runtime>; | ||
| } |
There was a problem hiding this comment.
Can you put this under some feature flag?
I'm fine with not having this on-chain, in the live runtime, but quickly swapping out live runtime with the one compiled locally with the enabled astar-sudo flag can be useful for quick debugging.
There was a problem hiding this comment.
I've added an astar-sudo feature flag to conditionally enable the Sudo pallet. However, construct_runtime! doesn't support #[cfg] attributes on individual pallets, leading to compilation issues. I also tried migrating to the newer #[frame_support::runtime] macro, but again same issues.
So I'm using a simple construct_astar_runtime! wrapper macro as a pragmatic solution to keep the code DRY. Happy to rework if you have a better approach or have dealt with feature-gated pallet inclusion before.
There was a problem hiding this comment.
So I'm using a simple construct_astar_runtime! wrapper macro as a pragmatic solution to keep the code DRY. Happy to rework if you have a better approach or have dealt with feature-gated pallet inclusion before.
What you might want to try is to use the new syntax for constructing the runtime, i.e. the new macro.
It's used in polkadot-sdk runtime template for example.
I did a quick try with it and managed to disable sudo pallet in another project in that way.
There was a problem hiding this comment.
What you might want to try is to use the new syntax for constructing the runtime, i.e. the new macro.
It's used in polkadot-sdk runtime template for example.
Are you suggesting this?
#[frame_support::runtime]
mod runtime {
#[runtime::runtime]
#[runtime::derive(
RuntimeCall,
RuntimeEvent,
RuntimeError,
RuntimeOrigin,
RuntimeFreezeReason,
RuntimeHoldReason,
RuntimeSlashReason,
RuntimeLockId,
RuntimeTask,
)]
pub struct Runtime;
#[runtime::pallet_index(10)]
pub type System = frame_system;
...
#[cfg(feature = "astar-sudo")]
#[runtime::pallet_index(99)]
pub type Sudo = pallet_sudo;
}
It doesn't compile, I think the entire runtime must be feature-gated:
There was a problem hiding this comment.
For me it compiled.
It might be due to the newer version of polkadot-sdk though.
The link you provided uses the old macro, and I agree and know that it doesn't support gating on the pallet level.
Dinonard
left a comment
There was a problem hiding this comment.
LGTM
We can revisit the macro after uplifts.
# Conflicts: # runtime/astar/src/lib.rs
a7abb24
runtime/shibuya/src/lib.rs
Outdated
|
|
||
| /// Unreleased migrations. Add new ones here: | ||
| pub type Unreleased = (); | ||
| pub type Unreleased = (pallet_collator_selection::migrations::LastAuthoredBlockCleanup<Runtime>,); |
There was a problem hiding this comment.
Don't you also need the XC asset migration for Shibuya?
There was a problem hiding this comment.
Correct, I forgot we did some testing for AH in Shibuya too, I have added it now.
Minimum allowed line rate is |
Pull Request Summary
Closes #1535