p2p/channels/snark_job_commitment/
mod.rs

1mod p2p_channels_snark_job_commitment_state;
2pub use p2p_channels_snark_job_commitment_state::*;
3
4mod p2p_channels_snark_job_commitment_actions;
5pub use p2p_channels_snark_job_commitment_actions::*;
6
7mod p2p_channels_snark_job_commitment_reducer;
8
9use binprot_derive::{BinProtRead, BinProtWrite};
10use openmina_core::snark::SnarkJobCommitment;
11use serde::{Deserialize, Serialize};
12
13#[derive(BinProtWrite, BinProtRead, Serialize, Deserialize, Debug, Clone)]
14pub enum SnarkJobCommitmentPropagationChannelMsg {
15    /// Request next commitments 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 commitments 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 commitments must be delivered.
26    WillSend { count: u8 },
27    /// Promise/Commitments from the snark worker to produce a proof.
28    Commitment(SnarkJobCommitment),
29}