Skip to content

Use new runtime macro#1584

Merged
ipapandinas merged 5 commits intomasterfrom
chore/new-runtime-macro
Jan 26, 2026
Merged

Use new runtime macro#1584
ipapandinas merged 5 commits intomasterfrom
chore/new-runtime-macro

Conversation

@ipapandinas
Copy link
Contributor

@ipapandinas ipapandinas commented Jan 22, 2026

No description provided.

@ipapandinas ipapandinas added shiden related to shiden runtime astar Related to Astar shibuya related to shibuya runtime This PR/Issue is related to the topic “runtime”. labels Jan 22, 2026
@Dinonard
Copy link
Contributor

I tried to reproduce the working solution in the other repo, and I was unsuccessful.

Checked polkadot-sdk macro and pallet_index parsing, I don't see any cfg handling.
But I'm not that good at procedural macros so I might be missing something.

It's fine to close this PR, or ask for help from polkadot-sdk repo maintainers.

@ipapandinas
Copy link
Contributor Author

@Dinonard I found the issue and a workaround. The runtime macro handles #[cfg] correctly for explicit pallet declarations (with '+' pallet parts syntax) but NOT for implicit ones. Also, I removed optional = true from pallet-sudo, this is needed for macro expansion otherwise I face this error: "use of unresolved module or unlinked crate pallet_sudo" (another bug in the macro). I will open an issue in the polkadot-sdk repo, but this solution works for now, PR is ready for review.

@ipapandinas ipapandinas marked this pull request as ready for review January 26, 2026 09:41
@ipapandinas ipapandinas changed the title (wip) Use new runtime macro Use new runtime macro Jan 26, 2026
Copy link
Contributor

@Dinonard Dinonard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with the solution, but did you run cargo update?

@ipapandinas
Copy link
Contributor Author

@Dinonard cargo update done ☑️

@Dinonard
Copy link
Contributor

@ipapandinas sorry, that was a question since I noticed PR has huge amount of LoC updates, and then I saw it's becaus .lock file is updated.

I don't think you should do it, in order to minimize the changes.
Right now this changes literally everything.

@ipapandinas
Copy link
Contributor Author

I misunderstood it, maybe I did a cargo update during my tests, it's reverted now

@github-actions
Copy link

Code Coverage

Package Line Rate Branch Rate Health
precompiles/dispatch-lockdrop/src 89% 0%
primitives/src/xcm 66% 0%
pallets/vesting-mbm/src 87% 0%
precompiles/assets-erc20/src 77% 0%
pallets/collective-proxy/src 94% 0%
pallets/xc-asset-config/src 57% 0%
pallets/dapp-staking/rpc/runtime-api/src 0% 0%
precompiles/unified-accounts/src 100% 0%
pallets/dynamic-evm-base-fee/src 84% 0%
precompiles/dapp-staking/src 89% 0%
primitives/src 55% 0%
pallets/ethereum-checked/src 76% 0%
pallets/astar-xcm-benchmarks/src/generic 100% 0%
pallets/astar-xcm-benchmarks/src/fungible 100% 0%
chain-extensions/pallet-assets/src 55% 0%
precompiles/sr25519/src 69% 0%
precompiles/substrate-ecdsa/src 74% 0%
pallets/unified-accounts/src 80% 0%
pallets/price-aggregator/src 75% 0%
chain-extensions/types/unified-accounts/src 0% 0%
chain-extensions/unified-accounts/src 0% 0%
pallets/collator-selection/src 82% 0%
pallets/dapp-staking/src/test 0% 0%
pallets/democracy-mbm/src 30% 0%
pallets/inflation/src 58% 0%
pallets/static-price-provider/src 91% 0%
precompiles/dapp-staking/src/test 0% 0%
precompiles/xcm/src 69% 0%
chain-extensions/types/assets/src 0% 0%
pallets/dapp-staking/src/benchmarking 95% 0%
pallets/dapp-staking/src 81% 0%
pallets/astar-xcm-benchmarks/src 86% 0%
Summary 73% (3888 / 5359) 0% (0 / 0)

Minimum allowed line rate is 50%

Copy link
Contributor

@Dinonard Dinonard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't verified the pallet indexes before and after.

@ipapandinas ipapandinas merged commit 4d2076f into master Jan 26, 2026
9 checks passed
@ipapandinas ipapandinas deleted the chore/new-runtime-macro branch January 26, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

astar Related to Astar runtime This PR/Issue is related to the topic “runtime”. shibuya related to shibuya shiden related to shiden runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants