-
Notifications
You must be signed in to change notification settings - Fork 2.6k
construct_runtime should be order independent #13491
Comments
Either that or we have it as a hard fail if the pallets are not defined in numerical order? - yes that might be nicer given that non-explicit indices are assigned based on the last index that has been come across. |
People seem to like that they don't have to specify the pallets in strict numerical order so we should sort the pallets by index before we generate the runtime. |
We really need a policy requires all the breaking change proposal to be sufficiently communicated & discussed first to minimize potential impacts to downstream projects. cc @bkchr @gavofyork The pallet order determines the hook order. So this is a hard to notice breaking change that will break invariants some chain may have. |
Yes, I know that these are breaking changes and I'm also against them. There is no real justifications to do this. Polkadot-js could also just order them by index, but in general I don't see any reason why that is even important. The general idea to have more control over the order etc makes sense nevertheless and there are already some ideas around some new Please post a gist of this issue in the linked issue or we create a totally new issue |
Jan pointed out that this could be implemented by making it a compile error if an attribute was not added to |
Just had another dev hit this. It's not fixed. |
Can you please just do what I said? |
Description of bug
should generate identical code to:
I know there's special carve outs for the ordering of System in the generated code, but the above two inputs to the construct runtime should produce identical outputs.
(Found out the hard way that they are not currently producing the same code: polkadot-js/apps#9077 )
The current differences seem to be
AllPalletsWithinSystem
ordering, enumCall
ordering,get_module_names
and the results of themetadata
call order.The text was updated successfully, but these errors were encountered: