Skip to content

Commit

Permalink
PoC embedding dkg shares into begin messages
Browse files Browse the repository at this point in the history
fmt fixes

remove commented out branches

underscore msg_public_key since we aren't using it for now, will remove later

init tracing subscriber so i can see what's going on
  • Loading branch information
xoloki committed Dec 2, 2024
1 parent 0ff9070 commit 9e518af
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion signer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ tracing-attributes.workspace = true
tracing-subscriber = { workspace = true }
url.workspace = true
# wsts.workspace = true
wsts = { git = "https://github.com/Trust-Machines/wsts.git", rev = "ebd7d7775ad5e44cdbf4f5c1fb468bdf6c467265" }
wsts = { git = "https://github.com/Trust-Machines/wsts.git", rev = "c90232f929e1433f0eac8175512541be32d4e2c0" }
zeromq.workspace = true
hex.workspace = true
cfg-if = "1.0"
Expand Down
1 change: 1 addition & 0 deletions signer/src/testing/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ impl fake::Dummy<fake::Faker> for message::WstsMessage {
dkg_id: config.fake_with_rng(rng),
signer_ids: config.fake_with_rng(rng),
key_ids: config.fake_with_rng(rng),
dkg_private_shares: Default::default(),
};

Self {
Expand Down
11 changes: 9 additions & 2 deletions signer/src/transaction_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ where
&mut self,
msg: &message::WstsMessage,
bitcoin_chain_tip: &model::BitcoinBlockHash,
msg_public_key: PublicKey,
_msg_public_key: PublicKey,
chain_tip_report: &MsgChainTipReport,
) -> Result<(), Error> {
match &msg.inner {
Expand Down Expand Up @@ -574,6 +574,7 @@ where
self.relay_message(msg.txid, &msg.inner, bitcoin_chain_tip)
.await?;
}
<<<<<<< HEAD
WstsNetMessage::DkgPublicShares(dkg_public_shares) => {
tracing::info!(
signer_id = %dkg_public_shares.signer_id,
Expand Down Expand Up @@ -616,6 +617,8 @@ where
self.relay_message(msg.txid, &msg.inner, bitcoin_chain_tip)
.await?;
}
=======
>>>>>>> 6ac8fba2 (PoC embedding dkg shares into begin messages)
WstsNetMessage::DkgEndBegin(_) => {
tracing::info!("handling DkgEndBegin");
if !chain_tip_report.sender_is_coordinator {
Expand Down Expand Up @@ -691,7 +694,11 @@ where
}
}
}
WstsNetMessage::NonceResponse(_) | WstsNetMessage::SignatureShareResponse(_) => {

WstsNetMessage::DkgPublicShares(_)
| WstsNetMessage::DkgPrivateShares(_)
| WstsNetMessage::NonceResponse(_)
| WstsNetMessage::SignatureShareResponse(_) => {
tracing::trace!("ignoring message");
}
}
Expand Down
6 changes: 5 additions & 1 deletion signer/tests/integration/transaction_coordinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@ async fn run_dkg_from_scratch() {
testing::storage::drop_db(db).await;
}
}

use tracing_subscriber::{fmt, prelude::*, EnvFilter};
/// Test that three signers can successfully sign and broadcast a bitcoin
/// transaction.
///
Expand Down Expand Up @@ -1174,6 +1174,10 @@ async fn run_dkg_from_scratch() {
#[cfg_attr(not(feature = "integration-tests"), ignore)]
#[tokio::test]
async fn sign_bitcoin_transaction() {
tracing_subscriber::registry()
.with(fmt::layer())
.with(EnvFilter::from_default_env())
.init();
let (_, signer_key_pairs): (_, [Keypair; 3]) = testing::wallet::regtest_bootstrap_wallet();
let (rpc, faucet) = regtest::initialize_blockchain();

Expand Down

0 comments on commit 9e518af

Please sign in to comment.