Skip to content

Commit dda588f

Browse files
authored
fix: metrics, reset chain state, restart rollup (#593)
* fix restart-rollup * fix reset-state * remove old metrics * fix scripts
1 parent 0e5ef38 commit dda588f

File tree

7 files changed

+48
-72
lines changed

7 files changed

+48
-72
lines changed

guides/metrics.md

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -12,53 +12,15 @@ Metrics will be served under `/metrics` on port 26660 by default. The listening
1212

1313
## List of available metrics
1414

15-
The following metrics are available, grouped by their subsystem:
16-
17-
### Block Manager
18-
19-
| Name | Type | Tags | Description |
20-
|------|------|------|-------------|
21-
| `rollkit_sequencer_height` | Gauge | chain_id | Height of the chain |
22-
| `rollkit_sequencer_num_txs` | Gauge | chain_id | Number of transactions |
23-
| `rollkit_sequencer_block_size_bytes` | Gauge | chain_id | Size of the block |
24-
| `rollkit_sequencer_total_txs` | Gauge | chain_id | Total number of transactions |
25-
| `rollkit_sequencer_latest_block_height` | Gauge | chain_id | The latest block height |
26-
27-
### P2P
28-
29-
| Name | Type | Tags | Description |
30-
|------|------|------|-------------|
31-
| `rollkit_p2p_peers` | Gauge | chain_id | Number of connected peers |
32-
| `rollkit_p2p_peer_receive_bytes_total` | Counter | peer_id, chID | Number of bytes received from a given peer |
33-
| `rollkit_p2p_peer_send_bytes_total` | Counter | peer_id, chID | Number of bytes sent to a given peer |
34-
| `rollkit_p2p_peer_pending_send_bytes` | Gauge | peer_id | Pending bytes to be sent to a given peer |
35-
| `rollkit_p2p_num_txs` | Gauge | peer_id | Number of transactions submitted by each peer |
36-
| `rollkit_p2p_message_receive_bytes_total` | Counter | message_type | Number of bytes of each message type received |
37-
| `rollkit_p2p_message_send_bytes_total` | Counter | message_type | Number of bytes of each message type sent |
38-
39-
In addition to these, [go-libp2p metrics](https://github.com/libp2p/go-libp2p/tree/master/dashboards) are exported as well.
40-
41-
### Single Sequencer
42-
43-
| Name | Type | Tags | Description |
44-
|------|------|------|-------------|
45-
| `sequencer_gas_price` | Gauge | chain_id | The gas price of DA |
46-
| `sequencer_last_blob_size` | Gauge | chain_id | The size in bytes of the last DA blob |
47-
| `sequencer_transaction_status` | Counter | chain_id, status | Count of transaction statuses for DA submissions |
48-
| `sequencer_num_pending_blocks` | Gauge | chain_id | The number of pending blocks for DA submission |
49-
| `sequencer_included_block_height` | Gauge | chain_id | The last DA included block height |
50-
51-
### Based Sequencer
52-
53-
The Based Sequencer uses the same metrics as the Single Sequencer, with additional metrics related to the based DA layer.
15+
You can find the full list of available metrics in the [Technical Specifications](https://rollkit.github.io/rollkit/specs/block-manager.html#metrics).
5416

5517
## Viewing Metrics
5618

5719
Once your Rollkit node is running with metrics enabled, you can view the metrics by:
5820

5921
1. Accessing the metrics endpoint directly:
6022

61-
```
23+
```bash
6224
curl http://localhost:26660/metrics
6325
```
6426

guides/reset-state.md

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,37 +18,59 @@ In order to complete this guide, you will need to have completed either the [qui
1818

1919
## Quick Start
2020

21-
When you run your chain with `rollkit start` you will create a `.rollkit` directory in your root directory.
21+
When you run your chain with `testapp start` you will create a `.testapp` directory in your root directory.
2222

2323
This directory will look like the following.
2424

2525
```bash
26-
tree $HOME/.rollkit
26+
tree $HOME/.testapp
2727

2828
├── config
29-
│   ├── config.toml
3029
│   ├── genesis.json
3130
│   ├── node_key.json
32-
│   └── priv_validator_key.json
31+
│   ├── rollkit.yaml
32+
│   └── signer.json
3333
└── data
34-
├── priv_validator_state.json
35-
└── rollkit
34+
├── cache
35+
│   ├── data
36+
│   │   ├── da_included.gob
37+
│   │   ├── hashes.gob
38+
│   │   ├── items_by_hash.gob
39+
│   │   └── items_by_height.gob
40+
│   └── header
41+
│   ├── da_included.gob
42+
│   ├── hashes.gob
43+
│   ├── items_by_hash.gob
44+
│   └── items_by_height.gob
45+
├── executor
46+
│   ├── 000001.sst
47+
│   ├── 000002.vlog
48+
│   ├── 000003.vlog
49+
│   ├── 00003.mem
50+
│   ├── DISCARD
51+
│   ├── KEYREGISTRY
52+
│   ├── LOCK
53+
│   └── MANIFEST
54+
└── testapp
3655
├── 000001.sst
37-
├── 000001.vlog
3856
├── 000002.sst
3957
├── 000002.vlog
58+
├── 000003.sst
59+
├── 000003.vlog
4060
├── DISCARD
4161
├── KEYREGISTRY
4262
└── MANIFEST
4363
```
4464

45-
To reset the state of the chain, delete the entire `.rollkit` directory.
65+
To reset the state of the chain, delete the content of the `data` directory.
66+
67+
Alternatively, you can use this command.
4668

4769
```bash
48-
${BINARY} unsafe-clean
70+
testapp unsafe-clean
4971
```
5072

51-
When you launch your chain again with `rollkit start` your `.rollkit` directory will be re-created and you will see your chain starting at block height 1 again.
73+
When you launch your chain again with `testapp start` your `data` directory will be re-populated and you will see your chain starting at block height 1 again.
5274

5375
## gm-world
5476

@@ -114,20 +136,12 @@ tree $HOME/.gm
114136
└── e24d9eeca2d24193bdd98ed9116ff70f8a2e2b5e.address
115137
```
116138

117-
The directories you need to delete to reset your state are in the `./data` directory.
118-
119-
```bash
120-
$HOME/.gm/data/application.db
121-
$HOME/.gm/data/rollkit
122-
$HOME/.gm/data/snapshots
123-
$HOME/.gm/data/cache
124-
125-
```
139+
The directories you need to delete to reset your state are in the `data` directory.
126140

127-
You can delete them with the following command:
141+
Alternatively, you can run the following command to delete the data directories:
128142

129143
```bash
130-
gmd tendermint unsafe-reset-all
144+
gmd comet unsafe-reset-all
131145
```
132146

133147
When you launch your chain again with your `gmd start <flags>` command, these data directories will be re-created and you will see your chain starting at block height 1 again.

guides/restart-rollup.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ command for your rollup.
1212
For example, if you ran the [quick start](/guides/quick-start.md) tutorial, you started your rollup with:
1313

1414
```bash
15-
rollkit start
15+
testapp start
1616
```
1717

1818
You would have see output similar to:
@@ -27,7 +27,7 @@ I[2024-10-17|14:52:12.846] indexed block events module=t
2727
If you need to restart your rollup, you can run the same command again:
2828

2929
```bash
30-
rollkit start
30+
testapp start
3131
```
3232

3333
You will see that the block height will continue from where it left off:
@@ -39,7 +39,7 @@ I[2024-10-17|14:52:13.845] executed block module=B
3939
I[2024-10-17|14:52:13.845] indexed block events module=txindex height=8
4040
```
4141

42-
It is important to include any additional flags that you used when you first started your rollup. For example, if you used the `--rollkit.da_namespace` flag, you will need to include that flag when restarting your rollup to ensure your rollup continues to publish blobs to the same namespace.
42+
It is important to include any additional flags that you used when you first started your rollup. For example, if you used the `--rollkit.da.namespace` flag, you will need to include that flag when restarting your rollup to ensure your rollup continues to publish blobs to the same namespace.
4343

4444
## Restart rollup after running out of funds
4545

public/gm/init-arabica-testnet.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS
5454
echo "DA_BLOCK_HEIGHT=$DA_BLOCK_HEIGHT" >> restart-testnet.sh
5555
echo "AUTH_TOKEN=$AUTH_TOKEN" >> restart-testnet.sh
5656

57-
echo "gmd start --rollkit.aggregator --rollkit.da_auth_token=\$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height \$DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:26657 --grpc.address 127.0.0.1:9290 --p2p.laddr \"0.0.0.0:36656\" --minimum-gas-prices="0.025stake"" >> restart-testnet.sh
57+
echo "gmd start --rollkit.aggregator --rollkit.da_auth_token=\$AUTH_TOKEN --rollkit.da.namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height \$DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:26657 --grpc.address 127.0.0.1:9290 --p2p.laddr \"0.0.0.0:36656\" --minimum-gas-prices="0.025stake"" >> restart-testnet.sh
5858

5959
# start the chain
60-
gmd start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:26657 --grpc.address 127.0.0.1:9290 --p2p.laddr "0.0.0.0:36656" --minimum-gas-prices="0.025stake"
60+
gmd start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da.namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:26657 --grpc.address 127.0.0.1:9290 --p2p.laddr "0.0.0.0:36656" --minimum-gas-prices="0.025stake"

public/gm/init-local.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS
9090
echo "DA_BLOCK_HEIGHT=$DA_BLOCK_HEIGHT" >> restart-local.sh
9191
echo "AUTH_TOKEN=$AUTH_TOKEN" >> restart-local.sh
9292

93-
echo "gmd start --rollkit.aggregator --rollkit.aggregator --rollkit.da_auth_token=\$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --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\" --minimum-gas-prices="0.025stake"" >> restart-local.sh
93+
echo "gmd start --rollkit.node.aggregator --rollkit.da.auth_token=\$AUTH_TOKEN --rollkit.da.namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --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\" --minimum-gas-prices="0.025stake"" >> restart-local.sh
9494

9595
# start the chain
96-
gmd start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --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" --minimum-gas-prices="0.025stake"
96+
gmd start --rollkit.node.aggregator --rollkit.da.auth_token=$AUTH_TOKEN --rollkit.da.namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --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" --minimum-gas-prices="0.025stake"

public/gm/init-mainnet.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS
5454
echo "DA_BLOCK_HEIGHT=$DA_BLOCK_HEIGHT" >> restart-mainnet.sh
5555
echo "AUTH_TOKEN=$AUTH_TOKEN" >> restart-mainnet.sh
5656

57-
echo "gmd start --rollkit.aggregator --rollkit.da_auth_token=\$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --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\" --minimum-gas-prices="0.025stake"" >> restart-mainnet.sh
57+
echo "gmd start --rollkit.aggregator --rollkit.da.auth_token=\$AUTH_TOKEN --rollkit.da.namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --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\" --minimum-gas-prices="0.025stake"" >> restart-mainnet.sh
5858

5959
# start the chain
60-
gmd start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --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" --minimum-gas-prices="0.025stake"
60+
gmd start --rollkit.aggregator --rollkit.da.auth_token=$AUTH_TOKEN --rollkit.da.namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --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" --minimum-gas-prices="0.025stake"

public/gm/init-mocha-testnet.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS
5454
echo "DA_BLOCK_HEIGHT=$DA_BLOCK_HEIGHT" >> restart-testnet.sh
5555
echo "AUTH_TOKEN=$AUTH_TOKEN" >> restart-testnet.sh
5656

57-
echo "gmd start --rollkit.aggregator --rollkit.da_auth_token=\$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --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\" --minimum-gas-prices="0.025stake"" >> restart-testnet.sh
57+
echo "gmd start --rollkit.aggregator --rollkit.da.auth_token=\$AUTH_TOKEN --rollkit.da.namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --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\" --minimum-gas-prices="0.025stake"" >> restart-testnet.sh
5858

5959
# start the chain
60-
gmd start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --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" --minimum-gas-prices="0.025stake"
60+
gmd start --rollkit.aggregator --rollkit.da.auth_token=$AUTH_TOKEN --rollkit.da.namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --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" --minimum-gas-prices="0.025stake"

0 commit comments

Comments
 (0)