Skip to content

Commit 8fd902c

Browse files
authored
Merge pull request #790 from input-output-hk/jpraynaud/752-update-era-documentation
Update Era Switch documentation
2 parents f3a5e39 + 371b76c commit 8fd902c

File tree

6 files changed

+179
-45
lines changed

6 files changed

+179
-45
lines changed

docs/blog/2023-03-02-era-switch-feature/index.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,26 @@ authors:
55
tags: [era, era activation, era markers, era switch, hard fork]
66
---
77

8+
**Update 2023/03/08**: The Era Switch behavior has been activated on the `pre-release-preview` network.
9+
810
### An new Era Switch behavior will be introduced soon to the Mithril networks
911

1012
**Epic**: `Implement eras behavior switch #707](Implement eras behavior switch` [#707](https://github.com/input-output-hk/mithril/issues/707)
1113

12-
:warning: The Era Switch is not deployed yet to the `pre-release-preview` and `release-preprod` network. A special announcement will be made on the **moria** Discord channel when a new release condaidate distribution is ready.
14+
:warning: The Era Switch is not deployed yet to the `pre-release-preview` and `release-preprod` network. A special announcement will be made on the **moria** Discord channel when a new release candidate distribution is ready.
1315

1416
In order to guarantee that any breaking change of the Mithril nodes does not break the Certificate Chain and the that new snapshots are consistently produced, the Mithril team has developped an Era Switch Behavior. This mechanism enables to embed new features in the signer and aggregator nodes prior ro releasing them. Also the activation of these new features will take place in a coordinated manner: all the eligible nodes will hot switch to a new era at the same Cardano epoch transition. To do so, the nodes rely on a transaction that is stored on the Cardano chain that provides era markers with the associated activations epochs for the eras.
1517

1618
:fire: Activating this feature will require an update of configuration of the signer nodes after updating their binary:
1719
- The `ERA_READER_ADAPTER_TYPE` env var must be set to `cardano-chain`
1820
- The `ERA_READER_ADAPTER_PARAMS` env var must be set to the result of the command `jq -nc --arg address $(wget -q -O - **YOUR_ERA_READER_ADDRESS**) --arg verification_key $(wget -q -O - **YOUR_ERA_READER_VERIFICATION_KEY**) '{"address": $address, "verification_key": $verification_key}'` (the ****YOUR_ERA_READER_ADDRESS**** and ****YOUR_ERA_READER_VERIFICATION_KEY**** are values provided in the networks configuration matrix)
1921

22+
Here is the configuration values that should be used on `pre-release-preview`:
23+
```bash
24+
ERA_READER_ADAPTER_TYPE=cardano-chain
25+
ERA_READER_ADAPTER_PARAMS={"address":"addr_test1qrv5xfwh043mlc3vk5d97s4nmhxu7cmleyssvhx37gkfyejfe8d38v3vsfgetjafgrsdc49krug8wf04h5rmtengtejqlxrksk","verification_key":"5b35352c3232382c3134342c38372c3133382c3133362c34382c382c31342c3138372c38352c3134382c39372c3233322c3235352c3232392c33382c3234342c3234372c3230342c3139382c31332c33312c3232322c32352c3136342c35322c3130322c39312c3132302c3230382c3134375d"}
26+
```
27+
2028
All theses information will be available at the updated [`Run a Mithril Signer node (SPO)`](https://mithril.network/doc/manual/getting-started/run-signer-node) guide.
2129

2230
Here is a schema that illustrates the era switch behavior:

docs/versioned_docs/version-maintained/manual/developer-docs/nodes/mithril-aggregator.md

Lines changed: 71 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ This is the node of the **Mithril Network** responsible for collecting individua
3939

4040
* Install OpenSSL development libraries, for example on Ubuntu/Debian/Mint run `apt install libssl-dev`
4141

42-
* Ensure SQLite3 library is installed on your system and its version is at least `3.35` (released Apr. 2021) on Debian/Ubuntu: `apt install libsqlite3` and `sqlite3 --version`.
42+
* Ensure SQLite3 library is installed on your system and its version is at least `3.40`. Run `sqlite3 --version` to check your version.
4343

4444
## Download source
4545

@@ -124,6 +124,7 @@ Usage: mithril-aggregator [OPTIONS] <COMMAND>
124124

125125
Commands:
126126
genesis Genesis tools
127+
era Era tools
127128
serve Server runtime mode
128129
help Print this message or the help of the given subcommand(s)
129130

@@ -137,9 +138,9 @@ Options:
137138
--config-directory <CONFIG_DIRECTORY>
138139
Directory where configuration file is located [default: ./config]
139140
-h, --help
140-
Print help information
141+
Print help
141142
-V, --version
142-
Print version information
143+
Print version
143144
```
144145

145146
Run 'serve' command in release with default configuration
@@ -160,7 +161,7 @@ Run 'serve' command in release with a custom configuration via env vars
160161
GENESIS_VERIFICATION_KEY=$(wget -q -O - **YOUR_GENESIS_VERIFICATION_KEY**) RUN_INTERVAL=60000 NETWORK=**YOUR_CARDANO_NETWORK** ./mithril-aggregator serve
161162
```
162163

163-
## Release build and run binary 'genesis' command
164+
## Release build and run binary 'era' command
164165

165166
Build in release with default configuration
166167

@@ -171,60 +172,80 @@ make build
171172
Display the help menu
172173

173174
```bash
174-
./mithril-aggregator genesis --help
175+
./mithril-aggregator era --help
175176
```
176177

177178
You should see
178179

179180
```bash
180-
mithril-aggregator-genesis
181-
Genesis tools
181+
Era tools
182182

183-
USAGE:
184-
mithril-aggregator genesis <SUBCOMMAND>
183+
Usage: mithril-aggregator era <COMMAND>
185184

186-
OPTIONS:
187-
-h, --help Print help information
185+
Commands:
186+
list Era list command
187+
generate-tx-datum Era tx datum generate command
188+
help Print this message or the help of the given subcommand(s)
189+
190+
Options:
191+
-h, --help Print help
192+
```
193+
194+
Run 'era list' to list the supported eras embedded in the binary
195+
196+
```bash
197+
./mithril-aggregator era list
198+
```
188199

189-
SUBCOMMANDS:
190-
bootstrap Genesis certificate bootstrap command
191-
export Genesis certificate export command
192-
help Print this message or the help of the given subcommand(s)
193-
import Genesis certificate import command
200+
You should see something like
194201

202+
```bash
203+
Supported Eras:
204+
[
205+
Thales,
206+
]
195207
```
196208

197-
Run 'genesis bootstrap' command in release with default configuration, **only in test mode**.
198-
This allows the Mithril Aggregator node to bootstrap a `Genesis Certificate`. After this operation, the Mithril Aggregator will be able to produce new snapshots and certificates.
209+
:::tip
210+
211+
You can use the `--json` option in order to display results in `JSON` format for the `list` command:
199212

200213
```bash
201-
./mithril-aggregator genesis bootstrap
214+
./mithril-aggregator era list --json
202215
```
203216

204-
Or with a specific `Genesis Secret Key`, **only in test mode**.
217+
You should see something like
205218

206219
```bash
207-
./mithril-aggregator genesis bootstrap --genesis-secret-key **YOUR_SECRET_KEY**
220+
["thales"]
208221
```
209222

210-
Run 'genesis export' command in release with default configuration.
211-
This allows the Mithril Aggregator node to export the `Genesis Payload` that needs to be signed (and later reimported) of the `Genesis Certificate`. The signature of the `Genesis Payload` must be done manually with the owner of the `Genesis Secret Key`.
223+
:::
224+
225+
Run 'era generate-tx-datum' to generate the transaction datum file to be stored on the Cardano chain that will provide era markers to the 'cardano-chain' era reader adapter
226+
227+
**Case 1**: There is only one supported era in the code, create the datum file with
212228

213229
```bash
214-
./mithril-aggregator genesis export --target-path **YOUR_TARGET_PATH**
230+
./mithril-aggregator era generate-tx-datum --current-era-epoch **EPOCH_AT_WHICH_CURRENT_ERA_STARTS** --era-markers-secret-key **YOUR_ERA_ACTIVATION_SECRET_KEY**
215231
```
216232

217-
Run 'genesis import' command in release with default configuration.
218-
This allows the Mithril Aggregator node to import the signed payload of the `Genesis Certificate` and create it in the store. After this operation, the Mithril Aggregator will be able to produce new snapshots and certificates.
233+
You should see something like
219234

220235
```bash
221-
./mithril-aggregator genesis import --signed-payload-path **YOUR_SIGNED_PAYLOAD_PATH**
236+
{"constructor":0,"fields":[{"bytes":"5b7b226e223a227468616c6573222c2265223a317d5d"},{"bytes":"a58fe8e336f465ded3bba7c5a7afe5b5a26f2fb65b7c4e6e742e680645f13df28bf2b63a61cc72d9c826be490e2c1f1098d955df503580a4e899b5173884e30e"}]}
222237
```
223238

224-
Run 'genesis import' command in release with a custom configuration via env vars
239+
**Case 2**: There are two supported era in the code, in order to announce the upcoming era (i.e. the activation epoch of this era is not known yet), run the command
225240

226241
```bash
227-
GENESIS_VERIFICATION_KEY=$(wget -q -O - **YOUR_GENESIS_VERIFICATION_KEY**) RUN_INTERVAL=60000 NETWORK=**YOUR_CARDANO_NETWORK** ./mithril-aggregator genesis import --signed-payload-path **YOUR_SIGNED_PAYLOAD_PATH**
242+
./mithril-aggregator era generate-tx-datum --current-era-epoch **EPOCH_AT_WHICH_CURRENT_ERA_STARTS** --era-markers-secret-key **YOUR_ERA_ACTIVATION_SECRET_KEY**
243+
```
244+
245+
**Case 3**: There are two supported era in the code, in order to activate the era switch at a following epoch (i.e. the activation epoch of this era known), run the command
246+
247+
```bash
248+
./mithril-aggregator era generate-tx-datum --current-era-epoch **EPOCH_AT_WHICH_CURRENT_ERA_STARTS** --next-era-epoch **EPOCH_AT_WHICH_NEXT_ERA_STARTS** --era-markers-secret-key **YOUR_ERA_ACTIVATION_SECRET_KEY**
228249
```
229250

230251
:::tip
@@ -238,6 +259,7 @@ If you want to dig deeper, you can get access to several level of logs from the
238259

239260
:::
240261

262+
241263
<CompiledBinaries />
242264

243265
## Build and run Docker container
@@ -265,6 +287,8 @@ Here are the subcommands available:
265287
| **genesis export** | Export genesis payload to sign with genesis secret key |
266288
| **genesis import** | Import genesis signature (payload signed with genesis secret key) and create & import a genesis certificate in the store |
267289
| **genesis bootstrap** | Bootstrap a genesis certificate (test only usage) |
290+
| **era list** | List the supported eras |
291+
| **era generate-tx-datum** | Generate era markers transaction datum to be stored on chain |
268292

269293
## Configuration parameters
270294

@@ -304,6 +328,8 @@ General parameters:
304328
| `snapshot_bucket_name` | - | - | `SNAPSHOT_BUCKET_NAME` | Name of the bucket where the snapshots are stored | - | `snapshot-bucket` | :heavy_check_mark: | Required if `snapshot_uploader_type` is `gcp`
305329
| `run_interval` | - | - | `RUN_INTERVAL` | Interval between two runtime cycles in ms | - | `60000` | :heavy_check_mark: |
306330
| `url_snapshot_manifest` | - | - | `URL_SNAPSHOT_MANIFEST` | Snapshots manifest location | - | Only if `snapshot_store_type` is `gcp`, else it should be `` | :heavy_check_mark: |
331+
| `era_reader_adapter_type` | `--era-reader-adapter-type` | - | `ERA_READER_ADAPTER_TYPE` | Era reader adapter type that can be `cardano-chain`, `file` or `bootstrap`. | `bootstrap` | - | - |
332+
| `era_reader_adapter_params` | `--era-reader-adapter-params` | - | `ERA_READER_ADAPTER_PARAMS` | Era reader adapter params that is an optional JSON encoded parameters structure that is expected depending on the `era_reader_adapter_type` parameter | - | - | - |
307333

308334
`genesis bootstrap` command:
309335

@@ -315,10 +341,24 @@ General parameters:
315341

316342
| Parameter | Command Line (long) | Command Line (short) | Environment Variable | Description | Default Value | Example | Mandatory |
317343
|-----------|---------------------|:---------------------:|----------------------|-------------|---------------|---------|:---------:|
318-
| `signed-payload-path` | `--signed-payload-path` | - | - | Path of the payload to import. | - | - | - | - |
344+
| `signed_payload_path` | `--signed-payload-path` | - | - | Path of the payload to import. | - | - | - | - |
319345

320346
`genesis export` command:
321347

322348
| Parameter | Command Line (long) | Command Line (short) | Environment Variable | Description | Default Value | Example | Mandatory |
323349
|-----------|---------------------|:---------------------:|----------------------|-------------|---------------|---------|:---------:|
324-
| `target-path` | `--target-path` | - | - | Path of the file to export the payload to. | - | - | - | - |
350+
| `target_path` | `--target-path` | - | - | Path of the file to export the payload to. | - | - | - | - |
351+
352+
`era list` command:
353+
354+
| Parameter | Command Line (long) | Command Line (short) | Environment Variable | Description | Default Value | Example | Mandatory |
355+
|-----------|---------------------|:---------------------:|----------------------|-------------|---------------|---------|:---------:|
356+
| `json` | `--json` | - | - | Export the supported era list to JSON format. | - | - | - | - |
357+
358+
`era generate-tx-datum` command:
359+
360+
| Parameter | Command Line (long) | Command Line (short) | Environment Variable | Description | Default Value | Example | Mandatory |
361+
|-----------|---------------------|:---------------------:|----------------------|-------------|---------------|---------|:---------:|
362+
| `current_era_epoch` | `--current-era-epoch` | - | `CURRENT_ERA_EPOCH` | Epoch at which current era starts. | - | - | - | :heavy_check_mark: |
363+
| `next_era_epoch` | `--next-era-epoch` | - | `NEXT_ERA_EPOCH` | Epoch at which the next era starts. If not specified and an upcoming era is available, it will announce the next era. If specified, it must be strictly greater than `current-epoch-era` | - | - | - | - |
364+
| `era_markers_secret_key` | `--era-markers-secret-key` | - | `ERA_MARKERS_SECRET_KEY` | Era Markers Secret Key that is used to verify the authenticity of the era markers on chain. | - | - | - | :heavy_check_mark: |

docs/versioned_docs/version-maintained/manual/developer-docs/nodes/mithril-signer.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,3 +209,5 @@ Here is a list of the available parameters:
209209
| `store_retention_limit` | - | - | `STORE_RETENTION_LIMIT` | Maximum number of records in stores. If not set, no limit is set. | - | - | - |
210210
| `kes_secret_key_path` | - | - | `KES_SECRET_KEY_PATH` | Path to the `Cardano KES Secret Key` file. Mandatory in `Pool Id Certification Mode` where the owner is verified (experimental, soon to be stable & preferred mode) | - | - | - |
211211
| `operational_certificate_path` | - | - | `OPERATIONAL_CERTIFICATE_PATH` | Path to the `Cardano Operational Certificate` file. Mandatory in `Pool Id Certification Mode` where the owner is verified (experimental, soon to be stable & preferred mode) | - | - | - |
212+
| `era_reader_adapter_type` | `--era-reader-adapter-type` | - | `ERA_READER_ADAPTER_TYPE` | Era reader adapter type that can be `cardano-chain`, `file` or `bootstrap`. | `bootstrap` | - | - |
213+
| `era_reader_adapter_params` | `--era-reader-adapter-params` | - | `ERA_READER_ADAPTER_PARAMS` | Era reader adapter params that is an optional JSON encoded parameters structure that is expected depending on the `era_reader_adapter_type` parameter | - | - | - |

docs/versioned_docs/version-maintained/manual/getting-started/run-mithril-devnet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ More information about this private Cardano/Mithril `devnet` is available [here]
3939

4040
* Install OpenSSL development libraries, for example on Ubuntu/Debian/Mint run `apt install libssl-dev`
4141

42-
* Ensure SQLite3 library is installed on your system and its version is at least `3.35` (released Apr. 2021) on Debian/Ubuntu: `apt install libsqlite3` and `sqlite3 --version`.
42+
* Ensure SQLite3 library is installed on your system and its version is at least `3.40`. Run `sqlite3 --version` to check your version.
4343

4444
## Download source
4545

docs/versioned_docs/version-maintained/manual/getting-started/run-signer-node.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ For more information about the **Mithril Protocol**, please refer to the [About
5151

5252
* Ensure the SQLite3 version is at least `3.35` (released Apr. 2021)
5353

54+
* Install a recent version of `jq` (version `1.6+`) `apt install jq`
55+
5456
## Mithril Keys Certification
5557

5658

@@ -195,7 +197,8 @@ Replace this value with the correct user. We assume that the user used to run th
195197
* `CARDANO_CLI_PATH=/app/bin/cardano-cli`: replace with the path to the `cardano-cli` executable
196198
* `DATA_STORES_DIRECTORY=/opt/mithril/stores`: replace with the path to a folder where the **Mithril Signer** will store its data (`/opt/mithril/stores` e.g.)
197199
* `STORE_RETENTION_LIMIT`: if set, this will limit the number of records in some internal stores (5 is a good fit).
198-
200+
* `ERA_READER_ADAPTER_TYPE=cardano-chain`: replace `cardano-chain` with the era reader adapter type used in your Mithril network
201+
* `ERA_READER_ADAPTER_PARAMS={"address": "...", "verification_key": "..."}`: replace `{"address": "...", "verification_key": "..."}` with the era reader params that you need to compute by running the command `jq -nc --arg address $(wget -q -O - **YOUR_ERA_READER_ADDRESS**) --arg verification_key $(wget -q -O - **YOUR_ERA_READER_VERIFICATION_KEY**) '{"address": $address, "verification_key": $verification_key}'`
199202
:::
200203

201204
First create an env file that will be used by the service:
@@ -212,6 +215,8 @@ CARDANO_NODE_SOCKET_PATH=/cardano/ipc/node.socket
212215
CARDANO_CLI_PATH=/app/bin/cardano-cli
213216
DATA_STORES_DIRECTORY=/opt/mithril/stores
214217
STORE_RETENTION_LIMIT=5
218+
ERA_READER_ADAPTER_TYPE=**YOUR_ERA_READER_ADAPTER_TYPE**
219+
ERA_READER_ADAPTER_PARAMS=**YOUR_ERA_READER_ADAPTER_PARAMS**
215220
EOF'
216221
```
217222

0 commit comments

Comments
 (0)