Not my idea, I stumbled across this discussion by @xlc and I’m here basically to re-post it so it doesn’t go stale, I’m also pretty sure it’s been discussed in other channels already and offline but here it might be a better place to talk about it.
Original post by @xlc
Currently FRAME offers a set of generalized & reusable pallets but the size is still small and we don’t really have much external contributors submitting pallets to FRAME. A few reasons that I can think of are:
- Making PR and getting it merged to Substrate can be hard. Core devs are busy and don’t always have time to review the change.
- We don’t have any predictable release cycle for Substrate. This creates a big uncertainty on when the newly contributed changes will be available to downstream projects.
- Pallets in Substrate should be generalized, but that come with cost of making code harder to write.
- The pallets in Substrate cannot use anything from Polkadot or Cumulus. i.e. No XCM related pallet.
To workaround some of the above issues, we at Acala created ORML aims to provide a set of reusable pallets that covers more use cases such as multi token and XCM utility. It is currently used by at least 7 live parachains we are start receiving community contributed pallets into ORML. However, this is still not ideal.
Problems (and rants)
ORML as a separate repo, it can be hard for external team to include it. In the end, it is another 3rd party deps that needs to be carefully managed to ensure the version aligns. Specially that Substrate is not published to crates.io and therefore people cannot use cargo to manage the versions. They need to manually pick the right branch or there will be compiler error.
While I believe most of core devs for Substrate are aware of ORML, the development are completely separated and we end up with a lot of similar but incompatible pallets. A few examples are:
vesting
Vesting Module open-web3-stack/open-runtime-module-library#76
NFT
Add nft module open-web3-stack/open-runtime-module-library#296
tokens
And we need to remove features from ORML because they have been implemented in Substrate. Occasionally that’s due to our own contribution as we still want the features to be maintained in Substrate as much as possible.
Use AtLeast32Bit & AtLeast32BitUnsigned open-web3-stack/open-runtime-module-library#222
Remove Fixed128 open-web3-stack/open-runtime-module-library#145
remove build-script-utils open-web3-stack/open-runtime-module-library#695
On top of that, there are a lot of almost required pallet for parachains that are not provided by Substrate/Polkadot/Cumulus and end up been multiple incompatible implementations between all the parachains. I only checked a handful of parachains so this is not a complete list.
- Ability to dynamically pause transaction via governance
- Acala: https://github.com/AcalaNetwork/Acala/blob/af52c13dd917191cab218fc4bc6694bcd9e396e5/modules/transaction-pause/src/lib.rs
- Bifrost: https://github.com/bifrost-finance/bifrost/blob/a24199ea33d3acfb660fc20721d99c12bd700d69/pallets/call-switchgear/src/lib.rs
- Manta: https://github.com/Manta-Network/Manta/tree/manta/pallets/tx-pause
- Moonbeam: https://github.com/PureStake/moonbeam/blob/7723ecabaa0d2c1f66957781894efa2f895f5eec/pallets/maintenance-mode/src/lib.rs
- Parallel: https://github.com/parallel-finance/parallel/blob/cf612014b271a1dbf496baed370ad36631c77119/pallets/emergency-shutdown/src/lib.rs
- Asset registry to manage token metadata and XCM MultiLocation
- ORML, contributed by Interlay, reviewed by Acala: https://github.com/open-web3-stack/open-runtime-module-library/blob/2c48b626addafbea0227c068c9ab0fc16666b1b5/asset-registry/src/lib.rs
- Acala: https://github.com/AcalaNetwork/Acala/blob/af52c13dd917191cab218fc4bc6694bcd9e396e5/modules/asset-registry/src/lib.rs
- Bifrost: https://github.com/bifrost-finance/bifrost/blob/a24199ea33d3acfb660fc20721d99c12bd700d69/pallets/asset-registry/src/lib.rs
- HydraDX: https://github.com/galacticcouncil/warehouse/blob/cf387fcd80151c9feb973552ac9a9ee8aee9935e/asset-registry/src/lib.rs
- Manta: https://github.com/Manta-Network/Manta/blob/bfa08d62c5e93d4abd65c3d844494135b745d8d6/pallets/asset-manager/src/lib.rs
- Moonbeam: https://github.com/PureStake/moonbeam/blob/7723ecabaa0d2c1f66957781894efa2f895f5eec/pallets/asset-manager/src/lib.rs
- Parallel: https://github.com/parallel-finance/parallel/blob/cf612014b271a1dbf496baed370ad36631c77119/pallets/asset-registry/src/lib.rs
- Ability to pay tx fee using different tokens
- Substrate: https://github.com/paritytech/substrate/blob/759148506b6460a0ae6d2422d7b56b6452f0b114/frame/transaction-payment/asset-tx-payment/src/lib.rs
- Acala: https://github.com/AcalaNetwork/Acala/blob/af52c13dd917191cab218fc4bc6694bcd9e396e5/modules/transaction-payment/src/lib.rs
- Bifrost: https://github.com/bifrost-finance/bifrost/blob/a24199ea33d3acfb660fc20721d99c12bd700d69/pallets/flexible-fee/src/lib.rs
- HydraDX: https://github.com/galacticcouncil/warehouse/blob/cf387fcd80151c9feb973552ac9a9ee8aee9935e/transaction-multi-payment/src/lib.rs
And we have different flavor of collector-selection, xcm utility etc. Everyone are referencing each others and making their own pallets but with their own twist to fit their own requirements. This means wallets, blockchain explorers, any multi chain tools are very hard to be compatible with all the parachains. We have PSPs but I would leave it out for now as it isn’t really helping.
All the Substrate developers needs to unite together to change the current situation so that we can focus on our own core business logic, instead spend all the time to implement logics required to run a L1 such as token handling, governance, XCM, etc.
I believe most of the Substrate developers are aware most the issues I raised here, but the fact we are still here is mainly due the the issues are not easy to solve. But the issues aren’t going to solve itself so I am making this a discussion post, trying to identify where we want to be, and laying down a path towards there. Please help contribute your ideas to refine the tasks and help contribute followup issues and PRs to make this happen. But of course we will also need full support from Parity team as it requires restructure of the Substrate repo as well. Please signaling your support by upvote issue discussion.