-
Notifications
You must be signed in to change notification settings - Fork 114
Description
Hi, I'd like to test and simulate the runtime upgrade locally by forking off a LIVE running parachain and execute the runtime upgrade programmatically with locally built new wasm / github release.
Here're my scripts:
- https://github.com/litentry/heima/blob/p-1728-runtime-upgrade-simulation-ci-fails/parachain/scripts/runtime-upgrade.sh
- https://github.com/litentry/heima/blob/p-1728-runtime-upgrade-simulation-ci-fails/parachain/ts-tests/integration-tests/runtime-upgrade.test.ts
I don't have sudo pallet so the authorization needs to be done via democracy.
I launch the parachain + relaychain network via chopsticks xcm and follow the system.authorize => system.apply way.
Locally the script runs well until trying to apply the upgrade (= authorization was done), then I always got error:
Apply upgrade transaction sent ✅
Transaction events: 2
Event: system.ExtrinsicSuccess {
dispatchInfo: {
weight: { refTime: '238,427,000', proofSize: '1,493' },
class: 'Mandatory',
paysFee: 'Yes'
}
}
Event: system.ExtrinsicSuccess {
dispatchInfo: {
weight: { refTime: '108,157,000', proofSize: '0' },
class: 'Mandatory',
paysFee: 'No'
}
}
Event: system.ExtrinsicFailed {
dispatchError: { Module: { index: '0', error: '0x02000000' } },
dispatchInfo: {
weight: { refTime: '99,184,662,000', proofSize: '67,035' },
class: 'Operational',
paysFee: 'Yes'
}
}
So it seems to error out with 0x02000000 from system pallet, which is FailedToExtractRuntimeVersion. It happens when sp_io::misc::runtime_version fails to extract the runtime version from the wasm.
I'm not sure why it occurs - the newly built wasm is compressed (~2MB), but sp_io::misc::runtime_version should be able to deal with compressed wasm too.
I also suspect that chopsticks/smoldot expects uncompressed wasm when calling the host fn, so I try to use uncompressed wasm when applying the upgrade, but ended up having a resourceExhausted error (so it's too large and can't fit into block weight I assume).
I'm kind of stuck on this - could you help with it? Or if you have links/docs about how to simulate runtime upgrade for a LIVE parachain, I'm happy to read them too!