Skip to content

Commit d7ce977

Browse files
authored
Merge pull request #2689 from input-output-hk/jpraynaud/2680-stm-multiple-proof-system
feat: support multiple proof systems in STM
2 parents 098106d + d4b30d4 commit d7ce977

File tree

57 files changed

+825
-346
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+825
-346
lines changed

.github/workflows/actions/deploy-terraform-infrastructure/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ inputs:
114114
description: Mithril aggregator signed entity types parameters (discriminants names in an ordered comma separated list).
115115
required: false
116116
default: ""
117+
mithril_aggregator_aggregate_signature_type:
118+
description: Mithril aggregator aggregate signature type used to create certificates.
119+
required: false
120+
default: "Concatenation"
117121
mithril_aggregator_cdn_cname:
118122
description: Mithril aggregator uses CDN domain for constructing snapshot url.
119123
required: true
@@ -266,6 +270,7 @@ runs:
266270
mithril_era_reader_verification_key_url = "${{ inputs.mithril_era_reader_verification_key_url }}"
267271
mithril_era_reader_secret_key = "${{ inputs.mithril_era_reader_secret_key }}"
268272
mithril_aggregator_signed_entity_types = "${{ inputs.mithril_aggregator_signed_entity_types }}"
273+
mithril_aggregator_aggregate_signature_type = "${{ inputs.mithril_aggregator_aggregate_signature_type }}"
269274
mithril_aggregator_cdn_cname = "${{ inputs.mithril_aggregator_cdn_cname }}"
270275
mithril_aggregator_snapshot_use_cdn_domain = ${{ inputs.mithril_aggregator_snapshot_use_cdn_domain }}
271276
mithril_aggregator_snapshot_compression_algorithm = "${{ inputs.mithril_aggregator_snapshot_compression_algorithm }}"

.github/workflows/ci.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ jobs:
345345
cardano_node_version: ["10.4.1", "10.5.1"]
346346
hard_fork_latest_era_at_epoch: [0]
347347
run_id: ["#1", "#2", "#3"]
348-
extra_args: [""]
348+
extra_args: ["--aggregate-signature-type=Concatenation"]
349349

350350
include:
351351
# Include a test for partial decentralization with leader/follower signer registration and P2P signature registration
@@ -355,31 +355,31 @@ jobs:
355355
cardano_node_version: "10.4.1"
356356
hard_fork_latest_era_at_epoch: 0
357357
run_id: "#1"
358-
extra_args: "--number-of-aggregators=2 --use-relays --relay-signer-registration-mode=passthrough --relay-signature-registration-mode=p2p"
358+
extra_args: "--number-of-aggregators=2 --use-relays --relay-signer-registration-mode=passthrough --relay-signature-registration-mode=p2p --aggregate-signature-type=Concatenation"
359359
# Include a test for full dedentralization P2P signer registration and P2P signature registration
360360
- mode: "decentralized"
361361
era: ${{ fromJSON(needs.build-ubuntu.outputs.eras)[0] }}
362362
next_era: ""
363363
cardano_node_version: "10.4.1"
364364
hard_fork_latest_era_at_epoch: 0
365365
run_id: "#1"
366-
extra_args: "--number-of-aggregators=2 --use-relays --relay-signer-registration-mode=p2p --relay-signature-registration-mode=p2p"
366+
extra_args: "--number-of-aggregators=2 --use-relays --relay-signer-registration-mode=p2p --relay-signature-registration-mode=p2p --aggregate-signature-type=Concatenation"
367367
# Include a test for the era switch without regenesis
368368
- mode: "std"
369369
era: ${{ fromJSON(needs.build-ubuntu.outputs.eras)[0] }}
370370
next_era: ${{ fromJSON(needs.build-ubuntu.outputs.eras)[1] }}
371371
cardano_node_version: "10.4.1"
372372
hard_fork_latest_era_at_epoch: 0
373373
run_id: "#1"
374-
extra_args: ""
374+
extra_args: "--aggregate-signature-type=Concatenation"
375375
# Include a test for the era switch with regenesis
376376
- mode: "std"
377377
era: ${{ fromJSON(needs.build-ubuntu.outputs.eras)[0] }}
378378
next_era: ${{ fromJSON(needs.build-ubuntu.outputs.eras)[1] }}
379379
cardano_node_version: "10.4.1"
380380
hard_fork_latest_era_at_epoch: 0
381381
run_id: "#1"
382-
extra_args: "--mithril-era-regenesis-on-switch"
382+
extra_args: "--mithril-era-regenesis-on-switch --aggregate-signature-type=Concatenation"
383383
steps:
384384
- name: Checkout sources
385385
uses: actions/checkout@v4
@@ -798,6 +798,7 @@ jobs:
798798
mithril_era_reader_verification_key_url: ${{ vars.ERA_READER_VERIFICATION_KEY_URL }}
799799
mithril_era_reader_secret_key: ${{ secrets.ERA_READER_SECRET_KEY }}
800800
mithril_aggregator_signed_entity_types: ${{ vars.AGGREGATOR_SIGNED_ENTITY_TYPES }}
801+
mithril_aggregator_aggregate_signature_type: ${{ vars.AGGREGATOR_AGGREGATE_SIGNATURE_TYPE }}
801802
mithril_aggregator_cdn_cname: ${{ vars.AGGREGATOR_CDN_CNAME }}
802803
mithril_aggregator_snapshot_use_cdn_domain: ${{ vars.AGGREGATOR_USE_CDN_DOMAIN }}
803804
mithril_aggregator_snapshot_compression_algorithm: ${{ vars.AGGREGATOR_SNAPSHOT_COMPRESSION_ALGORITHM }}

.github/workflows/pre-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ jobs:
259259
mithril_era_reader_verification_key_url: ${{ vars.ERA_READER_VERIFICATION_KEY_URL }}
260260
mithril_era_reader_secret_key: ${{ secrets.ERA_READER_SECRET_KEY }}
261261
mithril_aggregator_signed_entity_types: ${{ vars.AGGREGATOR_SIGNED_ENTITY_TYPES }}
262+
mithril_aggregator_aggregate_signature_type: ${{ vars.AGGREGATOR_AGGREGATE_SIGNATURE_TYPE }}
262263
mithril_aggregator_cdn_cname: ${{ vars.AGGREGATOR_CDN_CNAME }}
263264
mithril_aggregator_snapshot_use_cdn_domain: ${{ vars.AGGREGATOR_USE_CDN_DOMAIN }}
264265
mithril_aggregator_snapshot_compression_algorithm: ${{ vars.AGGREGATOR_SNAPSHOT_COMPRESSION_ALGORITHM }}

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ jobs:
179179
mithril_era_reader_address_url: ${{ vars.ERA_READER_ADDRESS_URL }}
180180
mithril_era_reader_verification_key_url: ${{ vars.ERA_READER_VERIFICATION_KEY_URL }}
181181
mithril_aggregator_signed_entity_types: ${{ vars.AGGREGATOR_SIGNED_ENTITY_TYPES }}
182+
mithril_aggregator_aggregate_signature_type: ${{ vars.AGGREGATOR_AGGREGATE_SIGNATURE_TYPE }}
182183
mithril_aggregator_cdn_cname: ${{ vars.AGGREGATOR_CDN_CNAME }}
183184
mithril_aggregator_snapshot_use_cdn_domain: ${{ vars.AGGREGATOR_USE_CDN_DOMAIN }}
184185
mithril_aggregator_snapshot_compression_algorithm: ${{ vars.AGGREGATOR_SNAPSHOT_COMPRESSION_ALGORITHM }}

.github/workflows/test-deploy-network.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ jobs:
176176
mithril_era_reader_verification_key_url: ${{ vars.ERA_READER_VERIFICATION_KEY_URL }}
177177
mithril_era_reader_secret_key: ${{ secrets.ERA_READER_SECRET_KEY }}
178178
mithril_aggregator_signed_entity_types: ${{ vars.AGGREGATOR_SIGNED_ENTITY_TYPES }}
179+
mithril_aggregator_aggregate_signature_type: ${{ vars.AGGREGATOR_AGGREGATE_SIGNATURE_TYPE }}
179180
mithril_aggregator_cdn_cname: ${{ vars.AGGREGATOR_CDN_CNAME }}
180181
mithril_aggregator_snapshot_use_cdn_domain: ${{ vars.AGGREGATOR_USE_CDN_DOMAIN }}
181182
mithril_aggregator_snapshot_compression_algorithm: ${{ vars.AGGREGATOR_SNAPSHOT_COMPRESSION_ALGORITHM }}

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ As a minor extension, we have adopted a slightly different versioning convention
1111

1212
- **BREAKING** changes in aggregator OpenAPI: removed the `next_cardano_transactions_signing_config` in `/epoch-settings` route.
1313

14+
- Support for multiple aggregate signature proof systems.
15+
1416
- Crates versions:
1517

1618
| Crate | Version |

Cargo.lock

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/protocol-demo/src/demonstrator.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use hex::ToHex;
2+
use mithril_stm::AggregateSignatureType;
23
use rand_core::{CryptoRng, RngCore};
34
use serde::{Deserialize, Serialize};
45
use std::collections::HashMap;
@@ -142,7 +143,12 @@ impl Party {
142143
message: &Vec<u8>,
143144
signatures: &[ProtocolSingleSignature],
144145
) -> Option<&ProtocolMultiSignature> {
145-
let msig = self.clerk.as_ref().unwrap().aggregate_signatures(signatures, message);
146+
let aggregate_signature_type = AggregateSignatureType::Concatenation;
147+
let msig = self.clerk.as_ref().unwrap().aggregate_signatures_with_type(
148+
signatures,
149+
message,
150+
aggregate_signature_type,
151+
);
146152
match msig {
147153
Ok(aggregate_signature) => {
148154
println!("Party #{}: aggregate signature computed", self.party_id);

demo/protocol-demo/src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub type ProtocolKeyRegistrationNotCertified = KeyRegistration;
3232
/// Alias of [MithrilStm:SingleSignature](struct@mithril_stm::SingleSignature).
3333
pub type ProtocolSingleSignature = SingleSignature;
3434

35-
/// Alias of [MithrilStm:AggregateSignature](struct@mithril_stm::AggregateSignature).
35+
/// Alias of [MithrilStm:AggregateSignature](enum@mithril_stm::AggregateSignature).
3636
pub type ProtocolMultiSignature = AggregateSignature<D>;
3737

3838
/// Alias of [MithrilStm:VerificationKeyProofOfPossession](type@mithril_stm::VerificationKeyProofOfPossession).

docs/website/root/manual/develop/nodes/mithril-aggregator.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,7 @@ Here is a list of the available parameters for the serve command:
542542
| `metrics_server_port` | `--metrics-server-port` | - | `METRICS_SERVER_PORT` | Metrics HTTP server listening port | `9090` | - | - |
543543
| `persist_usage_report_interval_in_seconds` | | - | `PERSIST_USAGE_REPORT_INTERVAL_IN_SECONDS` | Duration in seconds between two recording of usage metrics | `10` | `5` | - |
544544
| `leader_aggregator_endpoint` | `--leader-aggregator-endpoint` | - | `LEADER_AGGREGATOR_ENDPOINT` | Leader aggregator endpoint (used with unstable feature) | - | `https://aggregator.pre-release-preview.api.mithril.network/aggregator` | - |
545+
| `aggregate_signature_type` | - | - | `AGGREGATE_SIGNATURE_TYPE` | Aggregate signature type used to create certificates | `Concatenation` | - | :heavy_check_mark: |
545546

546547
`genesis bootstrap` command:
547548

0 commit comments

Comments
 (0)