Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
098e3ea
feature(protocol-config): Implement on-chain reader for protocol conf…
turmelclem Aug 4, 2026
8126da9
refactor(protocol-config): moving mechanism checking configuration co…
turmelclem Aug 6, 2026
5bacf4c
feature(protocol-config): add markers implementation of MithrilNetwor…
turmelclem Aug 6, 2026
37a4768
feature(protocol-config): Implement a protocol configuration builder
turmelclem Aug 7, 2026
5b63d91
feature(signer): Wiring MarkersMithrilNetworkConfigurationProvider
turmelclem Aug 7, 2026
b33e27c
feature(aggregator, protocol-config): Wiring MarkersMithrilNetworkCon…
turmelclem Aug 10, 2026
6f656e9
refactor(aggregator): refactor usage of parameters for protocol-confi…
turmelclem Aug 10, 2026
ad58e5f
refactor(signer): make protocol_configuration_reader_adapter_config o…
turmelclem Aug 25, 2026
e9c5825
refactor(aggregator): Make aggregator follower use on-chain protocol …
turmelclem Aug 25, 2026
1733474
refactor(end-to-end): improve environement variables mecanism
turmelclem Aug 26, 2026
bc99845
refactor(end-to-end): use a dedicated protocol configuration reader a…
turmelclem Aug 26, 2026
9d6e9b9
refactor(protocol-config, aggregator, e2e): improve FakeConfig with c…
turmelclem Aug 26, 2026
65e41db
refactor(protocol-config): simplify SignedProtocolConfigurationMarker…
turmelclem Aug 26, 2026
cc7d95c
feature(ci): add a e2e test running signer with HTTP adapter for prot…
turmelclem Aug 26, 2026
ec4a623
refactor(end-to-end): mutualize cardano chain command for funds and d…
turmelclem Aug 26, 2026
c9d10f1
refactor(aggregator): make protocol_configuration_reader_adapter_conf…
turmelclem Aug 27, 2026
3005ee4
refactor(cardano-node-chain): ensure a deterministic order when retri…
turmelclem Aug 27, 2026
4fbf349
docs: update changelog
turmelclem Aug 27, 2026
f9f5aac
chore: upgrade crate versions and `mithril-test-lab/cardano-devnet/VE…
turmelclem Aug 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,14 @@ jobs:
]

include:
# Include a test with a signer using HTTP adapter for protocol configurations (instead of on-chain by default)
- mode: "signer-legacy-http-protocol-configurations"
era: ${{ fromJSON(needs.build-ubuntu.outputs.eras)[0] }}
next_era: ""
cardano_node_version: "11.0.1"
hard_fork_latest_era_at_epoch: 0
run_id: "#1"
extra_args: "--signer-protocol-configuration-reader-adapter=http --aggregate-signature-type=Concatenation full --check-client-cli-snapshot-converter"
# Include a test for partial decentralization with leader/follower signer registration and P2P signature registration with Haskell DMQ node (without fallback signature delayer)
- mode: "leader-follower-dmq-haskell-skip-delayer"
era: ${{ fromJSON(needs.build-ubuntu.outputs.eras)[0] }}
Expand Down
21 changes: 11 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,7 @@ As a minor extension, we have adopted a slightly different versioning convention
- **UNSTABLE**:
- Support for bytes encoding of the SNARK aggregate signatures in the certificates.
- Reduced the encoded size of the SNARK proofs by serializing their bytes as CBOR byte strings.

| Crate | Version |
| ------------------- | ------- |
| mithril-aggregator | `-` |
| mithril-client | `-` |
| mithril-client-cli | `-` |
| mithril-client-wasm | `-` |
| mithril-common | `-` |
| mithril-signer | `-` |
| mithril-stm | `-` |
- Support for reading on-chain protocol configurations for both Aggregator and Signer.

- **UNSTABLE** Reworked the Mithril aggregator's file archiver to produce byte-stable archives across systems.
- Existing archives must be regenerated by the Mithril aggregator to ensure byte stability.
Expand All @@ -33,6 +24,16 @@ As a minor extension, we have adopted a slightly different versioning convention
removal should not impact standard operations using current Mithril distributions.
- Users relying on older `Gzip` snapshot artifacts or custom aggregators producing `Gzip` archives must migrate to `Zstandard`.

| Crate | Version |
| ------------------- | ------- |
| mithril-aggregator | `-` |
| mithril-client | `-` |
| mithril-client-cli | `-` |
| mithril-client-wasm | `-` |
| mithril-common | `-` |
| mithril-signer | `-` |
| mithril-stm | `-` |

## Mithril Distribution [2630.0] - 2026-08-03

- **REMOVED** support for `CardanoImmutableFilesFull` in Mithril signer and aggregator:
Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock

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

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-cardano-node-chain"
version = "0.1.29"
version = "0.1.30"
authors.workspace = true
documentation.workspace = true
edition.workspace = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use hex::FromHex;
use nom::IResult;
use rand_core::RngCore;
use serde_json::Value;
use std::collections::HashMap;
use std::collections::{BTreeMap, HashMap};
use std::fs;
use std::path::PathBuf;
use tokio::process::Command;
Expand Down Expand Up @@ -515,7 +515,8 @@ impl ChainObserver for CardanoCliChainObserver {
.launch_utxo(address)
.await
.map_err(ChainObserverError::General)?;
let v: HashMap<String, Value> = serde_json::from_str(&output)

let v: BTreeMap<String, Value> = serde_json::from_str(&output)
.with_context(|| format!("output was = '{output}'"))
.map_err(ChainObserverError::InvalidContent)?;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ anyhow = { workspace = true }
async-trait = { workspace = true }
digest = { workspace = true }
hex = { workspace = true }
mithril-common = { path = "../../../mithril-common", version = "0.7.17" }
mithril-common = { path = "../../../mithril-common", version = "0.7.18" }
serde = { workspace = true }
serde_json = { workspace = true }
sha2 = "0.10.9"
Expand Down
2 changes: 1 addition & 1 deletion internal/mithril-aggregator-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ include = ["**/*.rs", "Cargo.toml", "README.md"]
[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
mithril-common = { path = "../../mithril-common", version = "0.7.17" }
mithril-common = { path = "../../mithril-common", version = "0.7.18" }
reqwest = { workspace = true }
semver = { workspace = true }
serde = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion internal/mithril-aggregator-discovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ include = ["**/*.rs", "Cargo.toml", "README.md", ".gitignore"]
anyhow = { workspace = true }
async-trait = { workspace = true }
mithril-aggregator-client = { path = "../mithril-aggregator-client", version = "0.2.4" }
mithril-common = { path = "../../mithril-common", version = "0.7.17" }
mithril-common = { path = "../../mithril-common", version = "0.7.18" }
rand = { version = "0.10.2" }
reqwest = { workspace = true }
serde = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion internal/mithril-protocol-config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-protocol-config"
version = "0.1.13"
version = "0.1.14"
description = "Configuraton parameters for Mithril network"
authors = { workspace = true }
edition = { workspace = true }
Expand Down
157 changes: 157 additions & 0 deletions internal/mithril-protocol-config/src/builder.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
//! Builder for creating a ProtocolConfigurationMarkersReader based on AdapterConfig.

use std::{str::FromStr, sync::Arc};

use serde::Deserialize;

use mithril_cardano_node_chain::{chain_observer::ChainObserver, entities::ChainAddress};
use mithril_common::{
crypto_helper::ProtocolConfigurationMarkersVerifierVerificationKey,
entities::ProtocolParameters,
};

use crate::{
cardano_chain::protocol_configuration_reader::CardanoChainProtocolConfigurationMarkersReader,
interface::ProtocolConfigurationMarkersReader,
test::double::FakeProtocolConfigurationMarkersReader,
};

/// Configuration of Protocol Configuration Adapter
#[derive(Debug, Clone, Deserialize, PartialEq)]
#[serde(rename_all = "kebab-case", tag = "type")]
pub enum AdapterConfig {
/// Cardano chain protocol configuration adapter
CardanoChain {
/// Cardano chain address
address: ChainAddress,

/// Verification key
verification_key: Box<ProtocolConfigurationMarkersVerifierVerificationKey>,
},
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed

/// Fake protocol configuration adapter with given protocol parameters and default value, at epoch 0 (for test usage)
Fake {
/// Protocol parameters
protocol_parameters: ProtocolParameters,
},
}
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed

impl FromStr for AdapterConfig {
type Err = serde_json::Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
serde_json::from_str(s)
}
}

/// Build a ProtocolConfigurationMarkersReader from configuration settings.
pub fn build_protocol_configuration_adapter(
adapter_config: AdapterConfig,
chain_observer: Arc<dyn ChainObserver>,
) -> Arc<dyn ProtocolConfigurationMarkersReader> {
match adapter_config {
AdapterConfig::CardanoChain {
address,
verification_key,
} => Arc::new(CardanoChainProtocolConfigurationMarkersReader::new(
address,
chain_observer,
*verification_key,
)),
AdapterConfig::Fake {
protocol_parameters,
} => Arc::new(
FakeProtocolConfigurationMarkersReader::default_with_protocol_parameters(
protocol_parameters,
),
),
}
}

#[cfg(test)]
mod test {

use super::*;

static VERIFICATION_KEY: &str = "5b35352c3232382c3134342c38372c3133382c3133362c34382c382c31342c3138372c38352c3134382c39372c3233322c3235352c3232392c33382c3234342c3234372c3230342c3139382c31332c33312c3232322c32352c3136342c35322c3130322c39312c3132302c3230382c3134375d";

#[test]
fn deserialize_cardano_chain_adapter_config_from_json() {
let serialized_json = serde_json::json!({
"type": "cardano-chain",
"address": "my_address",
"verification_key": VERIFICATION_KEY,
});

let payload = serde_json::to_string(&serialized_json).unwrap();
let deserialized: AdapterConfig = serde_json::from_str(&payload).unwrap();

assert_eq!(
deserialized,
AdapterConfig::CardanoChain {
address: "my_address".to_string(),
verification_key: Box::new(VERIFICATION_KEY.try_into().expect("should not fail"))
}
);
}

#[test]
fn deserialize_fake_adapter_config_from_json() {
let serialized_json = serde_json::json!({
"type": "fake",
"protocol_parameters": {
"k": 1944,
"m": 16948,
"phi_f": 0.2
},
});

let payload = serde_json::to_string(&serialized_json).unwrap();
let deserialized: AdapterConfig = serde_json::from_str(&payload).unwrap();

assert_eq!(
deserialized,
AdapterConfig::Fake {
protocol_parameters: ProtocolParameters {
k: 1944,
m: 16948,
phi_f: 0.2
}
}
);
}

#[test]
fn rejects_adapter_config_with_invalid_verification_key() {
let invalid_verification_key = "invalid_verification_key";

let serialized_json = serde_json::json!({
"type": "cardano-chain",
"address": "my_address",
"verification_key": invalid_verification_key,
});

let payload = serde_json::to_string(&serialized_json).unwrap();
let result = serde_json::from_str::<AdapterConfig>(&payload);
assert!(result.is_err())
}

#[test]
fn rejects_adapter_config_with_unknown_type() {
let serialized_json = serde_json::json!({
"type": "invalid-type",
"address": "A",
"verification_key": "B",
});

let payload = serde_json::to_string(&serialized_json).unwrap();
let result = serde_json::from_str::<AdapterConfig>(&payload);
assert!(result.is_err());
assert!(
result
.unwrap_err()
.to_string()
.contains("unknown variant `invalid-type`")
);
}
}
Loading
Loading