Skip to content

Remove common_runtime prefix

Currently, the Duniter pallets are prefixed with common_runtime in the define_benchmarks macro https://git.duniter.org/nodes/rust/duniter-v2s/-/blob/master/runtime/gdev/src/lib.rs#L142-149. This prefix leads to an autogenerated weights.rs implementing impl<T: frame_system::Config> common_runtime::duniter_pallet::WeightInfo for WeightInfo<T> that triggered a compilation error.

The commun_runtime prefix seems to originate from https://github.com/paritytech/polkadot/blob/b30c015050373ace42236df8d74f7bbf10bdbb42/runtime/polkadot/src/lib.rs#L1453-L1469 which implements a very different architecture where each chain has its own weight files implementing the WeightInfo trait for each pallet. The prefixed runtime_common:: pallets define their WeightInfo inside the common_runtime pallet, so the path resolves correctly between the definition and the implementation.

In your case, the WeightInfo trait definition is located inside each pallet in the weights.rs file and the trait implementation inside the common_runtime. Replacing the common_runtime:: prefix by pallet_ will produce the correct weights.rs file defining the correct trait implementation impl<T: frame_system::Config> pallet_duniter_pallet::WeightInfo for WeightInfo<T> which compile and run perfectly.

Proposal: Replacing the common_runtime:: prefix by pallet_.

Edited by Benjamin Gallois
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information