0

My pallet is using the following frame pallets: Democracy, Utility & Collective. The error I get is:

cycle used when elaborating drops for `<impl at /home/kazu/Polkadot/fair-squares/runtime/src/lib.rs:634:1: 652:10>::clone`  
    --> /home/kazu/Polkadot/fair-squares/runtime/src/lib.rs:634:1 
    635 | ||     pub struct Runtime  
    ...   ||  
    651 | ||         Utility: pallet_utility,  
    634 | // construct_runtime!(  
    652 | ||         Council: pallet_collective::<Instance1>,  
        | ||_________^  

I have two instances of collective, but I'm using only Instance1 in this pallet. The trait Config is as follows:

    type RuntimeCall: Parameter
                + Dispatchable<RuntimeOrigin = <Self as frame_system::Config>::RuntimeOrigin, PostInfo = PostDispatchInfo>  
                + GetDispatchInfo  
                + From<frame_system::Call<Self>>  
                + UnfilteredDispatchable<RuntimeOrigin = <Self as frame_system::Config>::RuntimeOrigin>  
                + IsSubType<Call<Self>>  
                + IsType<<Self as frame_system::Config>::RuntimeCall>;  

I really can't figure out the problem with RuntimeCall definition. Any idea on how I can solve this error...PLEASE?

Kazunobu

9
  • Config is not there edit the question. Sep 12 at 4:55
  • I can't edit the post for some reason... I keep getting:An error occurred submitting the edit. Sep 12 at 5:03
  • Can you post what error are you facing? Sep 12 at 5:41
  • cycle detected when computing layout of RuntimeCall Sep 12 at 5:53
  • Once try with Self:: RuntimeOrigin instead of <Self as frame_system::Config>::RuntimeOrigin, I think it should work Sep 12 at 6:17

1 Answer 1

0

After several experimentations, It seems that adding both pallet_democracy::Config & pallet_collective::Config to the Config of one pallet (Tight pallet coupling) is the source of the problem. This is probably related to the change of types implemented in the Democracy pallet (It was not a problem up to polkadot-v0.9.40~...) I think the solution is then to create two separate pallets:

  • One to Create the whole Democracy governance process and output the necessary call
  • One more to receive the democracy_call (as the call enacted at the end of collective), format it, and start the collective process.

I haven't seen many projects (actually I haven't seen any...) using both pallets the way we do, so I get that it was not an issue until now. Any additionnal information is welcome.

Kazu

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.