Skip to content
On this page

🔄 How to restart your rollup

This guide will teach you how to restart your Rollkit rollup.

Restart rollup

This section covers the case where you need to restart your rollup.

In order to restart your rollup, you will need to run the <your-binary>d start [...args] command for your rollup. This is the example for the GM world tutorial.

For the GM world tutorial, you can restart the chain by running the restart-local.sh script that was generated by init-local.sh.

Use the DA_START_HEIGHT, NAMESPACE, and AUTH_TOKEN variables from your original start command.

Using the gmd rollup as an example, you can add something similar to your respective start script to make it easier to save variables for later use:

bash
# the rest of your init script

# create a restart-local.sh file to restart the chain later
rm restart-local.sh
echo "DA_BLOCK_HEIGHT=$DA_BLOCK_HEIGHT" >> restart-local.sh
echo "NAMESPACE=$NAMESPACE" >> restart-local.sh
echo "AUTH_TOKEN=$AUTH_TOKEN" >> restart-local.sh
echo "gmd start --rollkit.aggregator --rollkit.da_auth_token=\$AUTH_TOKEN --rollkit.da_namespace \$NAMESPACE --rollkit.da_start_height \$DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --grpc.address 127.0.0.1:9290 --p2p.laddr \"0.0.0.0:36656\"" >> restart-local.sh

Restart rollup after running out of funds

This section covers the case that the node that you are using to post blocks to your DA and consensus layer runs out of funds (tokens), and you need to restart your rollup.

In this example, we're using Celestia's Mocha testnet and running a GM world rollup. In this example, our Celestia DA light node ran out of Mocha testnet TIA and we are unable to post new blocks to Celestia due to a Code: 19 error. This error is defined by Cosmos SDK as:

go
// ErrTxInMempoolCache defines an ABCI typed error where a tx already exists in the mempool.
ErrTxInMempoolCache = Register(RootCodespace, 19, "tx already in mempool")

In order to get around this error, and the same error on other Rollkit rollups, you will need to re-fund your Celestia account and increase the gas fee. This will override the transaction that is stuck in the mempool.

If you top up the balance of your node and don't increase the gas fee, you will still encounter the Code: 19 error because there is a transaction (posting block to DA) that is duplicate to one that already exists. In order to get around this, you'll need to increase the gas fee and restart the chain.

🟠 Errors in this example

This is what the errors will look like if your DA node runs out of funding or you restart the chain without changing the gas fee:

bash
4:51PM INF submitting block to DA layer height=28126 module=BlockManager
4:51PM ERR DA layer submission failed error="Codespace: 'sdk', Code: 19, Message: " attempt=1 module=BlockManager
4:51PM ERR DA layer submission failed Error="Codespace: 'sdk', Code: 19, Message: " attempt=2 module=BlockManager
4:51PM ERR DA layer submission failed error="Codespace: 'sdk', Code: 19, Message: " attempt=3 module=BlockManager

💰 Re-fund your account

First, you'll need to send more tokens to the account running your Celestia node. If you didn't keep track of your key, you can run the following to get your address:

bash
cd $HOME && cd celestia-node
./cel-key list --keyring-backend test --node.type light --p2p.network <network>

🛑 Stopping your rollup

You can stop your gm chain (or other Rollkit rollup) by using Control + C in your terminal where the node is running.

⛽ Increase the gas fee

To reiterate, before restarting the chain, you will need to increase the gas fee in order to avoid a Code: 19 error:

bash
gmd start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace $NAMESPACE --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --grpc.address 127.0.0.1:9290 --p2p.laddr "0.0.0.0:36656"

🔁 Restarting your rollup

Follow the restart rollup section above.

🛢️ Reduce gas fee & restart again

In order to save your TIA, we also recommend stopping the chain with Control + C, changing the gas fee back to the default (in our case, 8000 utia) and restarting the chain:

bash
gmd start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace $NAMESPACE --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --grpc.address 127.0.0.1:9290 --p2p.laddr "0.0.0.0:36656"

🎊 Congrats! You've successfully restarted your Rollkit rollup after running out of TIA.

Released under the APACHE-2.0 License