-
Notifications
You must be signed in to change notification settings - Fork 44
feat: implement fake DMQ node #2635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for a Decentralized Message Queue (DMQ) node across end-to-end tests, relay components, signers, aggregators, and the mithril-dmq
crate.
- Introduce
DMQ_NODE_SOCKET_PATH
env var and socket setup in end-to-end signer and aggregator. - Extend relay components and CLI commands to accept DMQ socket path and Cardano network settings.
- Refactor
mithril-dmq
crate to split client/server interfaces and enablefuture_dmq
by default.
Reviewed Changes
Copilot reviewed 42 out of 43 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
mithril-test-lab/.../src/mithril/signer.rs | Insert DMQ_NODE_SOCKET_PATH setup in Signer |
mithril-test-lab/.../src/mithril/relay_signer.rs | Add DMQ socket and network env in RelaySigner |
mithril-test-lab/.../src/mithril/relay_aggregator.rs | Add DMQ socket and network env in RelayAggregator |
mithril-test-lab/.../src/mithril/aggregator.rs | Insert DMQ socket env in end-to-end Aggregator |
mithril-relay/src/relay/signer.rs | Wire up DMQ publisher server in SignerRelay |
mithril-relay/src/relay/aggregator.rs | Wire up DMQ consumer server in AggregatorRelay |
internal/mithril-dmq/src/publisher/client/pallas.rs | Rename to client interface and update implementations |
Comments suppressed due to low confidence (1)
mithril-test-lab/mithril-end-to-end/src/mithril/signer.rs:99
- [nitpick] End-to-end tests don’t currently cover the DMQ_NODE_SOCKET_PATH setup. Add tests that exercise DMQ-based workflows to verify this new configuration is applied correctly.
// TODO: make this configurable
730ee75
to
3761142
Compare
14815a4
to
ac101c4
Compare
ac101c4
to
054bcb5
Compare
b603cb0
to
59f3dc6
Compare
59f3dc6
to
57452a5
Compare
let bytes = | ||
bincode::serde::encode_to_vec(self, bincode::config::standard()).map_err(|e| e.into()); |
Check warning
Code scanning / clippy
returning the result of a let binding from a block Warning
let bytes = | ||
bincode::serde::encode_to_vec(self, bincode::config::standard()).map_err(|e| e.into()); |
Check warning
Code scanning / clippy
returning the result of a let binding from a block Warning
let bytes = | ||
bincode::serde::encode_to_vec(self, bincode::config::standard()).map_err(|e| e.into()); | ||
|
||
bytes |
Check warning
Code scanning / clippy
returning the result of a let binding from a block Warning
let bytes = | ||
bincode::serde::encode_to_vec(self, bincode::config::standard()).map_err(|e| e.into()); | ||
|
||
bytes |
Check warning
Code scanning / clippy
returning the result of a let binding from a block Warning
57452a5
to
900fb4e
Compare
logger: Logger, | ||
} | ||
|
||
impl DmqConsumerServerPallas { |
Check warning
Code scanning / clippy
method drop_server is never used Warning
} | ||
|
||
/// Drops the current `DmqServer`, if it exists. | ||
async fn drop_server(&self) -> StdResult<()> { |
Check warning
Code scanning / clippy
method drop_server is never used Warning
logger: Logger, | ||
} | ||
|
||
impl DmqConsumerServerPallas { |
Check warning
Code scanning / clippy
method drop_server is never used Warning
} | ||
|
||
/// Drops the current `DmqServer`, if it exists. | ||
async fn drop_server(&self) -> StdResult<()> { |
Check warning
Code scanning / clippy
method drop_server is never used Warning
} | ||
}, | ||
None => { | ||
return Err(anyhow!("DMQ message receiver is not registered")); |
Check warning
Code scanning / clippy
unneeded return statement Warning
} | ||
}, | ||
None => { | ||
return Err(anyhow!("DMQ message receiver is not registered")); |
Check warning
Code scanning / clippy
unneeded return statement Warning
'mithril_common::test_utils' has been renamed to 'mithril_common::test'.
900fb4e
to
657a484
Compare
async move { | ||
let consumer_client = DmqConsumerClientPallas::<DmqMessageTestPayload>::new( | ||
socket_path, | ||
cardano_network.clone(), |
Check warning
Code scanning / clippy
using clone on type CardanoNetwork which implements the Copy trait Warning test
slog_scope::logger(), | ||
); | ||
let mut messages = vec![]; | ||
signature_dmq_tx.send(create_fake_msg(b"msg_1").await.into()).unwrap(); |
Check warning
Code scanning / clippy
useless conversion to the same type: mithril_dmq::DmqMessage Warning test
); | ||
let mut messages = vec![]; | ||
signature_dmq_tx.send(create_fake_msg(b"msg_1").await.into()).unwrap(); | ||
signature_dmq_tx.send(create_fake_msg(b"msg_2").await.into()).unwrap(); |
Check warning
Code scanning / clippy
useless conversion to the same type: mithril_dmq::DmqMessage Warning test
signature_dmq_tx.send(create_fake_msg(b"msg_1").await.into()).unwrap(); | ||
signature_dmq_tx.send(create_fake_msg(b"msg_2").await.into()).unwrap(); | ||
messages.extend_from_slice(&consumer_client.consume_messages().await.unwrap()); | ||
signature_dmq_tx.send(create_fake_msg(b"msg_3").await.into()).unwrap(); |
Check warning
Code scanning / clippy
useless conversion to the same type: mithril_dmq::DmqMessage Warning test
.set_ttl(100); | ||
let publisher_client = DmqPublisherClientPallas::<DmqMessageTestPayload>::new( | ||
socket_path, | ||
cardano_network.clone(), |
Check warning
Code scanning / clippy
using clone on type CardanoNetwork which implements the Copy trait Warning test
Content
Note
This is a work in progress
This PR includes the implementation of a fake DMQ node in the relay:
Pre-submit checklist
Issue(s)
Closes #2627