Skip to content

Commit 2049ad7

Browse files
committed
Node: document field of NodeService
1 parent 38db01e commit 2049ad7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

node/common/src/service/service.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,48 @@ use sha3::{
2626
use std::sync::Arc;
2727

2828
pub struct NodeService {
29+
/// Master seed for deterministic random number generation.
2930
pub rng_seed: [u8; 32],
31+
/// XOF-based RNG for ephemeral keys (derived from seed + "ephemeral").
3032
pub rng_ephemeral: XofReaderCoreWrapper<Shake256ReaderCore>,
33+
/// XOF-based RNG for static operations (derived from seed + "static").
3134
pub rng_static: XofReaderCoreWrapper<Shake256ReaderCore>,
35+
/// Standard RNG for general-purpose randomness.
3236
pub rng: StdRng,
3337

3438
/// Events sent on this channel are retrieved and processed in the
3539
/// `event_source` state machine defined in the `mina-node` crate.
3640
pub event_sender: EventSender,
41+
/// Channel for consuming events in the event source state machine.
3742
pub event_receiver: EventReceiver,
3843

44+
/// Channel for asynchronous block proof verification requests.
3945
pub snark_block_proof_verify: mpsc::TrackedUnboundedSender<SnarkBlockVerifyArgs>,
4046

47+
/// Manages ledger operations, database access, and staged ledger state.
4148
pub ledger_manager: LedgerManager,
49+
/// SNARK proof worker for generating transaction proofs (enabled when node
50+
/// acts as SNARK worker).
4251
pub snark_worker: Option<SnarkWorker>,
52+
/// Block production service including VRF evaluation and block proving
53+
/// (enabled when node acts as block producer).
4354
pub block_producer: Option<BlockProducerService>,
55+
/// Archive service for storing full blockchain history (enabled when node
56+
/// acts as archive node).
4457
pub archive: Option<ArchiveService>,
58+
/// P2P networking context (WebRTC and optionally libp2p transports).
4559
pub p2p: P2pServiceCtx,
4660

61+
/// Runtime statistics and metrics collection.
4762
pub stats: Option<Stats>,
63+
/// RPC service for external API queries.
4864
pub rpc: RpcService,
65+
/// Records node state and actions for debugging and replay.
4966
pub recorder: Recorder,
67+
/// Replayer state for deterministic action replay (only set in replay
68+
/// mode).
5069
pub replayer: Option<ReplayerState>,
70+
/// State for runtime invariant checking and validation.
5171
pub invariants_state: InvariantsState,
5272
}
5373

0 commit comments

Comments
 (0)