3

I have a parachain with no sudo pallet. However, in order to perform an upgrade, the first step authorize requires Root origin.

As a workaround, I have tried to run ForceScheduleCodeUpgrade from the relay chain, but after the upgrade takes place, the parachain panics with the following log:

2023-06-08 16:48:48 [Parachain] panicked at 'No new validation function found in storage, GoAhead signal is not expected', /home/c/.cargo/git/checkouts/cumulus-59522f43471fa161/422a22c/pallets/parachain-system/src/lib.rs:396:21    
2023-06-08 16:48:48 [Parachain] 1 storage transactions are left open by the runtime. Those will be rolled back.    
2023-06-08 16:48:48 [Parachain] 1 storage transactions are left open by the runtime. Those will be rolled back.    
2023-06-08 16:48:48 [Parachain] ❗️ Inherent extrinsic returned unexpected error: Error at calling runtime api: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed

Is there any way to perform the upgrade without having to set everything up from scratch, including the sudo pallet?

1 Answer 1

1

The first step is correct.

However, for the second step, you should call parachain_system::enact_authorize_upgrade on the parachain side. This function can be called by anyone and it's free if successful, but that account still needs some funds, the system will charge a fee which will be returned upon success.

5
  • Sorry, maybe I didn't mention it explicitly. I meant I cannot complete first step because parachain doesn't have the sudo pallet. As a workaround, I tried to force the upgrade from the relay chain using "ForceScheduleCodeUpgrade", but I got the panic mentioned above.
    – magecnion
    Commented Jun 8, 2023 at 19:15
  • 1
    Your parachain should have at least the democracy or sudo pallet. Otherwise, it's not correct. If your parachain has the democracy pallet, use it to send the authorize_upgrade. Any call can be dispatched with root origin once the democracy referenda pass.
    – AurevoirXavier
    Commented Jun 9, 2023 at 1:04
  • My parachain uses the default pallets used in the official template: github.com/substrate-developer-hub/substrate-parachain-template/…. I don't see either the sudo or democracy pallet. So according to your comment is there no way to perform an upgrade at all? Not even from the relay chain?
    – magecnion
    Commented Jun 9, 2023 at 8:25
  • 1
    There are some ways to do that. But it's really tricky. You should always use sudo or democracy instead do it on the relaychain side. Otherwise, it requires the root origin on relaychain which makes things much more complicated.
    – AurevoirXavier
    Commented Jun 9, 2023 at 8:45
  • I'd really appreciate it if you could guide me or point me to where I can find some guidelines to do that. I'd like to try it before starting the system from scratch and including the sudo pallet @AurevoirXavier
    – magecnion
    Commented Jun 23, 2023 at 8:27

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