diff --git a/coordinator/src/main.rs b/coordinator/src/main.rs index 682bad94..a242bde4 100644 --- a/coordinator/src/main.rs +++ b/coordinator/src/main.rs @@ -748,6 +748,13 @@ pub async fn handle_processors( panic!("provided an invalid transaction: {res:?}"); } } + TransactionKind::Unsigned => { + log::trace!("publishing unsigned transaction {}", hex::encode(tx.hash())); + // Ignores the result since we can't differentiate already in-mempool from already + // on-chain from invalid + // TODO: Don't ignore the result + tributary.add_transaction(tx).await; + } TransactionKind::Signed(_) => { // Get the next nonce // TODO: This should be deterministic, not just DB-backed, to allow rebuilding validators @@ -767,7 +774,6 @@ pub async fn handle_processors( // txn.commit(); } - _ => panic!("created an unexpected transaction"), } } diff --git a/coordinator/src/tributary/handle.rs b/coordinator/src/tributary/handle.rs index e5291b07..cfca4500 100644 --- a/coordinator/src/tributary/handle.rs +++ b/coordinator/src/tributary/handle.rs @@ -550,6 +550,11 @@ pub async fn handle_application_tx< } } Transaction::SignCompleted { plan, tx_hash, .. } => { + log::info!( + "on-chain SignCompleted claims {} completes {}", + hex::encode(&tx_hash), + hex::encode(plan) + ); // TODO: Confirm this is a valid plan ID // TODO: Confirm this signer hasn't prior published a completion let Some(key_pair) = TributaryDb::::key_pair(txn, spec.set()) else { todo!() }; diff --git a/coordinator/tributary/src/lib.rs b/coordinator/tributary/src/lib.rs index e63a29d0..ebb7b165 100644 --- a/coordinator/tributary/src/lib.rs +++ b/coordinator/tributary/src/lib.rs @@ -221,7 +221,7 @@ impl Tributary { self.network.blockchain.read().await.next_nonce(signer) } - // Returns if the transaction was valid. + // Returns if the transaction was new and valid. // Safe to be &self since the only meaningful usage of self is self.network.blockchain which // successfully acquires its own write lock pub async fn add_transaction(&self, tx: T) -> bool {