Skip to content

Commit d67a6db

Browse files
authored
Merge pull request #775 from input-output-hk/jpraynaud/752-activate-era-reader-on-chain
Deploy era reader on chain
2 parents 4f89b30 + aa9a9ac commit d67a6db

File tree

38 files changed

+658
-508
lines changed

38 files changed

+658
-508
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,10 @@ jobs:
477477
env:
478478
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
479479
GENESIS_SECRET_KEY: ${{ secrets.GENESIS_SECRET_KEY }}
480-
GENESIS_VERIFICATION_KEY_URL: ${{ secrets.GENESIS_VERIFICATION_KEY_URL }}
480+
GENESIS_VERIFICATION_KEY_URL: ${{ vars.GENESIS_VERIFICATION_KEY_URL }}
481+
ERA_READER_ADDRESS_URL: ${{ vars.ERA_READER_ADDRESS_URL }}
482+
ERA_READER_VERIFICATION_KEY_URL: ${{ vars.ERA_READER_VERIFICATION_KEY_URL }}
483+
ERA_READER_SECRET_KEY: ${{ secrets.ERA_READER_SECRET_KEY }}
481484

482485
defaults:
483486
run:
@@ -500,18 +503,22 @@ jobs:
500503
- name: Prepare terraform variables
501504
run: |
502505
cat > ./env.variables.tfvars << EOF
503-
environment_prefix = "${{ matrix.environment_prefix }}"
504-
cardano_network = "${{ matrix.cardano_network }}"
505-
google_region = "${{ matrix.google_region }}"
506-
google_zone = "${{ matrix.google_zone }}"
507-
google_machine_type = "${{ matrix.google_machine_type }}"
508-
google_service_credentials_json_file = "./google-application-credentials.json"
509-
mithril_api_domain = "${{ matrix.mithril_api_domain }}"
510-
mithril_image_id = "${{ env.DOCKER_IMAGE_ID }}"
511-
mithril_genesis_verification_key_url = "${{ env.GENESIS_VERIFICATION_KEY_URL }}"
512-
mithril_genesis_secret_key = "${{ env.GENESIS_SECRET_KEY }}"
513-
mithril_protocol_parameters = ${{ matrix.mithril_protocol_parameters }}
514-
mithril_signers = ${{ matrix.mithril_signers }}
506+
environment_prefix = "${{ matrix.environment_prefix }}"
507+
cardano_network = "${{ matrix.cardano_network }}"
508+
google_region = "${{ matrix.google_region }}"
509+
google_zone = "${{ matrix.google_zone }}"
510+
google_machine_type = "${{ matrix.google_machine_type }}"
511+
google_service_credentials_json_file = "./google-application-credentials.json"
512+
mithril_api_domain = "${{ matrix.mithril_api_domain }}"
513+
mithril_image_id = "${{ env.DOCKER_IMAGE_ID }}"
514+
mithril_genesis_verification_key_url = "${{ env.GENESIS_VERIFICATION_KEY_URL }}"
515+
mithril_genesis_secret_key = "${{ env.GENESIS_SECRET_KEY }}"
516+
mithril_protocol_parameters = ${{ matrix.mithril_protocol_parameters }}
517+
mithril_era_reader_adapter_type = "cardano-chain"
518+
mithril_era_reader_address_url = "${{ env.ERA_READER_ADDRESS_URL }}"
519+
mithril_era_reader_verification_key_url = "${{ env.ERA_READER_VERIFICATION_KEY_URL }}"
520+
mithril_era_reader_secret_key = "${{ env.ERA_READER_SECRET_KEY }}"
521+
mithril_signers = ${{ matrix.mithril_signers }}
515522
EOF
516523
terraform fmt ./env.variables.tfvars
517524
cat ./env.variables.tfvars

.github/workflows/pre-release.yml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,10 @@ jobs:
219219
env:
220220
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
221221
GENESIS_SECRET_KEY: ${{ secrets.GENESIS_SECRET_KEY }}
222-
GENESIS_VERIFICATION_KEY_URL: ${{ secrets.GENESIS_VERIFICATION_KEY_URL }}
222+
GENESIS_VERIFICATION_KEY_URL: ${{ vars.GENESIS_VERIFICATION_KEY_URL }}
223+
ERA_READER_ADDRESS_URL: ${{ vars.ERA_READER_ADDRESS_URL }}
224+
ERA_READER_VERIFICATION_KEY_URL: ${{ vars.ERA_READER_VERIFICATION_KEY_URL }}
225+
ERA_READER_SECRET_KEY: ${{ secrets.ERA_READER_SECRET_KEY }}
223226

224227
defaults:
225228
run:
@@ -242,18 +245,22 @@ jobs:
242245
- name: Prepare terraform variables
243246
run: |
244247
cat > ./env.variables.tfvars << EOF
245-
environment_prefix = "${{ matrix.environment_prefix }}"
246-
cardano_network = "${{ matrix.cardano_network }}"
247-
google_region = "${{ matrix.google_region }}"
248-
google_zone = "${{ matrix.google_zone }}"
249-
google_machine_type = "${{ matrix.google_machine_type }}"
250-
google_service_credentials_json_file = "./google-application-credentials.json"
251-
mithril_api_domain = "${{ matrix.mithril_api_domain }}"
252-
mithril_image_id = "${{ env.DOCKER_IMAGE_ID }}"
253-
mithril_genesis_verification_key_url = "${{ env.GENESIS_VERIFICATION_KEY_URL }}"
254-
mithril_genesis_secret_key = "${{ env.GENESIS_SECRET_KEY }}"
255-
mithril_protocol_parameters = ${{ matrix.mithril_protocol_parameters }}
256-
mithril_signers = ${{ matrix.mithril_signers }}
248+
environment_prefix = "${{ matrix.environment_prefix }}"
249+
cardano_network = "${{ matrix.cardano_network }}"
250+
google_region = "${{ matrix.google_region }}"
251+
google_zone = "${{ matrix.google_zone }}"
252+
google_machine_type = "${{ matrix.google_machine_type }}"
253+
google_service_credentials_json_file = "./google-application-credentials.json"
254+
mithril_api_domain = "${{ matrix.mithril_api_domain }}"
255+
mithril_image_id = "${{ env.DOCKER_IMAGE_ID }}"
256+
mithril_genesis_verification_key_url = "${{ env.GENESIS_VERIFICATION_KEY_URL }}"
257+
mithril_genesis_secret_key = "${{ env.GENESIS_SECRET_KEY }}"
258+
mithril_protocol_parameters = ${{ matrix.mithril_protocol_parameters }}
259+
mithril_era_reader_adapter_type = "cardano-chain"
260+
mithril_era_reader_address_url = "${{ env.ERA_READER_ADDRESS_URL }}"
261+
mithril_era_reader_verification_key_url = "${{ env.ERA_READER_VERIFICATION_KEY_URL }}"
262+
mithril_era_reader_secret_key = "${{ env.ERA_READER_SECRET_KEY }}"
263+
mithril_signers = ${{ matrix.mithril_signers }}
257264
EOF
258265
terraform fmt ./env.variables.tfvars
259266
cat ./env.variables.tfvars

.github/workflows/release.yml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,10 @@ jobs:
147147
env:
148148
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
149149
GENESIS_SECRET_KEY: ${{ secrets.GENESIS_SECRET_KEY }}
150-
GENESIS_VERIFICATION_KEY_URL: ${{ secrets.GENESIS_VERIFICATION_KEY_URL }}
150+
GENESIS_VERIFICATION_KEY_URL: ${{ vars.GENESIS_VERIFICATION_KEY_URL }}
151+
ERA_READER_ADDRESS_URL: ${{ vars.ERA_READER_ADDRESS_URL }}
152+
ERA_READER_VERIFICATION_KEY_URL: ${{ vars.ERA_READER_VERIFICATION_KEY_URL }}
153+
ERA_READER_SECRET_KEY: ${{ secrets.ERA_READER_SECRET_KEY }}
151154

152155
defaults:
153156
run:
@@ -170,18 +173,22 @@ jobs:
170173
- name: Prepare terraform variables
171174
run: |
172175
cat > ./env.variables.tfvars << EOF
173-
environment_prefix = "${{ matrix.environment_prefix }}"
174-
cardano_network = "${{ matrix.cardano_network }}"
175-
google_region = "${{ matrix.google_region }}"
176-
google_zone = "${{ matrix.google_zone }}"
177-
google_machine_type = "${{ matrix.google_machine_type }}"
178-
google_service_credentials_json_file = "./google-application-credentials.json"
179-
mithril_api_domain = "${{ matrix.mithril_api_domain }}"
180-
mithril_image_id = "${{ env.DOCKER_IMAGE_ID }}"
181-
mithril_genesis_verification_key_url = "${{ env.GENESIS_VERIFICATION_KEY_URL }}"
182-
mithril_genesis_secret_key = "${{ env.GENESIS_SECRET_KEY }}"
183-
mithril_protocol_parameters = ${{ matrix.mithril_protocol_parameters }}
184-
mithril_signers = ${{ matrix.mithril_signers }}
176+
environment_prefix = "${{ matrix.environment_prefix }}"
177+
cardano_network = "${{ matrix.cardano_network }}"
178+
google_region = "${{ matrix.google_region }}"
179+
google_zone = "${{ matrix.google_zone }}"
180+
google_machine_type = "${{ matrix.google_machine_type }}"
181+
google_service_credentials_json_file = "./google-application-credentials.json"
182+
mithril_api_domain = "${{ matrix.mithril_api_domain }}"
183+
mithril_image_id = "${{ env.DOCKER_IMAGE_ID }}"
184+
mithril_genesis_verification_key_url = "${{ env.GENESIS_VERIFICATION_KEY_URL }}"
185+
mithril_genesis_secret_key = "${{ env.GENESIS_SECRET_KEY }}"
186+
mithril_protocol_parameters = ${{ matrix.mithril_protocol_parameters }}
187+
mithril_era_reader_adapter_type = "cardano-chain"
188+
mithril_era_reader_address_url = "${{ env.ERA_READER_ADDRESS_URL }}"
189+
mithril_era_reader_verification_key_url = "${{ env.ERA_READER_VERIFICATION_KEY_URL }}"
190+
mithril_era_reader_secret_key = "${{ env.ERA_READER_SECRET_KEY }}"
191+
mithril_signers = ${{ matrix.mithril_signers }}
185192
EOF
186193
terraform fmt ./env.variables.tfvars
187194
cat ./env.variables.tfvars

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
144 KB
Loading
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: Mithril Era Switch
3+
authors:
4+
- name: Mithril Team
5+
tags: [era, era activation, era markers, era switch, hard fork]
6+
---
7+
8+
### An new Era Switch behavior will be introduced soon to the Mithril networks
9+
10+
**Epic**: `Implement eras behavior switch #707](Implement eras behavior switch` [#707](https://github.com/input-output-hk/mithril/issues/707)
11+
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.
13+
14+
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.
15+
16+
:fire: Activating this feature will require an update of configuration of the signer nodes after updating their binary:
17+
- The `ERA_READER_ADAPTER_TYPE` env var must be set to `cardano-chain`
18+
- 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)
19+
20+
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.
21+
22+
Here is a schema that illustrates the era switch behavior:
23+
![Era Switch Schema](./img/schema.jpg)
24+
25+
More information is also available at this [ADR](https://mithril.network/doc/adr/4).
26+
27+
Feel free to reach out to us on the [Discord channel](https://discord.gg/5kaErDKDRq) for questions and/or help.

0 commit comments

Comments
 (0)