Skip to content

Commit 0461172

Browse files
authored
Merge pull request #2635 from input-output-hk/jpraynaud/2627-fake-dmq-node-in-relay
feat: implement fake DMQ node
2 parents 8098cb9 + 1eb864b commit 0461172

File tree

65 files changed

+2405
-286
lines changed

Some content is hidden

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

65 files changed

+2405
-286
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ inputs:
6363
description: Mithril use P2P network (experimental, for test only).
6464
required: false
6565
default: "false"
66+
mithril_p2p_use_dmq_protocol:
67+
description: Mithril P2P network use DMQ protocol (experimental, for test only).
68+
required: false
69+
default: "false"
6670
mithril_p2p_network_bootstrap_peer:
6771
description: Mithril P2P network bootstrap peer (experimental, for test only).
6872
required: false
@@ -247,6 +251,7 @@ runs:
247251
google_compute_instance_ssh_keys_environment = "${{ inputs.google_compute_instance_ssh_keys_environment }}"
248252
google_service_credentials_json_file = "./google-application-credentials.json"
249253
mithril_use_p2p_network = "${{ inputs.mithril_use_p2p_network }}"
254+
mithril_p2p_use_dmq_protocol = "${{ inputs.mithril_p2p_use_dmq_protocol }}"
250255
mithril_p2p_network_bootstrap_peer = "${{ inputs.mithril_p2p_network_bootstrap_peer }}"
251256
mithril_p2p_signer_relay_signer_registration_mode = "${{ inputs.mithril_p2p_signer_relay_signer_registration_mode }}"
252257
mithril_p2p_signer_relay_signature_registration_mode = "${{ inputs.mithril_p2p_signer_relay_signature_registration_mode }}"

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,31 +352,31 @@ jobs:
352352
- mode: "leader-follower"
353353
era: ${{ fromJSON(needs.build-ubuntu.outputs.eras)[0] }}
354354
next_era: [""]
355-
cardano_node_version: "10.3.1"
355+
cardano_node_version: "10.4.1"
356356
hard_fork_latest_era_at_epoch: 0
357357
run_id: "#1"
358358
extra_args: "--number-of-aggregators=2 --use-relays --relay-signer-registration-mode=passthrough --relay-signature-registration-mode=p2p"
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: ""
363-
cardano_node_version: "10.3.1"
363+
cardano_node_version: "10.4.1"
364364
hard_fork_latest_era_at_epoch: 0
365365
run_id: "#1"
366366
extra_args: "--number-of-aggregators=2 --use-relays --relay-signer-registration-mode=p2p --relay-signature-registration-mode=p2p"
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] }}
371-
cardano_node_version: "10.3.1"
371+
cardano_node_version: "10.4.1"
372372
hard_fork_latest_era_at_epoch: 0
373373
run_id: "#1"
374374
extra_args: ""
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] }}
379-
cardano_node_version: "10.3.1"
379+
cardano_node_version: "10.4.1"
380380
hard_fork_latest_era_at_epoch: 0
381381
run_id: "#1"
382382
extra_args: "--mithril-era-regenesis-on-switch"

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
environment_prefix: dev
3535
cardano_network: preview
3636
mithril_use_p2p_network: true
37+
mithril_p2p_use_dmq_protocol: false
3738
mithril_p2p_signer_relay_signer_registration_mode: passthrough
3839
mithril_p2p_signer_relay_signature_registration_mode: p2p
3940
mithril_api_domain: api.mithril.network
@@ -72,6 +73,7 @@ jobs:
7273
environment_prefix: dev-follower
7374
cardano_network: preview
7475
mithril_use_p2p_network: true
76+
mithril_p2p_use_dmq_protocol: false
7577
mithril_p2p_network_bootstrap_peer: "/dns4/aggregator.dev-preview.api.mithril.network/tcp/6060"
7678
mithril_p2p_signer_relay_signer_registration_mode: passthrough
7779
mithril_p2p_signer_relay_signature_registration_mode: p2p
@@ -103,6 +105,7 @@ jobs:
103105
environment_prefix: dev
104106
cardano_network: mainnet
105107
mithril_use_p2p_network: false
108+
mithril_p2p_use_dmq_protocol: false
106109
mithril_api_domain: api.mithril.network
107110
mithril_era_reader_adapter_type: bootstrap
108111
mithril_protocol_parameters: |
@@ -160,6 +163,7 @@ jobs:
160163
google_compute_instance_ssh_keys_environment: testing
161164
google_application_credentials: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
162165
mithril_use_p2p_network: ${{ matrix.mithril_use_p2p_network }}
166+
mithril_p2p_use_dmq_protocol: ${{ matrix.mithril_p2p_use_dmq_protocol }}
163167
mithril_p2p_network_bootstrap_peer: ${{ matrix.mithril_p2p_network_bootstrap_peer }}
164168
mithril_api_domain: ${{ matrix.mithril_api_domain }}
165169
mithril_image_id: ${{ inputs.mithril_image_id }}

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ As a minor extension, we have adopted a slightly different versioning convention
3232
- Support for Mithril era transition in the client library, CLI and WASM.
3333

3434
- **UNSTABLE** :
35+
- Support for certificates chain synchronization between leader/follower aggregators.
36+
3537
- Support for DMQ signature publisher in the signer and signature consumer in the aggregator.
3638

37-
- Implement automatic certificates chain synchronization between leader/follower aggregators.
39+
- Support for fake DMQ node implementation in the relay for testing purposes.
3840

3941
- Crates versions:
4042

Cargo.lock

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

internal/mithril-dmq/Cargo.toml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "mithril-dmq"
33
description = "Mechanisms to publish and consume messages of a 'Decentralized Message Queue network' through a DMQ node"
4-
version = "0.1.9"
4+
version = "0.1.10"
55
authors.workspace = true
66
documentation.workspace = true
77
edition.workspace = true
@@ -10,18 +10,27 @@ license.workspace = true
1010
repository.workspace = true
1111
include = ["**/*.rs", "Cargo.toml", "README.md", ".gitignore"]
1212

13+
[package.metadata.cargo-machete]
14+
# `serde_bytes` is used for DmqMessage serialization
15+
ignored = ["serde_bytes"]
16+
1317
[lib]
1418
crate-type = ["lib", "cdylib", "staticlib"]
1519

1620
[dependencies]
1721
anyhow = { workspace = true }
1822
async-trait = { workspace = true }
23+
bincode = { version = "2.0.1" }
1924
blake2 = "0.10.6"
2025
mithril-cardano-node-chain = { path = "../cardano-node/mithril-cardano-node-chain" }
2126
mithril-common = { path = "../../mithril-common" }
27+
pallas-codec = { git = "https://github.com/txpipe/pallas.git", branch = "main" }
2228
pallas-network = { git = "https://github.com/txpipe/pallas.git", branch = "main" }
29+
serde = { workspace = true }
30+
serde_bytes = "0.11.17"
2331
slog = { workspace = true }
24-
tokio = { workspace = true, features = ["sync"] }
32+
slog-scope = "4.4.0"
33+
tokio = { workspace = true, features = ["sync","rt-multi-thread"] }
2534

2635
[dev-dependencies]
2736
mockall = { workspace = true }

internal/mithril-dmq/src/consumer/interface.rs renamed to internal/mithril-dmq/src/consumer/client/interface.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ use std::fmt::Debug;
22

33
use mithril_common::{StdResult, crypto_helper::TryFromBytes, entities::PartyId};
44

5-
/// Trait for consuming messages from a DMQ node.
5+
/// Trait for the client side of consuming messages from a DMQ node.
66
#[cfg_attr(test, mockall::automock)]
77
#[async_trait::async_trait]
8-
pub trait DmqConsumer<M: TryFromBytes + Debug + Send + Sync>: Send + Sync {
8+
pub trait DmqConsumerClient<M: TryFromBytes + Debug + Send + Sync>: Send + Sync {
99
/// Consume messages from the DMQ node.
1010
async fn consume_messages(&self) -> StdResult<Vec<(M, PartyId)>>;
1111
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
mod interface;
2+
mod pallas;
3+
4+
pub use interface::*;
5+
pub use pallas::*;

0 commit comments

Comments
 (0)