I am running a simple 2-validator substrate chain with my own keys (https://github.com/paritytech/substrate, branch = polkadot-v0.9.27). I have removed pallet-gilt
from the runtime and what I am trying to do is a runtime upgrade (with the setCode
extrinsic) and add pallet-gilt
to the runtime. The upgrade is successful but the chain breaks just before the intake_duration
of pallet-gilt. The error I am getting is the following:
2022-11-04 16:04:18 panicked at 'index out of bounds: the len is 0 but the index is 299', /Users/zycon/cherry/substrate/frame/gilt/src/lib.rs:600:28
2022-11-04 16:04:18 Proposing failed: Import failed: Error at calling runtime api: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed
WASM backtrace:
0: 0x4a57eb - <unknown>!rust_begin_unwind
The function that contains the line of code that breaks is the following: https://github.com/paritytech/substrate/blob/5bfdbab8ba28523ef10e365627fed64ef2b77cbf/frame/gilt/src/lib.rs#L585-L660
That only happens when I try to add pallet-gilt
to an already running chain. If I add pallet-gilt
to genesis and start the chain with the pallet, I have no errors.