Skip to content

Conversation

@ManuelBilbao
Copy link
Collaborator

@ManuelBilbao ManuelBilbao commented Dec 10, 2024

Add support for Dirk remote signer by mapping requests received by the signer module to a Dirk gateway.
A new signer option (Dirk) was added to the Local and Remote ones. When this config is used, the signer module starts acting as an interface between Dirk and the client, in order to keep the API.
As Dirk doesn't support ECDSA signatures, requests involving that schema return a HTTP 400 (Bad request) error. Also because of this, the DA_COMMIT example module was slightly modified to be able to avoid ECDSA operations using the TOML config.

It's worth to note that Dirk has a small bug where signing passing the public key instead of an account name is impossible. In order to test this (and later use it) changes on PR#75 on Dirk repo should be applied.

Close #17

@ManuelBilbao ManuelBilbao marked this pull request as ready for review January 6, 2025 21:42
@ManuelBilbao ManuelBilbao marked this pull request as ready for review March 5, 2025 21:26
@ManuelBilbao ManuelBilbao requested a review from ltitanb March 5, 2025 22:02
Copy link
Collaborator

@ltitanb ltitanb left a comment

Choose a reason for hiding this comment

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

Left a few comments but overall looks good! Would ideally have a few more logging on the signer side, also we could have a step by step guide on how to setup dirk for local development in the "Develop" section of the docs

let channel = match connect(&host, &config.client_cert, &config.cert_auth).await {
Ok(channel) => channel,
Err(e) => {
warn!("Failed to connect to Dirk host {}: {e}", host.url);
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we error and exit here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

With distributed wallets, you may have some down servers whilst still be able to reach the needed amount of signatures from working ones. It's true that if using simple accounts, that ones won't be available on down servers, but I think that's not the main use case.
Let me know what do you think

}

/// Aggregate partial signatures into a master signature
fn aggregate_partial_signatures(partials: &[(BlsSignature, u32)]) -> eyre::Result<BlsSignature> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there a reference implementation / spec for this? we should also add unit tests

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added unit tests here c6504d2

let res = tokio::join!(signature, proxy_signature_bls, proxy_signature_ecdsa);
(res.0?, res.1?, res.2?)
let (signature, proxy_signature_bls) = {
let res = tokio::join!(signature, proxy_signature_bls);
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's add signature verification here?

@ltitanb ltitanb merged commit 80c4bf4 into main Mar 16, 2025
4 of 5 checks passed
@ltitanb ltitanb deleted the mb/dirk_integration branch March 16, 2025 16:34
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.

Support multiple signers loaders

4 participants