Skip to content

Add aggregator CLI commands for configuration parameters - #3438

Open
turmelclem wants to merge 15 commits into
mainfrom
ctl/3392-add-aggregator-CLI-command-for-configuration-parameters
Open

Add aggregator CLI commands for configuration parameters#3438
turmelclem wants to merge 15 commits into
mainfrom
ctl/3392-add-aggregator-CLI-command-for-configuration-parameters

Conversation

@turmelclem

@turmelclem turmelclem commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Content

aggregator cli :

  • export command
    • look for markers on chain and export then into JSON format (if it exists, otherwise it export a default configuration)
  • import command generating datum file from a JSON file
    • verifying user JSON file consistency (non zero values, configurations and enabled signed entity type consistency)
    • verifying configuration to import against configuration on chain TODO
    • checking datum that not exceed 10kb (since a full cardano transaction is 16kb) TODO
    • writing a JSON HEX datum file at given path

protocol-config :

  • a adapter trait that is used by aggregagtor cli to retrieve information about protocol configuration markers
    • with the intelligence to retrieve the configuration of the nearest known epoch
  • cbor encoding/decoding of marker configuration

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • CHANGELOG file is updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • All check jobs of the CI have succeeded
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested
  • Documentation
    • Update README file (if relevant)
    • Update documentation website (if relevant)
    • Add dev blog post (if relevant)
    • Add ADR blog post or Dev ADR entry (if relevant)
    • No new TODOs introduced

Issue(s)

this PR closes #3392

@turmelclem turmelclem self-assigned this Jul 27, 2026
Comment thread internal/mithril-protocol-config/src/adapters/cardano_chain.rs Fixed
Comment thread internal/mithril-protocol-config/src/adapters/cardano_chain.rs Fixed
Comment thread internal/mithril-protocol-config/src/adapters/cardano_chain.rs Fixed
Comment thread internal/mithril-protocol-config/src/adapters/cardano_chain.rs Fixed

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clippy found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

Test Results

     5 files  ± 0     209 suites  ±0   50m 22s ⏱️ - 2h 24m 50s
 3 354 tests  - 52   3 354 ✅  - 52  0 💤 ±0  0 ❌ ±0 
11 167 runs   -  8  11 167 ✅  -  8  0 💤 ±0  0 ❌ ±0 

Results for commit 0f67a96. ± Comparison against base commit bf1c9b3.

This pull request removes 76 and adds 24 tests. Note that renamed tests count towards both.
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::index_out_of_bounds
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::index_too_large_for_circuit_range
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::indices_not_increasing
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::leaf_merkle_path_mismatch
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::leaf_swap_keep_merkle_path
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::leaf_wrong_verification_key
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::merkle_path_corrupt_sibling
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::merkle_path_flip_position
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::merkle_path_length_long
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::merkle_path_length_short
…
mithril-aggregator ‑ commands::protocol_configuration_command::tests::export_subcommand_parses_flag
mithril-aggregator ‑ commands::protocol_configuration_command::tests::import_subcommand_parses_flag
mithril-aggregator ‑ commands::protocol_configuration_command::tests::to_vec_human_readable_protocol_configuration_converts_markers_to_human_readable_list
mithril-aggregator ‑ commands::protocol_configuration_command::tests::verify_protocol_configurations::shoud_throw_error_if_enabled_entity_types_contains_cardano_blocks_transactions_without_configuration
mithril-aggregator ‑ commands::protocol_configuration_command::tests::verify_protocol_configurations::shoud_throw_error_if_enabled_entity_types_contains_cardano_transactions_without_configuration
mithril-aggregator ‑ commands::protocol_configuration_command::tests::verify_protocol_configurations::should_throw_error_with_protocol_parameter_at_zero
mithril-aggregator ‑ tools::protocol_configuration::tests::from_human_readable_protocol_configuration_converts_to_protocol_configuration_for_epoch
mithril-aggregator ‑ tools::protocol_configuration::tests::generate_tx_datum_ok
mithril-aggregator ‑ tools::protocol_configuration::tests::verify_configurations_against_chain::full_offset_window_have_to_be_repeated_if_it_have_different_configuration
mithril-aggregator ‑ tools::protocol_configuration::tests::verify_configurations_against_chain::ko_because_last_known_on_chain_configuration_b_for_offset_window_is_not_repeated
…

♻️ This comment has been updated with latest results.

Comment thread internal/mithril-protocol-config/src/cardano_chain/mod.rs Fixed
Comment thread internal/mithril-protocol-config/src/cardano_chain/mod.rs Fixed
Comment thread internal/mithril-protocol-config/src/cardano_chain/mod.rs Fixed
Comment thread internal/mithril-protocol-config/src/lib.rs Fixed
Comment thread internal/mithril-protocol-config/src/cardano_chain/mod.rs Fixed
Comment thread internal/mithril-protocol-config/src/cardano_chain/mod.rs Fixed
Comment thread internal/mithril-protocol-config/src/cardano_chain/mod.rs Fixed
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs Fixed
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs Fixed
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs Fixed
Comment thread mithril-aggregator/src/dependency_injection/containers/serve.rs Fixed
Comment thread mithril-aggregator/src/dependency_injection/containers/serve.rs Fixed
@turmelclem
turmelclem force-pushed the ctl/3392-add-aggregator-CLI-command-for-configuration-parameters branch 3 times, most recently from ddfd41b to 10aa1ef Compare July 30, 2026 12:38
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs Fixed
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs Fixed
@turmelclem
turmelclem marked this pull request as ready for review July 31, 2026 12:05
@turmelclem
turmelclem force-pushed the ctl/3392-add-aggregator-CLI-command-for-configuration-parameters branch from b51783c to 39da965 Compare July 31, 2026 12:11
@turmelclem
turmelclem force-pushed the ctl/3392-add-aggregator-CLI-command-for-configuration-parameters branch 5 times, most recently from 2d65553 to ccb24d2 Compare July 31, 2026 13:10
@jpraynaud
jpraynaud requested a review from Copilot July 31, 2026 13:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces new aggregator CLI commands to export/import protocol configuration markers, along with a new mithril-protocol-config reader interface/model and Cardano-chain message/payload encoding support to make protocol configuration markers portable and verifiable.

Changes:

  • Add protocol-configuration export-markers / import-markers CLI commands (JSON export + datum generation/import validation).
  • Add protocol-configuration “tools” and dependency injection wiring to read on-chain markers and generate signed datums.
  • Add mithril-protocol-config models/messages (CBOR encoding) + payload signing structure + test doubles.

Reviewed changes

Copilot reviewed 26 out of 27 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
mithril-stm/Cargo.toml Switch ciborium to workspace dependency for consistent versioning.
mithril-common/src/entities/type_alias.rs Add hex-encoded secret key type alias for protocol configuration markers.
mithril-common/src/crypto_helper/ed25519_alias.rs Add ED25519 type aliases for protocol configuration markers signing/verifying.
mithril-common/Cargo.toml Switch ciborium to workspace dependency.
mithril-aggregator/src/tools/protocol_configuration.rs New tool: verify imported configs against chain window + build signed datum + datum size check.
mithril-aggregator/src/tools/mod.rs Register/export ProtocolConfigurationTools.
mithril-aggregator/src/test/double/dummies.rs Add Dummy impl for HumanReadableProtocolConfiguration for tests.
mithril-aggregator/src/dependency_injection/containers/protocol_configuration.rs New DI container for protocol-configuration commands.
mithril-aggregator/src/dependency_injection/containers/mod.rs Export the new protocol-configuration DI container.
mithril-aggregator/src/dependency_injection/builder/support/compatibility.rs Add construction + getter for a ProtocolConfigurationMarkersReader (prod vs dummy).
mithril-aggregator/src/dependency_injection/builder/mod.rs Add stored dependency + container creation method for protocol-configuration commands.
mithril-aggregator/src/configuration.rs Add ProtocolConfigurationReaderParameters + ConfigurationSource accessor for reader params.
mithril-aggregator/src/commands/protocol_configuration_command.rs Implement CLI subcommands, JSON IO, consistency checks, datum generation.
mithril-aggregator/src/commands/mod.rs Wire new ProtocolConfiguration command into main CLI.
internal/mithril-protocol-config/src/test/double/mod.rs Export new dummy markers reader from test doubles.
internal/mithril-protocol-config/src/test/double/dummy_markers_reader.rs Add dummy ProtocolConfigurationMarkersReader for test environments.
internal/mithril-protocol-config/src/test/double/dummies.rs Add dummies for protocol-configuration marker models/messages.
internal/mithril-protocol-config/src/model.rs Add protocol configuration marker model + ConfigurationComputerFromMarkers helper with fallback lookup.
internal/mithril-protocol-config/src/lib.rs Export cardano_chain module publicly.
internal/mithril-protocol-config/src/interface.rs Add ProtocolConfigurationMarkersReader trait.
internal/mithril-protocol-config/src/cardano_chain/protocol_configuration_reader.rs Add Cardano-chain reader type for markers (currently stubbed).
internal/mithril-protocol-config/src/cardano_chain/payload.rs Add payload structs and signing helper for protocol configuration markers.
internal/mithril-protocol-config/src/cardano_chain/mod.rs Add Cardano-chain module exports for message/payload/reader.
internal/mithril-protocol-config/src/cardano_chain/message.rs Add CBOR message/codec for protocol configuration markers.
internal/mithril-protocol-config/Cargo.toml Add dependencies needed for CBOR/hex/serde + chain reader integration.
Cargo.toml Add workspace ciborium dependency.
Cargo.lock Lockfile updates for new deps/crate wiring.
Suppressed comments (1)

mithril-aggregator/src/commands/protocol_configuration_command.rs:345

  • User-facing CLI output contains spelling/grammar issues ("Sucessfuly write"), which makes the command output look unpolished.
        println!(
            "Sucessfuly write Tx datum file at {}",
            self.target_path.to_string_lossy()
        );

Comment thread mithril-aggregator/src/tools/protocol_configuration.rs Outdated
Comment thread mithril-aggregator/src/tools/protocol_configuration.rs
Comment thread mithril-aggregator/src/tools/protocol_configuration.rs
Comment thread mithril-aggregator/src/tools/protocol_configuration.rs Outdated
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs Outdated
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs
Comment thread mithril-aggregator/src/commands/protocol_configuration_command.rs Outdated
Comment thread internal/mithril-protocol-config/src/cardano_chain/message.rs Outdated
Comment thread internal/mithril-protocol-config/src/model.rs
@turmelclem
turmelclem force-pushed the ctl/3392-add-aggregator-CLI-command-for-configuration-parameters branch from ccb24d2 to 95471fe Compare July 31, 2026 15:01
…rsion, signature and generating tx datum for protocol configuration command
…ct to avoid missing signing when generating protocol config tx datum
@turmelclem
turmelclem force-pushed the ctl/3392-add-aggregator-CLI-command-for-configuration-parameters branch 2 times, most recently from ad5d80a to aba2fbb Compare July 31, 2026 15:28
@turmelclem
turmelclem force-pushed the ctl/3392-add-aggregator-CLI-command-for-configuration-parameters branch from aba2fbb to 0f67a96 Compare July 31, 2026 15:54
@turmelclem
turmelclem temporarily deployed to testing-preview July 31, 2026 16:09 — with GitHub Actions Inactive
@turmelclem
turmelclem temporarily deployed to testing-2-preview July 31, 2026 16:09 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement aggregator CLI commands for configuration parameters

3 participants