Skip to content

Commit

Permalink
Add 'skip_signer_certification' feature
Browse files Browse the repository at this point in the history
So we can smoothly migrate the Signers first and then the Aggregator on the preview network,
also the Signer certification is not needed in the protocol demo.
  • Loading branch information
jpraynaud committed Sep 15, 2022
1 parent 391dfdf commit e6dcad3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions demo/protocol-demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

[features]
default = ["skip_signer_certification"]
portable = ["mithril-common/portable"]
skip_signer_certification = ["mithril-common/skip_signer_certification"]
2 changes: 2 additions & 0 deletions mithril-aggregator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,7 @@ slog-term = "2.9.0"
tempfile = "3.3.0"

[features]
default = ["skip_signer_certification"] # TODO: remove 'skip_signer_certification' from default features to activate full signer certification
portable = ["mithril-common/portable"]
skip_signer_certification = ["mithril-common/skip_signer_certification"]

1 change: 1 addition & 0 deletions mithril-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ slog-scope = "4.4.0"

[features]
portable = ["mithril/portable"]
skip_signer_certification = []
4 changes: 4 additions & 0 deletions mithril-common/src/crypto_helper/cardano/key_certification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ impl KeyRegWrapper {
let cert = OpCert::from_file(opcert_path)?;

cert.validate().map_err(|_| RegisterError::InvalidOpCert)?;

#[cfg(feature = "skip_signer_certification")]
println!("WARNING: Signer certification is skipped!!!");
#[cfg(feature = "skip_signer_certification")]
kes_sig
.verify(kes_period, &cert.kes_vk, &pk.to_bytes())
.map_err(|_| RegisterError::KesSignatureInvalid)?;
Expand Down
2 changes: 2 additions & 0 deletions mithril-signer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ mockall = "0.11.0"
slog-term = "2.9.0"

[features]
default = ["skip_signer_certification"] # TODO: remove 'skip_signer_certification' from default features to activate full signer certification
portable = ["mithril-common/portable"]
skip_signer_certification = ["mithril-common/skip_signer_certification"]

0 comments on commit e6dcad3

Please sign in to comment.