Inline pallets#600
Conversation
Copy upstream pallet-timestamp v44.0.0 from polkadot-sdk into pallets/timestamp and switch the workspace dependency from crates.io to the local path, so the pallet source is in-tree and auditable. Co-authored-by: Cursor <cursoragent@cursor.com>
Copy upstream pallet-balances v46.0.0 from polkadot-sdk into pallets/balances and switch the workspace dependency from crates.io to the local path, so the pallet source is in-tree and auditable. Co-authored-by: Cursor <cursoragent@cursor.com>
Copy upstream pallet-utility v45.0.0 from polkadot-sdk into pallets/utility and switch the workspace dependency from crates.io to the local path, so the pallet source is in-tree and auditable. Dev-only test dependencies (pallet-collective, pallet-root-testing) are pulled from crates.io at the matching v45 release line. Co-authored-by: Cursor <cursoragent@cursor.com>
Copy upstream pallet-preimage v45.0.0 from polkadot-sdk into pallets/preimage and switch the workspace dependency from crates.io to the local path, so the pallet source is in-tree and auditable. Co-authored-by: Cursor <cursoragent@cursor.com>
Copy upstream pallet-recovery v45.0.0 from polkadot-sdk into pallets/recovery and switch the workspace dependency from crates.io to the local path, so the pallet source is in-tree and auditable. This pallet uses the polkadot-sdk-frame umbrella crate, so add `frame` (polkadot-sdk-frame v0.14.0) to the workspace dependencies. Co-authored-by: Cursor <cursoragent@cursor.com>
Review: PR #600 "Inline pallets" (link)What it doesVendors 5 polkadot-sdk pallets from crates.io into
Fidelity — verified cleanI downloaded each exact upstream version from crates.io and diffed against the vendored copies. Every
So the trusted-computing-base goal is met with no behavioral change. The dev-dependencies were correctly reconstructed (crates.io strips them): Blocking issue — Clippy CI is failing ❌
Root cause: each vendored [lints]
workspace = truewhich inherits the workspace's strict production lints: [workspace.lints.clippy]
# Deny unwrap and panic in production code (runtime & pallets)
# Test code can opt-out using: #![allow(clippy::unwrap_used, clippy::panic)]
panic = "deny"
unwrap_used = "deny"
# Also deny expect_used for consistency
expect_used = "deny"Upstream uses Recommended fix (preserves verbatim vendoring): replace Other notes
VerdictVendoring is faithful and the wiring is correct — this is a clean, low-risk-of-drift change despite the "High Risk" label. Don't merge until the Clippy lint config on the vendored crates is fixed and the build matrix goes green. Want me to apply the lint-config fix (swap |
|
I think we need to change the lint settings in the vendored crates to be less strict, as suggested above |
`derive_dev_account` is Quantus-authored code, so it must follow the project's no-expect/unwrap/panic policy. Return a `Result` and propagate failures via `?`, and have the genesis builder `assert!` on the result (consistent with the surrounding genesis assertions). Co-authored-by: Cursor <cursoragent@cursor.com>
FRAME's pallet macros (#[pallet::pallet], #[pallet::storage], #[pallet::error], ...) expand to code that uses expect/unwrap, which trips the workspace clippy restriction lints. The other vendored pallets (scheduler, treasury, frame-system) already opt out, so drop the `[lints] workspace = true` table from balances, timestamp, utility, preimage and recovery for consistency. The no-expect/unwrap/panic policy remains enforced on Quantus-authored crates. Co-authored-by: Cursor <cursoragent@cursor.com>
Just vendor / inline some pallets so we can have our trusted computing base fully under our control.
Note
High Risk
Inlining pallet-balances and related core FRAME pallets changes how account balances and issuance are built and reviewed; any drift from upstream Substrate behavior would affect the entire chain economy.
Overview
Moves several polkadot-sdk pallets from crates.io into the repo so the runtime’s trusted computing base is built from local sources.
Cargo.tomlnow resolvespallet-balances,pallet-preimage,pallet-recovery,pallet-timestamp, andpallet-utilityviapath = "./pallets/...", adds those crates to the workspace members, and wires a workspaceframealias forpolkadot-sdk-frame.Cargo.lockis updated for path-based packages and dev-test dependencies (e.g.pallet-utilitytests pulling inpallet-balances,pallet-collective,pallet-root-testing,pallet-timestamp).The diff includes a full in-tree
pallet-balances(v46.0.0): lib, currency/fungible impls, migrations, benchmarks, weights, and extensive unit tests—intended as a vendored copy rather than new balance semantics in this PR.Reviewed by Cursor Bugbot for commit fdfa5b1. Configure here.