1

From what I see in the code, the Executive pallet controls the hook order via one of the passed parameters AllPallets, AllPalletsReversed, etc. that depend upon the declaration order in construct_runtime!.

I'm finding it difficult to figure out, what determines the Genesis build order, e.g. balances before staking. Is it purely dependent also on the declaration order in construct_runtime!? If yes, is it possible to somehow change the order as well?

1 Answer 1

2

The order of building genesis is the same as the declaration order in construct_runtime. I don't think you can change that without touching construct_runtime.

2
  • Thanks for the confirmation. Could you also perhaps point me to the code in construct_runtime! macro that is responsible for the generation of genesis execution/ordering? Commented Nov 3, 2022 at 10:58
  • 1
    One of the chain runtime types that construct_runtime expands and creates is called GenesisConfig for which the trait BuildStorage is implemented and there it goes over another runtime type called AllPalletsWithSystem which is a tuple constructed of all the pallets according to their declaration order. Have a look at: github.com/paritytech/substrate/blob/polkadot-v0.9.30/frame/… Finally when the client builds the chain-spec it uses that GenesisConfig type from the runtime. Commented Nov 8, 2022 at 4:37

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.