Skip to content

Commit

Permalink
Merge pull request #433 from input-output-hk/mock_certification
Browse files Browse the repository at this point in the history
New STM registration procedure
  • Loading branch information
jpraynaud authored Oct 11, 2022
2 parents 329d6fa + d49cdb4 commit 978f15f
Show file tree
Hide file tree
Showing 85 changed files with 2,973 additions and 1,213 deletions.
141 changes: 133 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[workspace]

resolver = "2"

members = [
"demo/protocol-demo",
"mithril-aggregator",
Expand Down
2 changes: 1 addition & 1 deletion demo/protocol-demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ base64 = "0.13.0"
clap = { version = "3.1.6", features = ["derive"] }
hex = "0.4.3"
log = "0.4.14"
mithril-common = { path = "../../mithril-common" }
mithril-common = { path = "../../mithril-common", features = ["allow_skip_signer_certification"]}
rand_chacha = "0.3.1"
rand_core = "0.6.3"
serde = { version = "1.0", features = ["derive"] }
Expand Down
15 changes: 8 additions & 7 deletions demo/protocol-demo/src/demonstrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ use std::io::Write;
use std::path;

use mithril_common::crypto_helper::{
key_decode_hex, key_encode_hex, ProtocolClerk, ProtocolInitializer, ProtocolKeyRegistration,
ProtocolMultiSignature, ProtocolParameters, ProtocolPartyId, ProtocolSigner,
ProtocolSignerVerificationKey, ProtocolSingleSignature, ProtocolStake,
key_decode_hex, key_encode_hex, ProtocolClerk, ProtocolInitializerNotCertified,
ProtocolKeyRegistrationNotCertified, ProtocolMultiSignature, ProtocolParameters,
ProtocolPartyId, ProtocolSigner, ProtocolSignerVerificationKey, ProtocolSingleSignature,
ProtocolStake,
};

/// Player artifacts
Expand Down Expand Up @@ -98,15 +99,15 @@ impl Party {
self.party_id, players
);

let mut key_reg = ProtocolKeyRegistration::init();
let mut key_reg = ProtocolKeyRegistrationNotCertified::init();
for (_party_id, stake, verification_key) in players_with_keys {
key_reg.register(*stake, *verification_key).unwrap();
}
let closed_reg = key_reg.close();

let seed = [0u8; 32];
let mut rng = ChaCha20Rng::from_seed(seed);
let p = ProtocolInitializer::setup(self.params.unwrap(), self.stake, &mut rng);
let p = ProtocolInitializerNotCertified::setup(self.params.unwrap(), self.stake, &mut rng);
self.signer = Some(p.new_signer(closed_reg).unwrap());
self.clerk = Some(ProtocolClerk::from_signer(self.signer.as_ref().unwrap()));
}
Expand Down Expand Up @@ -237,7 +238,7 @@ impl Verifier {
.collect::<Vec<_>>();
println!("Verifier: protocol keys registration from {:?}", players);

let mut key_reg = ProtocolKeyRegistration::init();
let mut key_reg = ProtocolKeyRegistrationNotCertified::init();
for (_party_id, stake, verification_key) in players_with_keys {
key_reg.register(*stake, *verification_key).unwrap();
}
Expand Down Expand Up @@ -367,7 +368,7 @@ impl ProtocolDemonstrator for Demonstrator {
let mut players_artifacts = Vec::new();
for (party_id, stake) in players {
let protocol_initializer =
ProtocolInitializer::setup(self.params.unwrap(), stake, &mut rng);
ProtocolInitializerNotCertified::setup(self.params.unwrap(), stake, &mut rng);
let verification_key: ProtocolSignerVerificationKey =
protocol_initializer.verification_key();
players_artifacts.push(PlayerArtifact {
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"clsx": "^1.1.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"redocusaurus": "^1.3.0"
"redocusaurus": "^1.4.0"
},
"browserslist": {
"production": [
Expand Down
4 changes: 3 additions & 1 deletion docs/root/manual/developer-docs/nodes/mithril-signer.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,10 @@ Here is a list of the available parameters:
| `db_directory` | `--db-directory` | - | `DB_DIRECTORY` | Directory to snapshot from the **Cardano Node** | `/db` | - | :heavy_check_mark: |
| `network` | - | - | `NETWORK` | Cardano network | - | `testnet` or `mainnet` or `devnet` | :heavy_check_mark: |
`network_magic` | - | - | `NETWORK_MAGIC` | Cardano Network Magic number (for `testnet` and `devnet`) | - | `1097911063` or `42` | - |
| `party_id` | - | - | `PARTY_ID` | Party Id of the signer, usually the `PoolId` of the SPO | - | `pool1pxaqe80sqpde7902er5kf6v0c7y0sv6d5g676766v2h829fvs3x` | :heavy_check_mark: |
| `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)
| `run_interval` | - | - | `RUN_INTERVAL` | Interval between two runtime cycles in ms | - | `60000` | :heavy_check_mark: |
| `aggregator_endpoint` | - | - | `AGGREGATOR_ENDPOINT` | Aggregator node endpoint | - | `https://aggregator.api.mithril.network/aggregator` | :heavy_check_mark: |
| `data_stores_directory` | - | - | `DATA_STORES_DIRECTORY` | Directory to store signer data (Stakes, Protocol initializers, ...) | - | `./mithril-signer/stores` | :heavy_check_mark: |
| `store_retention_limit` | - | - | `STORE_RETENTION_LIMIT` | Maximum number of records in stores. If not set, no limit is set. | - | - | - |
| `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) | - | - | - |
| `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) | - | - | - |
Loading

0 comments on commit 978f15f

Please sign in to comment.