# Unbrick Bitgreen Parachain
Due to a human error, the upgraded Bitgreen parachain (paraId : 2048) on Polkadot has ended up with an empty validator set, unable to produce new blocks.
## What Happened
The bitgreen parachain was upgraded from a shell runtime to our latest runtime code at block [191202](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fmainnet.bitgreen.org#/explorer/query/0x930f3a6fd2b8ea2f650491ca1edc694a6d4c02e1f963b7ca2de310d918eea62f).
The upgrade executed without issues and the parachain continued to produce blocks. The upgraded parachain runtime introduced a couple of new pallets, the pallet-parachain-staking among them. This new pallet was responsible to assign new validators to session pallet and by extension the aura pallet. After the runtime upgrade, when a new session was triggered, it set the new authorities to an empty set since the pallet-parachain-staking was not set with any initial values.
![](https://i.imgur.com/1aiZ5r9.png)
We tested the upgrade numerous times, once locally, then within our self hosted relaychain-parachain network and finally with our test parachain in Rococo. In all three instance the upgrade executed without issues. We did not encounter this error since after the upgrade we always tested the parachain staking logic and this ensured that for the next session rotation we always had candidates within the parachain-staking pallet. This was the intended plan for the polkadot parachain aswell, but due to unfortunate circumstances we could not go through with it.
## Remedy
To unbrick the chain and to be able to produce blocks again we would have to rollback to a state before the session rotation and then set the invulnerables to our existing validator accounts, so that in the upcoming session rotation these validators will be populated and the chain would continue to produce blocks. **We opted for the simplest and fastest solution which is to rollback to our initial genesis state.**
We will be creating the proposal to use the genesis-state and genesis-wasm used during para registration (and crowdloan), found [here](https://polkadot.subscan.io/extrinsic/11023701-2)
The proposal transaction will be a `utility.batch` call containing the calls `paras.forceSetCurrentCode(2048,genesisCode)` and `paras.forceSetCurrentHead(2048,genesisHead)`.
## Testing the fix
We tested the fix locally and in our deployed testnet that uses similar config to the deployed parachain.
1. Started a local relaychain and used the shell parachain to onboard
![](https://i.imgur.com/gDBnrAu.png)
2. Performed a runtime upgrade to the v1.0.1 runtime
![](https://i.imgur.com/Jp4dq4D.png)
3. The chain halts at the next session rotation
![](https://i.imgur.com/uLPkSoW.png)
4. Make the batch call to update the parachain code and head to genesis values
![](https://i.imgur.com/YW6JjQy.png)
5. Restarting the collators and the chain starts producing blocks from block 0
![](https://i.imgur.com/rEAVnLk.png)
## Consequences
**The shell parachain was still at genesis state, apart from trivial internal transfer tests. Therefore, no one is affected by rolling the state back to genesis. No data nor funds are lost.**
## Preimage
genesis-state -
`0x0000000000000000000000000000000000000000000000000000000000000000004bde6affb8214fb44dcc4dc2d435085cb4e28c304d8d7b1b50187ace1ea4c8b903170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c11131400`
genesis-wasm - https://gcs.subscan.io/Parachain/wasm/polkadot/0x98ddf0a82b230841180cd74dec3b79f5081439c5715c2b27c49a99a323f71562
genesis-wasm checksum - `fd935ee81bced601b270152b5ede0db2b480ce03b44e4ca636a9ec24ff1633a9`
genesis-state checksum - `07d4d63a0d20451b013c940be3942cf7e25d948871229204a2685186b1b8c90e`
Submitted Preimage in Polkadot
![](https://i.imgur.com/6TQWQMu.png)
Preimage Hash : `0xfc0c33d0c0ae08d940fddadb11e239710da69b8660eaae7f77ea102a331e4ebe`
## Council Proposal
Democracy Proposal Open here : https://polkadot.polkassembly.io/proposal/20
We are aware of the recent discussion around the technical council circumventing due process on governance here: https://forum.polkadot.network/t/how-to-recover-a-parachain/673/23 and withdrawing from fixing broken parachains. However there is currently not a best practice solution other then avoiding mistakes.
**We have explored all other solutions and after discussion and advice from Parity devs have created this proposal. Our humble request to the TC is to fastrack this proposal, this is purely a technical rollback since our chain has no user transactions or funds yet. We would like to distribute token rewards as soon as possible. Similar parachain resets ([#1947](https://kusama.polkassembly.io/post/1947), [#443](https://kusama.polkassembly.io/motion/443), [#59](https://polkadot.polkassembly.io/referendum/59), [#177](https://polkadot.polkassembly.io/motion/177)) have been fastracked by the TC in the past and we request that our proposal be fastracked aswell.**