Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
7d04283
feature(aggregator): WIP: add protocol-config dependency and start a …
turmelclem Oct 7, 2025
51ce8a1
feat(aggregator): implement local configuration for mithril network c…
turmelclem Oct 10, 2025
f920b08
chore(aggregator): remove update_epoch_settings from epoch_service, c…
turmelclem Nov 3, 2025
b0003a8
refactor(aggregator): do not override existing epoch settings on save
turmelclem Nov 3, 2025
83b2b49
feat(aggregator): add `preload_security_parameter` config parameter
Alenar Nov 5, 2025
d2f5a24
doc(website): add `preload_security_parameter` to aggregator doc
Alenar Nov 10, 2025
f510adc
feat(aggregator): make protocol_parameters and cardano_transaction_si…
turmelclem Nov 4, 2025
6322f2e
test(aggregator): simplify & rework serve deps container test tooling
Alenar Nov 4, 2025
ba06a3c
feat(aggregator): move & rework handle discrepancies
Alenar Nov 5, 2025
e07488c
chore(aggregator): log when a dependency is built by the dep builder
Alenar Nov 5, 2025
462a091
fix(e2e): only update protocol parameters on leader aggregator
Alenar Nov 6, 2025
dcf4f5a
feat(aggregator): improve logging when single signature authenticatio…
turmelclem Nov 7, 2025
befb13c
feat(e2e): output logs in expandable group when running in github act…
Alenar Nov 6, 2025
36e7a40
chore(e2e): disable log group in github action
Alenar Nov 10, 2025
c93b35b
feat(aggregator): make epoch service allowed discriminants an interse…
Alenar Nov 10, 2025
f57be30
chore(openapi): prepare removal of `signer_registration_protocol` and…
Alenar Nov 12, 2025
904b2fd
chore: prepare removal of protocol params & ctx config from `EpochSet…
Alenar Nov 12, 2025
baa84f3
chore(common): deprecate protocol params & ctx config fields in `Epoc…
Alenar Nov 12, 2025
b0ce1b1
style: address PR comments
Alenar Nov 13, 2025
a5cb7ab
chore(signer): set default `preload_security_parameter` to `2160`
Alenar Nov 13, 2025
5e8f70c
chore: upgrade crate versions and `openapi.yaml` version
Alenar Nov 13, 2025
fb152f8
chore: update changelog
Alenar Nov 13, 2025
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
7 changes: 3 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ As a minor extension, we have adopted a slightly different versioning convention

## Mithril Distribution [XXXX] - UNRELEASED

- **UNSTABLE**:
- Decentralization of the configuration parameters of Mithril networks:
- Added the `/protocol-configuration/{epoch}` route to fetch aggregator configuration for a given epoch, `{epoch}` must be a number.

- Enhanced `MithrilNetworkConfigurationProvider` to return configuration with a window of three epoch.
- Adapt Signer to read configurations from HttpMithrilNetworkConfigurationProvider
- Refactor Signer and Aggregator (leader, follower) to read network configurations from a `MithrilNetworkConfigurationProvider`
- Support for reading network configurations from its leader aggregator for the follower aggregators.

- Crates versions:

Expand Down
9 changes: 5 additions & 4 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
Expand Up @@ -537,6 +537,7 @@ Here is a list of the available parameters for the serve command:
| `cardano_transactions_prover_max_hashes_allowed_by_request` | `--cardano-transactions-prover-max-hashes-allowed-by-request` | - | `CARDANO_TRANSACTIONS_PROVER_MAX_HASHES_ALLOWED_BY_REQUEST` | Maximum number of transactions hashes allowed by request to the prover of the Cardano transactions | `100` | `100` | - |
| `cardano_transactions_block_streamer_max_roll_forwards_per_poll` | `--cardano-transactions-block-streamer-max-roll-forwards-per-poll` | - | `CARDANO_TRANSACTIONS_BLOCK_STREAMER_MAX_ROLL_FORWARDS_PER_POLL` | Maximum number of roll forwards during a poll of the block streamer when importing transactions | `1000` | `1000` | - |
| `cardano_transactions_signing_config` | `--cardano-transactions-signing-config` | - | `CARDANO_TRANSACTIONS_SIGNING_CONFIG` | Cardano transactions signing configuration | `{ "security_parameter": 3000, "step": 120 }` | `{ "security_parameter": 3000, "step": 120 }` | - |
| `preload_security_parameter` | - | - | `PRELOAD_SECURITY_PARAMETER` | Blocks offset, from the tip of the chain, to exclude during the cardano transactions preload<br/>`[default: 2160]`. | `2160` | - | :heavy_check_mark: |
| `enable_metrics_server` | `--enable-metrics-server` | - | `ENABLE_METRICS_SERVER` | Enable metrics HTTP server (Prometheus endpoint on /metrics) | `false` | - | - |
| `metrics_server_ip` | `--metrics-server-ip` | - | `METRICS_SERVER_IP` | Metrics HTTP server IP | `0.0.0.0` | - | - |
| `metrics_server_port` | `--metrics-server-port` | - | `METRICS_SERVER_PORT` | Metrics HTTP server listening port | `9090` | - | - |
Expand Down
3 changes: 2 additions & 1 deletion mithril-aggregator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-aggregator"
version = "0.7.93"
version = "0.7.94"
description = "A Mithril Aggregator server"
authors = { workspace = true }
edition = { workspace = true }
Expand Down Expand Up @@ -36,6 +36,7 @@ mithril-doc = { path = "../internal/mithril-doc" }
mithril-era = { path = "../internal/mithril-era" }
mithril-metric = { path = "../internal/mithril-metric" }
mithril-persistence = { path = "../internal/mithril-persistence" }
mithril-protocol-config = { path = "../internal/mithril-protocol-config" }
mithril-resource-pool = { path = "../internal/mithril-resource-pool" }
mithril-signed-entity-lock = { path = "../internal/signed-entity/mithril-signed-entity-lock" }
mithril-signed-entity-preloader = { path = "../internal/signed-entity/mithril-signed-entity-preloader" }
Expand Down
62 changes: 45 additions & 17 deletions mithril-aggregator/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub trait ConfigurationSource {
}

/// Protocol parameters
fn protocol_parameters(&self) -> ProtocolParameters {
fn protocol_parameters(&self) -> Option<ProtocolParameters> {
panic!("protocol_parameters is not implemented.");
}

Expand Down Expand Up @@ -251,10 +251,15 @@ pub trait ConfigurationSource {
}

/// Cardano transactions signing configuration
fn cardano_transactions_signing_config(&self) -> CardanoTransactionsSigningConfig {
fn cardano_transactions_signing_config(&self) -> Option<CardanoTransactionsSigningConfig> {
panic!("cardano_transactions_signing_config is not implemented.");
}

/// Blocks offset, from the tip of the chain, to exclude during the cardano transactions preload
fn preload_security_parameter(&self) -> BlockNumber {
panic!("preload_security_parameter is not implemented.");
}

/// Maximum number of transactions hashes allowed by request to the prover of the Cardano transactions
fn cardano_transactions_prover_max_hashes_allowed_by_request(&self) -> usize {
panic!("cardano_transactions_prover_max_hashes_allowed_by_request is not implemented.");
Expand Down Expand Up @@ -373,12 +378,20 @@ pub trait ConfigurationSource {
}
}

/// Infer the [AggregatorEpochSettings] from the configuration.
fn get_epoch_settings_configuration(&self) -> AggregatorEpochSettings {
AggregatorEpochSettings {
protocol_parameters: self.protocol_parameters(),
cardano_transactions_signing_config: self.cardano_transactions_signing_config(),
}
/// `leader aggregator only` Infer the [AggregatorEpochSettings] from the configuration.
fn get_leader_aggregator_epoch_settings_configuration(
&self,
) -> StdResult<AggregatorEpochSettings> {
Ok(AggregatorEpochSettings {
protocol_parameters: self.protocol_parameters().with_context(
|| "Configuration `protocol_parameters` is mandatory for a Leader Aggregator",
)?,
cardano_transactions_signing_config: self
.cardano_transactions_signing_config()
.with_context(
|| "Configuration `cardano_transactions_signing_config` is mandatory for a Leader Aggregator",
)?,
})
}

/// Check if the aggregator is running in follower mode.
Expand Down Expand Up @@ -453,7 +466,7 @@ pub struct ServeCommandConfiguration {

/// Protocol parameters
#[example = "`{ k: 5, m: 100, phi_f: 0.65 }`"]
pub protocol_parameters: ProtocolParameters,
pub protocol_parameters: Option<ProtocolParameters>,

/// Type of snapshot uploader to use
#[example = "`gcp` or `local`"]
Expand Down Expand Up @@ -556,7 +569,12 @@ pub struct ServeCommandConfiguration {

/// Cardano transactions signing configuration
#[example = "`{ security_parameter: 3000, step: 120 }`"]
pub cardano_transactions_signing_config: CardanoTransactionsSigningConfig,
pub cardano_transactions_signing_config: Option<CardanoTransactionsSigningConfig>,

/// Blocks offset, from the tip of the chain, to exclude during the Cardano transactions preload,
/// default to 2160.
#[example = "`2160`"]
pub preload_security_parameter: BlockNumber,

/// Maximum number of transactions hashes allowed by request to the prover of the Cardano transactions
pub cardano_transactions_prover_max_hashes_allowed_by_request: usize,
Expand Down Expand Up @@ -672,11 +690,11 @@ impl ServeCommandConfiguration {
network_magic: Some(42),
dmq_network_magic: Some(3141592),
chain_observer_type: ChainObserverType::Fake,
protocol_parameters: ProtocolParameters {
protocol_parameters: Some(ProtocolParameters {
k: 5,
m: 100,
phi_f: 0.95,
},
}),
snapshot_uploader_type: SnapshotUploaderType::Local,
snapshot_bucket_name: None,
snapshot_use_cdn_domain: false,
Expand Down Expand Up @@ -710,10 +728,11 @@ impl ServeCommandConfiguration {
allow_unparsable_block: false,
cardano_transactions_prover_cache_pool_size: 3,
cardano_transactions_database_connection_pool_size: 5,
cardano_transactions_signing_config: CardanoTransactionsSigningConfig {
cardano_transactions_signing_config: Some(CardanoTransactionsSigningConfig {
security_parameter: BlockNumber(120),
step: BlockNumber(15),
},
}),
preload_security_parameter: BlockNumber(30),
cardano_transactions_prover_max_hashes_allowed_by_request: 100,
cardano_transactions_block_streamer_max_roll_forwards_per_poll: 1000,
enable_metrics_server: true,
Expand Down Expand Up @@ -773,7 +792,7 @@ impl ConfigurationSource for ServeCommandConfiguration {
self.chain_observer_type.clone()
}

fn protocol_parameters(&self) -> ProtocolParameters {
fn protocol_parameters(&self) -> Option<ProtocolParameters> {
self.protocol_parameters.clone()
}

Expand Down Expand Up @@ -877,10 +896,14 @@ impl ConfigurationSource for ServeCommandConfiguration {
self.cardano_transactions_database_connection_pool_size
}

fn cardano_transactions_signing_config(&self) -> CardanoTransactionsSigningConfig {
fn cardano_transactions_signing_config(&self) -> Option<CardanoTransactionsSigningConfig> {
self.cardano_transactions_signing_config.clone()
}

fn preload_security_parameter(&self) -> BlockNumber {
self.preload_security_parameter
}

fn cardano_transactions_prover_max_hashes_allowed_by_request(&self) -> usize {
self.cardano_transactions_prover_max_hashes_allowed_by_request
}
Expand Down Expand Up @@ -981,6 +1004,9 @@ pub struct DefaultConfiguration {
/// Cardano transactions signing configuration
pub cardano_transactions_signing_config: CardanoTransactionsSigningConfig,

/// Blocks offset, from the tip of the chain, to exclude during the Cardano transactions preload
pub preload_security_parameter: u64,

/// Maximum number of transactions hashes allowed by request to the prover of the Cardano transactions
pub cardano_transactions_prover_max_hashes_allowed_by_request: u32,

Expand Down Expand Up @@ -1026,6 +1052,7 @@ impl Default for DefaultConfiguration {
security_parameter: BlockNumber(3000),
step: BlockNumber(120),
},
preload_security_parameter: 2160,
cardano_transactions_prover_max_hashes_allowed_by_request: 100,
cardano_transactions_block_streamer_max_roll_forwards_per_poll: 10000,
enable_metrics_server: "false".to_string(),
Expand Down Expand Up @@ -1104,14 +1131,15 @@ impl Source for DefaultConfiguration {
&namespace,
myself.persist_usage_report_interval_in_seconds
);
register_config_value!(result, &namespace, myself.preload_security_parameter);
register_config_value!(
result,
&namespace,
myself.cardano_transactions_signing_config,
|v: CardanoTransactionsSigningConfig| HashMap::from([
(
"security_parameter".to_string(),
ValueKind::from(*v.security_parameter,),
ValueKind::from(*v.security_parameter),
),
("step".to_string(), ValueKind::from(*v.step),)
])
Expand Down
Loading
Loading