p2p/channels/snark/
mod.rs

1mod p2p_channels_snark_state;
2pub use p2p_channels_snark_state::*;
3
4mod p2p_channels_snark_actions;
5pub use p2p_channels_snark_actions::*;
6
7mod p2p_channels_snark_reducer;
8
9use binprot_derive::{BinProtRead, BinProtWrite};
10use openmina_core::snark::SnarkInfo;
11use serde::{Deserialize, Serialize};
12
13#[derive(BinProtWrite, BinProtRead, Serialize, Deserialize, Debug, Clone)]
14pub enum SnarkPropagationChannelMsg {
15    /// Request next snarks upto the `limit`.
16    ///
17    /// - Must not be sent until peer sends `WillSend` message for the
18    ///   previous request and until peer has fulfilled it.
19    GetNext { limit: u8 },
20    /// Amount of snarks which will proceed this message.
21    ///
22    /// - Can only be sent, if peer has sent `GetNext` and we haven't
23    ///   responded with `WillSend` yet.
24    /// - Can't be bigger than limit set by `GetNext`.
25    /// - Amount of promised snarks must be delivered.
26    WillSend { count: u8 },
27    /// Snark.
28    Snark(SnarkInfo),
29}