Inline pallets 2#601
Conversation
Copy upstream pallet-transaction-payment (v45.0.0), its -rpc-runtime-api (v45.0.0) and -rpc (v48.0.0) crates from polkadot-sdk into pallets/ and switch the workspace dependencies from crates.io to local paths. The three are version-coupled, so they are inlined together to avoid two copies of pallet-transaction-payment in the tree. Adds sp-rpc to the workspace dependencies for the -rpc crate. Co-authored-by: Cursor <cursoragent@cursor.com>
Copy upstream pallet-assets (v48.1.0) and pallet-assets-holder (v0.8.0) from polkadot-sdk into pallets/ and switch the workspace dependencies from crates.io to local paths. assets-holder depends on assets, so they are inlined together to avoid two copies of pallet-assets in the tree. Adds impl-trait-for-tuples to the workspace dependencies for pallet-assets. Co-authored-by: Cursor <cursoragent@cursor.com>
Copy upstream pallet-referenda v45.0.0 from polkadot-sdk into pallets/referenda and switch the workspace dependency from crates.io to the local path. Co-authored-by: Cursor <cursoragent@cursor.com>
Copy upstream pallet-conviction-voting v45.0.0 from polkadot-sdk into pallets/conviction-voting and switch the workspace dependency from crates.io to the local path. Co-authored-by: Cursor <cursoragent@cursor.com>
Copy upstream pallet-ranked-collective v45.0.0 from polkadot-sdk into pallets/ranked-collective and switch the workspace dependency from crates.io to the local path. Co-authored-by: Cursor <cursoragent@cursor.com>
The vendored referenda tests targeted the upstream scheduler. Adapt the mock to the in-tree timestamp-aware pallet-scheduler (Moment/TimeProvider/ TimestampBucketSize instead of RuntimeEvent/BlockNumberProvider) and update the alarm assertions to use BlockNumberOrTimestamp task addresses. Co-authored-by: Cursor <cursoragent@cursor.com>
defensive_assert! only panics with debug_assertions, but CI runs tests in --release. Gate the #[should_panic] variant to debug builds and add a release-build counterpart asserting died still clears hold state without panicking. Co-authored-by: Cursor <cursoragent@cursor.com>
|
I verified the inlined pallets against the actual upstream releases pulled from crates.io (the published polkadot-sdk source at each stated version). Here's the result. Verdict: ✅ No production code was changedAll non-test source files are byte-for-byte identical to upstream. The only MethodologyDownloaded each crate at its declared version from crates.io and ran a recursive diff against the inlined
File sets also match exactly (no added/dropped source files; upstream's packaged The only source changes (test-only, all justified)
These are unavoidable: the upstream tests target the vanilla scheduler, but this repo already vendors a timestamp-aware scheduler. Manifest / workspace changes (non-functional)
Minor notes (not blockers)
Bottom line: the inlining is clean — production logic is an exact copy of the upstream releases, and the only edits are the minimum test/mock adaptations needed to compile against this repo's existing in-tree scheduler and |
Inline several pallets
Note
Medium Risk
Large vendored copies of fee, asset, and governance pallets increase maintenance and merge risk, but behavior should match upstream unless later patched locally.
Overview
Vendors several Polkadot SDK FRAME pallets into
pallets/and wires the workspace to use localpathdependencies instead of crates.io version pins forpallet-assets,pallet-assets-holder,pallet-conviction-voting,pallet-ranked-collective,pallet-referenda, and thepallet-transaction-paymentfamily (including RPC crates).The workspace member list and root
Cargo.toml/Cargo.lockare updated accordingly (e.g.impl-trait-for-tuples,sp-rpc, and extra dev-dependencies such aspallet-balances/sp-ioon vendored crates). Vendored crate manifests note that upstream pallet macros still expand toexpect/unwrap, so workspace restriction lints are not applied there.For assets, this PR adds the full in-tree
pallet-assetsimplementation pluspallet-assets-holder, which implementsBalanceOnHoldand fungibles hold traits so other pallets can reserve asset balances;pallet-assetsis configured to useHolderfor hold/freeze-aware transfers and account teardown.Reviewed by Cursor Bugbot for commit 5bb6f43. Configure here.