Skip to content

Commit 751e93d

Browse files
authored
Merge pull request #653 from input-output-hk/jpraynaud/621-decommission-unverified-signer-registration
Decommission signer registration with declarative PoolId
2 parents f188985 + 8240859 commit 751e93d

File tree

19 files changed

+113
-106
lines changed

19 files changed

+113
-106
lines changed

.github/workflows/actions/build-upload-mithril-artifact/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ inputs:
44
build-args:
55
description: Arguments to pass to 'cargo build'
66
required: false
7-
default: ''
7+
default: '-p mithril-aggregator -p mithril-client -p mithril-common -p mithril-signer -p mithril-stm'
88
runs:
99
using: "composite"
1010
steps:
@@ -14,10 +14,10 @@ runs:
1414
pip3 install toml
1515
python3 ./.github/workflows/scripts/edit-cargo-toml-version.py -l $(echo ${{ github.sha }} | cut -c1-7)
1616
17-
- name: Cargo build
17+
- name: Cargo build - Distribution
1818
shell: bash
1919
run: cargo build --release ${{ inputs.build-args }}
20-
20+
2121
- name: Publish Mithril Distribution (${{ runner.os }}-${{ runner.arch }})
2222
uses: actions/upload-artifact@v3
2323
with:

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ jobs:
3131
cache-version: ${{ secrets.CACHE_VERSION }}
3232
cargo-tools: cargo-deb
3333

34+
# We separate the build in 2 steps as we want to avoid side effects with Rust feature unification.
35+
- name: Cargo build - Tooling
36+
shell: bash
37+
run: cargo build --release --workspace --exclude mithril-aggregator --exclude mithril-client --exclude mithril-signer --exclude mithril-stm
38+
3439
- name: Build Mithril workspace & publish artifacts
3540
uses: ./.github/workflows/actions/build-upload-mithril-artifact
3641

Cargo.lock

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/protocol-demo/Cargo.toml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithrildemo"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
authors = { workspace = true }
55
edition = { workspace = true }
66
documentation = { workspace = true }
@@ -10,14 +10,23 @@ repository = { workspace = true }
1010

1111
[dependencies]
1212
base64 = "0.13.0"
13+
blake2 = "0.10.4"
1314
clap = { version = "4.0.18", features = ["derive"] }
1415
hex = "0.4.3"
1516
log = "0.4.14"
16-
mithril-common = { path = "../../mithril-common", features = ["allow_skip_signer_certification"] }
17+
mithril-common = { path = "../../mithril-common" }
1718
rand_chacha = "0.3.1"
1819
rand_core = "0.6.3"
1920
serde = { version = "1.0", features = ["derive"] }
2021
serde_json = "1.0"
2122

23+
[target.'cfg(not(windows))'.dependencies]
24+
# non-windows: use default rug backend
25+
mithril-stm = { path = "../../mithril-stm" }
26+
27+
[target.'cfg(windows)'.dependencies]
28+
# Windows doesn't support rug backend, fallback to num-integer
29+
mithril-stm = { path = "../../mithril-stm", default-features = false, features = ["num-integer-backend"] }
30+
2231
[features]
23-
portable = ["mithril-common/portable"]
32+
portable = ["mithril-common/portable", "mithril-stm/portable"]

demo/protocol-demo/src/demonstrator.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ use std::fs;
77
use std::io::Write;
88
use std::path;
99

10-
use mithril_common::crypto_helper::{
11-
key_decode_hex, key_encode_hex, ProtocolClerk, ProtocolInitializerNotCertified,
12-
ProtocolKeyRegistrationNotCertified, ProtocolMultiSignature, ProtocolParameters,
13-
ProtocolPartyId, ProtocolSigner, ProtocolSignerVerificationKey, ProtocolSingleSignature,
14-
ProtocolStake,
10+
use mithril_common::crypto_helper::{key_decode_hex, key_encode_hex};
11+
12+
use crate::types::{
13+
ProtocolClerk, ProtocolInitializerNotCertified, ProtocolKeyRegistrationNotCertified,
14+
ProtocolMultiSignature, ProtocolParameters, ProtocolPartyId, ProtocolSigner,
15+
ProtocolSignerVerificationKey, ProtocolSingleSignature, ProtocolStake,
1516
};
1617

1718
/// Player artifacts

demo/protocol-demo/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
mod demonstrator;
2+
mod types;
23

34
use crate::demonstrator::{Demonstrator, ProtocolDemonstrator};
45
use clap::Parser;

demo/protocol-demo/src/types.rs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
use mithril_stm::key_reg::KeyReg;
2+
use mithril_stm::stm::{
3+
Stake, StmAggrSig, StmClerk, StmInitializer, StmParameters, StmSig, StmSigner,
4+
StmVerificationKeyPoP,
5+
};
6+
7+
use blake2::{digest::consts::U32, Blake2b};
8+
9+
// Protocol types alias
10+
type D = Blake2b<U32>;
11+
12+
/// The id of a mithril party.
13+
pub type ProtocolPartyId = String;
14+
15+
/// Alias of [MithrilStm:Stake](type@mithril_stm::stm::Stake).
16+
pub type ProtocolStake = Stake;
17+
18+
/// Alias of [MithrilStm::StmParameters](struct@mithril_stm::stm::StmParameters).
19+
pub type ProtocolParameters = StmParameters;
20+
21+
/// Alias of [MithrilStm:StmSigner](struct@mithril_stm::stm::StmSigner).
22+
pub type ProtocolSigner = StmSigner<D>;
23+
24+
/// Alias of [MithrilStm:StmClerk](struct@mithril_stm::stm::StmClerk).
25+
pub type ProtocolClerk = StmClerk<D>;
26+
27+
/// Alias of [MithrilStm:StmInitializer](struct@mithril_stm::stm::StmInitializer).
28+
pub type ProtocolInitializerNotCertified = StmInitializer;
29+
30+
/// Alias of [MithrilStm:KeyReg](struct@mithril_stm::key_reg::KeyReg). (Test only)
31+
pub type ProtocolKeyRegistrationNotCertified = KeyReg;
32+
33+
/// Alias of [MithrilStm:StmSig](struct@mithril_stm::stm::StmSig).
34+
pub type ProtocolSingleSignature = StmSig;
35+
36+
/// Alias of [MithrilStm:StmAggrSig](struct@mithril_stm::stm::StmAggrSig).
37+
pub type ProtocolMultiSignature = StmAggrSig<D>;
38+
39+
/// Alias of [MithrilStm:StmVerificationKeyPoP](type@mithril_stm::stm::StmVerificationKeyPoP).
40+
pub type ProtocolSignerVerificationKey = StmVerificationKeyPoP;

docs/blog/2022-10-11-keys-certification-badge/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ authors:
55
tags: [cardano, poolId, operational-certificate, kes-keys, mithril-keys, hybrid-mode]
66
---
77

8+
**Update 2022/12/19**: The signer registration with **declarative** PoolId has been decommissioned.
9+
10+
**Update 2022/11/30**: The signer registration with **declarative** PoolId has been deprecated and the **certified** PoolId is now the stable mode.
11+
812
### The way the Mithril nodes handle the Certification of the SPOs is evolving
913

1014
**PR**: `New STM registration procedure` [#433](https://github.com/input-output-hk/mithril/pull/433)

docs/root/manual/developer-docs/nodes/mithril-signer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ Here is a list of the available parameters:
182182
| `db_directory` | `--db-directory` | - | `DB_DIRECTORY` | Directory to snapshot from the **Cardano Node** | `/db` | - | :heavy_check_mark: |
183183
| `network` | - | - | `NETWORK` | Cardano network | - | `testnet` or `mainnet` or `devnet` | :heavy_check_mark: |
184184
`network_magic` | - | - | `NETWORK_MAGIC` | Cardano Network Magic number (for `testnet` and `devnet`) | - | `1097911063` or `42` | - |
185-
| `party_id` | - | - | `PARTY_ID` | Party Id of the signer, usually the `Pool Id` of the SPO | - | `pool1pxaqe80sqpde7902er5kf6v0c7y0sv6d5g676766v2h829fvs3x` | - | Mandatory in `Pool Id Declaration Mode` where the owner is not verified (soon to be deprecated)
185+
| `party_id` | - | - | `PARTY_ID` | Party Id of the signer, usually the `Pool Id` of the SPO | - | `pool1pxaqe80sqpde7902er5kf6v0c7y0sv6d5g676766v2h829fvs3x` | - | Mandatory in `Pool Id Declaration Mode` where the owner is not verified (decommissioned, only available when built with `allow_skip_signer_certification` feature, for test only)
186186
| `run_interval` | - | - | `RUN_INTERVAL` | Interval between two runtime cycles in ms | - | `60000` | :heavy_check_mark: |
187187
| `aggregator_endpoint` | - | - | `AGGREGATOR_ENDPOINT` | Aggregator node endpoint | - | `https://aggregator.pre-release-preview.api.mithril.network/aggregator` | :heavy_check_mark: |
188188
| `data_stores_directory` | - | - | `DATA_STORES_DIRECTORY` | Directory to store signer data (Stakes, Protocol initializers, ...) | - | `./mithril-signer/stores` | :heavy_check_mark: |

docs/root/manual/getting-started/run-signer-node.md

Lines changed: 5 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@ For more information about the **Mithril Protocol**, please refer to the [About
3535
## What you'll need
3636

3737
* Operating a **Cardano Node** as a **Stake Pool**:
38-
* **Stable**:
39-
* The Cardano `Operational Certificate` file of the pool
40-
* The Cardano `KES Secret Key` file of the pool
41-
* **Deprecated**: The Cardano `Pool Id` in a `BECH32` format such as `pool1frevxe70aqw2ce58c0muyesnahl88nfjjsp25h85jwakzgd2g2l`
38+
* The Cardano `Operational Certificate` file of the pool
39+
* The Cardano `KES Secret Key` file of the pool
4240

4341
* Access to the file system of a `relay` **Cardano Node** running on the `testnet`:
4442
* Read rights on the `Database` folder (`--database-path` setting of the **Cardano Node**)
@@ -54,30 +52,15 @@ For more information about the **Mithril Protocol**, please refer to the [About
5452

5553
## Mithril Keys Certification
5654

57-
:::danger
58-
59-
The cryptographic certification of the Mithril keys is an experimental feature. We strongly recommend that you first setup a Mithril Signer node in the stable mode. Once you are able to sign in the stable mode is a good time to start experimenting with the keys certification.
60-
61-
Your feedback is very important, so feel free to contact us on the #moria channel on the IOG [Discord server](https://discord.gg/5kaErDKDRq), or to file an issue on GitHub.
62-
63-
:::
6455

65-
### Stable mode: Certify your Pool Id
56+
### Certify your Pool Id
6657

67-
In this mode, you declare your Cardano `Operational Certificate` file and `KES Secret Key` file which allows to:
58+
You must declare your Cardano `Operational Certificate` file and `KES Secret Key` file which allows to:
6859

6960
* Compute automatically the `PoolId`
7061
* Verify that you are the owner of the `PoolId`, and thus of the associated stakes used by Mithril protocol
7162
* Verify that you are the owner of the Mithril `Signer Secret Key`, and thus allowed to contribute to the multi-signatures and certificate production of the Mithril network
7263

73-
This mode is displayed with a specific **Stable** mention in this document.
74-
75-
### Deprecated mode: Declare your Pool Id
76-
77-
In this mode, the Cardano `Pool Id` that you specify is not strictly verified. It is associated to Cardano stakes based on your declaration. This mode is deprecated and replaced by the certification mode above.
78-
79-
This mode is presented in the setup of this document with a specific **Deprecated** mention.
80-
8164
## Building your own executable
8265

8366
### Download source
@@ -164,7 +147,7 @@ sudo mv mithril-signer /opt/mithril
164147
* `User=cardano`:
165148
Replace this value with the correct user. We assume that the user used to run the **Cardano Node** is `cardano`. The **Mithril Signer** must imperatively run with the same user.
166149

167-
* **Stable mode**: in the `/opt/mithril/mithril-signer/service.env` env file:
150+
* In the `/opt/mithril/mithril-signer/service.env` env file:
168151
* `KES_SECRET_KEY_PATH=/cardano/keys/kes.skey`: replace `/cardano/keys/kes.skey` with the path to your Cardano `KES Secret Key` file
169152
* `OPERATIONAL_CERTIFICATE_PATH=/cardano/cert/opcert.cert`: replace `/cardano/cert/opcert.cert` with the path to your Cardano `Operational Certificate` file
170153
* `DB_DIRECTORY=/cardano/db`: replace `/cardano/db` with the path to the database folder of the **Cardano Node** (the one in `--database-path`)
@@ -173,20 +156,10 @@ Replace this value with the correct user. We assume that the user used to run th
173156
* `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.)
174157
* `STORE_RETENTION_LIMIT`: if set, this will limit the number of records in some internal stores (5 is a good fit).
175158

176-
* **Deprecated mode**: in the `/opt/mithril/mithril-signer/service.env` env file:
177-
* `PARTY_ID=YOUR_POOL_ID_BECH32`: replace `YOUR_POOL_ID_BECH32` with your BECH32 `Pool Id`
178-
* `DB_DIRECTORY=/cardano/db`: replace `/cardano/db` with the path to the database folder of the **Cardano Node** (the one in `--database-path`)
179-
* `CARDANO_NODE_SOCKET_PATH=/cardano/ipc/node.socket`: replace with the path to the IPC file (`CARDANO_NODE_SOCKET_PATH` env var)
180-
* `CARDANO_CLI_PATH=/app/bin/cardano-cli`: replace with the path to the `cardano-cli` executable
181-
* `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.)
182-
* `STORE_RETENTION_LIMIT`: if set, this will limit the number of records in some internal stores (5 is a good fit).
183-
184159
:::
185160

186161
First create an env file that will be used by the service:
187162

188-
* **Stable mode**:
189-
190163
```bash
191164
sudo bash -c 'cat > /opt/mithril/mithril-signer.env << EOF
192165
KES_SECRET_KEY_PATH=**YOUR_KES_SECRET_KEY_PATH**
@@ -202,22 +175,6 @@ STORE_RETENTION_LIMIT=5
202175
EOF'
203176
```
204177

205-
* **Deprecated mode**:
206-
207-
```bash
208-
sudo bash -c 'cat > /opt/mithril/mithril-signer.env << EOF
209-
PARTY_ID=**YOUR_POOL_ID_BECH32**
210-
NETWORK=**YOUR_CARDANO_NETWORK**
211-
AGGREGATOR_ENDPOINT=**YOUR_AGGREGATOR_ENDPOINT**
212-
RUN_INTERVAL=60000
213-
DB_DIRECTORY=/cardano/db
214-
CARDANO_NODE_SOCKET_PATH=/cardano/ipc/node.socket
215-
CARDANO_CLI_PATH=/app/bin/cardano-cli
216-
DATA_STORES_DIRECTORY=/opt/mithril/stores
217-
STORE_RETENTION_LIMIT=5
218-
EOF'
219-
```
220-
221178
Then we will create a `/etc/systemd/system/mithril-signer.service` description file for our service
222179

223180
```bash

0 commit comments

Comments
 (0)