Skip to content

Commit

Permalink
docs: update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
polydez committed Nov 7, 2024
1 parent b943640 commit 5722bf1
Show file tree
Hide file tree
Showing 36 changed files with 492 additions and 507 deletions.
26 changes: 13 additions & 13 deletions crates/proto/src/generated/account.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is @generated by prost-build.
/// An account ID
/// An account ID.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[prost(skip_debug)]
pub struct AccountId {
Expand All @@ -9,42 +9,42 @@ pub struct AccountId {
#[prost(fixed64, tag = "1")]
pub id: u64,
}
/// A summary of an account
/// A summary of an account.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct AccountSummary {
/// The account ID
/// The account ID.
#[prost(message, optional, tag = "1")]
pub account_id: ::core::option::Option<AccountId>,
/// The latest account hash, zero hash if the account doesn't exist
/// The latest account hash, zero hash if the account doesn't exist.
#[prost(message, optional, tag = "2")]
pub account_hash: ::core::option::Option<super::digest::Digest>,
/// Merkle path to verify the account's inclusion in the MMR
/// Merkle path to verify the account's inclusion in the MMR.
#[prost(uint32, tag = "3")]
pub block_num: u32,
}
/// An account info
/// An account info.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountInfo {
/// Account summary
/// Account summary.
#[prost(message, optional, tag = "1")]
pub summary: ::core::option::Option<AccountSummary>,
/// Account details encoded using Miden native format
/// Account details encoded using Miden native format.
#[prost(bytes = "vec", optional, tag = "2")]
pub details: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
/// An account header
/// An account header.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct AccountHeader {
/// Vault root hash
/// Vault root hash.
#[prost(message, optional, tag = "1")]
pub vault_root: ::core::option::Option<super::digest::Digest>,
/// Storage root hash
/// Storage root hash.
#[prost(message, optional, tag = "2")]
pub storage_commitment: ::core::option::Option<super::digest::Digest>,
/// Code root hash
/// Code root hash.
#[prost(message, optional, tag = "3")]
pub code_commitment: ::core::option::Option<super::digest::Digest>,
/// Account nonce
/// Account nonce.
#[prost(uint64, tag = "4")]
pub nonce: u64,
}
32 changes: 16 additions & 16 deletions crates/proto/src/generated/block.rs
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
// This file is @generated by prost-build.
/// Represents a block header
/// Represents a block header.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct BlockHeader {
/// Specifies the version of the protocol
/// Specifies the version of the protocol.
#[prost(uint32, tag = "1")]
pub version: u32,
/// The hash of the previous blocks header
/// The hash of the previous blocks header.
#[prost(message, optional, tag = "2")]
pub prev_hash: ::core::option::Option<super::digest::Digest>,
/// A unique sequential number of the current block
/// A unique sequential number of the current block.
#[prost(fixed32, tag = "3")]
pub block_num: u32,
/// A commitment to an MMR of the entire chain where each block is a leaf
/// A commitment to an MMR of the entire chain where each block is a leaf.
#[prost(message, optional, tag = "4")]
pub chain_root: ::core::option::Option<super::digest::Digest>,
/// A commitment to account database
/// A commitment to account database.
#[prost(message, optional, tag = "5")]
pub account_root: ::core::option::Option<super::digest::Digest>,
/// A commitment to the nullifier database
/// A commitment to the nullifier database.
#[prost(message, optional, tag = "6")]
pub nullifier_root: ::core::option::Option<super::digest::Digest>,
/// A commitment to all notes created in the current block
/// A commitment to all notes created in the current block.
#[prost(message, optional, tag = "7")]
pub note_root: ::core::option::Option<super::digest::Digest>,
/// A commitment to a set of IDs of transactions which affected accounts in this block
/// A commitment to a set of IDs of transactions which affected accounts in this block.
#[prost(message, optional, tag = "8")]
pub tx_hash: ::core::option::Option<super::digest::Digest>,
/// A hash of a STARK proof attesting to the correct state transition
/// A hash of a STARK proof attesting to the correct state transition.
#[prost(message, optional, tag = "9")]
pub proof_hash: ::core::option::Option<super::digest::Digest>,
/// A commitment to all transaction kernels supported by this block
/// A commitment to all transaction kernels supported by this block.
#[prost(message, optional, tag = "10")]
pub kernel_root: ::core::option::Option<super::digest::Digest>,
/// The time when the block was created
/// The time when the block was created.
#[prost(fixed32, tag = "11")]
pub timestamp: u32,
}
/// Represents a block inclusion proof
/// Represents a block inclusion proof.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockInclusionProof {
/// Block header associated with the inclusion proof
/// Block header associated with the inclusion proof.
#[prost(message, optional, tag = "1")]
pub block_header: ::core::option::Option<BlockHeader>,
/// Merkle path associated with the inclusion proof
/// Merkle path associated with the inclusion proof.
#[prost(message, optional, tag = "2")]
pub mmr_path: ::core::option::Option<super::merkle::MerklePath>,
/// The chain length associated with `mmr_path`
/// The chain length associated with `mmr_path`.
#[prost(fixed32, tag = "3")]
pub chain_length: u32,
}
4 changes: 2 additions & 2 deletions crates/proto/src/generated/block_producer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub mod api_client {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Submits proven transaction to the Miden network.
/// Submits proven transaction to the Miden network
pub async fn submit_proven_transaction(
&mut self,
request: impl tonic::IntoRequest<
Expand Down Expand Up @@ -134,7 +134,7 @@ pub mod api_server {
/// Generated trait containing gRPC methods that should be implemented for use with ApiServer.
#[async_trait]
pub trait Api: std::marker::Send + std::marker::Sync + 'static {
/// Submits proven transaction to the Miden network.
/// Submits proven transaction to the Miden network
async fn submit_proven_transaction(
&self,
request: tonic::Request<
Expand Down
4 changes: 2 additions & 2 deletions crates/proto/src/generated/merkle.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// This file is @generated by prost-build.
/// Represents a Merkle path
/// Represents a Merkle path.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MerklePath {
/// List of sibling node hashes, in order from the root to the leaf
/// List of sibling node hashes, in order from the root to the leaf.
#[prost(message, repeated, tag = "1")]
pub siblings: ::prost::alloc::vec::Vec<super::digest::Digest>,
}
6 changes: 3 additions & 3 deletions crates/proto/src/generated/mmr.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// This file is @generated by prost-build.
/// Represents an MMR delta
/// Represents an MMR delta.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MmrDelta {
/// The number of trees in the forest (latest block number + 1)
/// The number of trees in the forest (latest block number + 1).
#[prost(uint64, tag = "1")]
pub forest: u64,
/// New and changed MMR peaks
/// New and changed MMR peaks.
#[prost(message, repeated, tag = "2")]
pub data: ::prost::alloc::vec::Vec<super::digest::Digest>,
}
48 changes: 23 additions & 25 deletions crates/proto/src/generated/note.rs
Original file line number Diff line number Diff line change
@@ -1,83 +1,81 @@
// This file is @generated by prost-build.
/// Represents a note metadata
/// Represents a note metadata.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct NoteMetadata {
/// The sender of the note
/// The sender of the note.
#[prost(message, optional, tag = "1")]
pub sender: ::core::option::Option<super::account::AccountId>,
/// The type of the note (0b01 = public, 0b10 = private, 0b11 = encrypted)
/// The type of the note (0b01 = public, 0b10 = private, 0b11 = encrypted).
#[prost(uint32, tag = "2")]
pub note_type: u32,
/// A value which can be used by the recipient(s) to identify notes intended for them
/// A value which can be used by the recipient(s) to identify notes intended for them.
#[prost(fixed32, tag = "3")]
pub tag: u32,
/// Specifies when a note is ready to be consumed:
/// * 6 least significant bits: Hint identifier (tag).
/// * Bits 6 to 38: Hint payload.
///
/// (6 least significant bits - hint identifier (tag), bits 6 to 38 - Hint payload).
/// See `miden_objects::notes::execution_hint` for more info.
#[prost(fixed64, tag = "4")]
pub execution_hint: u64,
/// An arbitrary user-defined value
/// An arbitrary user-defined value.
#[prost(fixed64, tag = "5")]
pub aux: u64,
}
/// Represents a note
/// Represents a note.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Note {
/// The block number in which the note was created
/// The block number in which the note was created.
#[prost(fixed32, tag = "1")]
pub block_num: u32,
/// The index of the note in the block
/// The index of the note in the block.
#[prost(uint32, tag = "2")]
pub note_index: u32,
/// The ID of the note
/// The ID of the note.
#[prost(message, optional, tag = "3")]
pub note_id: ::core::option::Option<super::digest::Digest>,
/// The note metadata
/// The note metadata.
#[prost(message, optional, tag = "4")]
pub metadata: ::core::option::Option<NoteMetadata>,
/// The note inclusion proof in the block
/// The note inclusion proof in the block.
#[prost(message, optional, tag = "5")]
pub merkle_path: ::core::option::Option<super::merkle::MerklePath>,
/// This field will be present when the note is public.
/// details contain the `Note` in a serialized format.
#[prost(bytes = "vec", optional, tag = "6")]
pub details: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
/// Represents proof of a note's inclusion in a block
/// Represents proof of a note's inclusion in a block.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NoteInclusionInBlockProof {
/// The ID of the note
/// The ID of the note.
#[prost(message, optional, tag = "1")]
pub note_id: ::core::option::Option<super::digest::Digest>,
/// The block number in which the note was created
/// The block number in which the note was created.
#[prost(fixed32, tag = "2")]
pub block_num: u32,
/// The index of the note in the block
/// The index of the note in the block.
#[prost(uint32, tag = "3")]
pub note_index_in_block: u32,
/// The note inclusion proof in the block
/// The note inclusion proof in the block.
#[prost(message, optional, tag = "4")]
pub merkle_path: ::core::option::Option<super::merkle::MerklePath>,
}
/// Represents proof of a note inclusion in the block
/// Represents proof of a note inclusion in the block.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NoteSyncRecord {
/// The index of the note
/// The index of the note.
#[prost(uint32, tag = "1")]
pub note_index: u32,
/// The ID of the note
/// The ID of the note.
#[prost(message, optional, tag = "2")]
pub note_id: ::core::option::Option<super::digest::Digest>,
/// The note metadata
/// The note metadata.
#[prost(message, optional, tag = "3")]
pub metadata: ::core::option::Option<NoteMetadata>,
/// The note inclusion proof in the block
/// The note inclusion proof in the block.
#[prost(message, optional, tag = "4")]
pub merkle_path: ::core::option::Option<super::merkle::MerklePath>,
}
/// Represents proof of notes inclusion in the block(s) and block(s) inclusion in the chain
/// Represents proof of notes inclusion in the block(s) and block(s) inclusion in the chain.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NoteAuthenticationInfo {
/// Proof of each note's inclusion in a block.
Expand Down
19 changes: 8 additions & 11 deletions crates/proto/src/generated/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/// Applies changes of a new block to the DB and in-memory data structures.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApplyBlockRequest {
/// Block data encoded using Miden's native format
/// Block data encoded using Miden's native format.
#[prost(bytes = "vec", tag = "1")]
pub block: ::prost::alloc::vec::Vec<u8>,
}
Expand All @@ -13,14 +13,14 @@ pub struct CheckNullifiersByPrefixRequest {
#[prost(uint32, tag = "1")]
pub prefix_len: u32,
/// List of nullifiers to check. Each nullifier is specified by its prefix with length equal
/// to prefix_len
/// to `prefix_len`.
#[prost(uint32, repeated, tag = "2")]
pub nullifiers: ::prost::alloc::vec::Vec<u32>,
}
/// Get a list of proofs for given nullifier hashes, each proof as a sparse Merkle Tree
/// Get a list of proofs for given nullifier hashes, each proof as a sparse Merkle Tree.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckNullifiersRequest {
/// List of nullifiers to return proofs for
/// List of nullifiers to return proofs for.
#[prost(message, repeated, tag = "1")]
pub nullifiers: ::prost::alloc::vec::Vec<super::digest::Digest>,
}
Expand All @@ -30,9 +30,7 @@ pub struct CheckNullifiersRequest {
/// The Merkle path is an MMR proof for the block's leaf, based on the current chain length.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetBlockHeaderByNumberRequest {
/// The block number of the target block.
///
/// If not provided, means latest known block.
/// The block number of the target block. If not provided, means latest known block.
#[prost(uint32, optional, tag = "1")]
pub block_num: ::core::option::Option<u32>,
/// Whether or not to return authentication data for the block header.
Expand All @@ -52,7 +50,6 @@ pub struct SyncStateRequest {
#[prost(fixed32, tag = "1")]
pub block_num: u32,
/// Accounts' hash to include in the response.
///
/// An account hash will be included if-and-only-if it is the latest update. Meaning it is
/// possible there was an update to the account for the given range, but if it is not the latest,
/// it won't be included in the response.
Expand Down Expand Up @@ -110,21 +107,21 @@ pub struct GetTransactionInputsRequest {
/// Submits proven transaction to the Miden network.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubmitProvenTransactionRequest {
/// Transaction encoded using Miden's native format
/// Transaction encoded using Miden's native format.
#[prost(bytes = "vec", tag = "1")]
pub transaction: ::prost::alloc::vec::Vec<u8>,
}
/// Returns a list of notes matching the provided note IDs.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetNotesByIdRequest {
/// List of NoteId's to be queried from the database
/// List of NoteId's to be queried from the database.
#[prost(message, repeated, tag = "1")]
pub note_ids: ::prost::alloc::vec::Vec<super::digest::Digest>,
}
/// Returns a list of Note inclusion proofs for the specified Note IDs.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetNoteAuthenticationInfoRequest {
/// List of NoteId's to be queried from the database
/// List of NoteId's to be queried from the database.
#[prost(message, repeated, tag = "1")]
pub note_ids: ::prost::alloc::vec::Vec<super::digest::Digest>,
}
Expand Down
Loading

0 comments on commit 5722bf1

Please sign in to comment.