Skip to content

Commit 44cb98a

Browse files
remove reporter from application
1 parent 13f1c08 commit 44cb98a

2 files changed

Lines changed: 3 additions & 55 deletions

File tree

chain/src/actors/application/actor.rs

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use super::{
55
};
66
use crate::actors::syncer;
77
use alto_types::Block;
8-
use commonware_cryptography::{sha256::Digest, Hasher, Sha256};
8+
use commonware_cryptography::{Digestible, Hasher, Sha256};
99
use commonware_macros::select;
1010
use commonware_runtime::{Clock, Handle, Metrics, Spawner};
1111
use commonware_utils::SystemTimeExt;
@@ -54,7 +54,6 @@ const SYNCHRONY_BOUND: u64 = 500;
5454
/// Application actor.
5555
pub struct Actor<R: Rng + Spawner + Metrics + Clock> {
5656
context: R,
57-
prover: Prover<Digest>,
5857
hasher: Sha256,
5958
mailbox: mpsc::Receiver<Message>,
6059
}
@@ -66,7 +65,6 @@ impl<R: Rng + Spawner + Metrics + Clock> Actor<R> {
6665
(
6766
Self {
6867
context,
69-
prover: config.prover,
7068
hasher: Sha256::new(),
7169
mailbox,
7270
},
@@ -212,26 +210,6 @@ impl<R: Rng + Spawner + Metrics + Clock> Actor<R> {
212210
}
213211
});
214212
}
215-
Message::Prepared { proof, payload } => {
216-
// Parse the proof
217-
let (view, parent, _, signature, seed) =
218-
self.prover.deserialize_notarization(proof).unwrap();
219-
let notarization = Notarization::new(view, parent, payload, signature.into());
220-
let seed = Seed::new(view, seed.into());
221-
222-
// Send the notarization to the syncer
223-
syncer.notarized(notarization, seed).await;
224-
}
225-
Message::Finalized { proof, payload } => {
226-
// Parse the proof
227-
let (view, parent, _, signature, seed) =
228-
self.prover.deserialize_finalization(proof.clone()).unwrap();
229-
let finalization = Finalization::new(view, parent, payload, signature.into());
230-
let seed = Seed::new(view, seed.into());
231-
232-
// Send the finalization to the syncer
233-
syncer.finalized(finalization, seed).await;
234-
}
235213
}
236214
}
237215
}

chain/src/actors/application/ingress.rs

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use commonware_consensus::{
2-
threshold_simplex::types::{Activity, Context, Finalization, Notarization, View},
3-
Automaton, Relay, Reporter,
2+
threshold_simplex::types::{Context, View},
3+
Automaton, Relay,
44
};
55
use commonware_cryptography::sha256::Digest;
66
use futures::{
@@ -26,12 +26,6 @@ pub enum Message {
2626
payload: Digest,
2727
response: oneshot::Sender<bool>,
2828
},
29-
Notarization {
30-
notarization: Notarization<Digest>,
31-
},
32-
Finalization {
33-
finalization: Finalization<Digest>,
34-
},
3529
}
3630

3731
/// Mailbox for the application.
@@ -105,27 +99,3 @@ impl Relay for Mailbox {
10599
.expect("Failed to send broadcast");
106100
}
107101
}
108-
109-
impl Reporter for Mailbox {
110-
type Activity = Activity<Digest>;
111-
112-
async fn report(&mut self, activity: Self::Activity) {
113-
match activity {
114-
Activity::Notarization(notarization) => {
115-
self.sender
116-
.send(Message::Notarization { notarization })
117-
.await
118-
.expect("Failed to send notarization");
119-
}
120-
Activity::Finalization(finalization) => {
121-
self.sender
122-
.send(Message::Finalization { finalization })
123-
.await
124-
.expect("Failed to send finalization");
125-
}
126-
_ => {
127-
// Ignore other activities
128-
}
129-
}
130-
}
131-
}

0 commit comments

Comments
 (0)