Skip to content

Commit

Permalink
Merge pull request #160 from rex4539/typos
Browse files Browse the repository at this point in the history
fix typos
  • Loading branch information
idky137 authored Jan 20, 2025
2 parents 72e8c42 + f444149 commit 263d26d
Show file tree
Hide file tree
Showing 18 changed files with 47 additions and 48 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Currently Zebra's `ReadStateService` only enables direct access to chain data (b

## Documentation
- [Use Cases](./docs/use_cases.md): Holds instructions and example use cases.
- [Testing](./docs/testing.md): Hold intructions fo running tests.
- [Testing](./docs/testing.md): Hold instructions fo running tests.
- [Live Service System Architecture](./docs/live_system_architecture.pdf): Holds the Zcash system architecture diagram for the Zaino live service.
- [Library System Architecture](./docs/lib_system_architecture.pdf): Holds the Zcash system architecture diagram for the Zaino client library.
- [Internal Architecture](./docs/internal_architecture.pdf): Holds an internal Zaino system architecture diagram.
Expand Down
2 changes: 1 addition & 1 deletion docs/internal_spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The main crates are:

Below is a detailed specification for each crate.

A full specification of the public functionality and RPC services available in Zaino is availabe in [Cargo Docs](https://zingolabs.github.io/zaino/index.html) and [RPC API Spec](./rpc_api.md).
A full specification of the public functionality and RPC services available in Zaino is available in [Cargo Docs](https://zingolabs.github.io/zaino/index.html) and [RPC API Spec](./rpc_api.md).


## ZainoD
Expand Down
2 changes: 1 addition & 1 deletion docs/rpc_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Zaino Currently Serves the following gRPC services as defined in the [LightWalle


## Zcash RPC Services
Zaino has commited to taking over responsibility for serving the following [Zcash RPCs](https://zcash.github.io/rpc/) from Zcashd:
Zaino has committed to taking over responsibility for serving the following [Zcash RPCs](https://zcash.github.io/rpc/) from Zcashd:
- [getaddressbalance](https://zcash.github.io/rpc/getaddressbalance.html)
- [getaddressdeltas](https://zcash.github.io/rpc/getaddressdeltas.html)
- [getaddressmempool](https://zcash.github.io/rpc/getaddressmempool.html) (**MARKED FOR DEPRECATION**)
Expand Down
3 changes: 1 addition & 2 deletions docs/use_cases.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
1) Run `$ cargo build --release`
2) Add compiled binary held at `#PATH_TO/zaino/target/release/zainod` to PATH.

- Then to launch Zaino: [in seperate terminals]:
- Then to launch Zaino: [in separate terminals]:
3) Run `$ zebrad --config #PATH_TO_CONF/zebrad.toml start`
4) Run `$ zainod --config #PATH_TO_CONF/zindexer.toml`

Expand All @@ -30,4 +30,3 @@ A system architecture diagram for this service can be seen at [Library System Ar
**Currently Unimplemented, documentation will be added here as this functionality becomes available.**

A system architecture diagram for this service can be seen at [Library System Architecture](./lib_system_architecture.pdf).

2 changes: 1 addition & 1 deletion zaino-fetch/src/chain/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::chain::error::ParseError;
pub trait ParseFromSlice {
/// Reads data from a bytestring, consuming data read, and returns an instance of self along with the remaining data in the bytestring given.
///
/// txid is givin as an input as this is taken from a get_block verbose=1 call.
/// txid is giving as an input as this is taken from a get_block verbose=1 call.
///
/// tx_version is used for deserializing sapling spends and outputs.
fn parse_from_slice(
Expand Down
2 changes: 1 addition & 1 deletion zaino-fetch/src/jsonrpc/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl JsonRpcConnectorError {
/// Converts JsonRpcConnectorError to tonic::Status
///
/// TODO: This impl should be changed to return the correct status [https://github.com/zcash/lightwalletd/issues/497] before release,
/// however propagating the server error is useful durin development.
/// however propagating the server error is useful during development.
pub fn to_grpc_status(&self) -> tonic::Status {
// TODO: Hide server error from clients before release. Currently useful for dev purposes.
tonic::Status::internal(format!("Error: JsonRPC Client Error: {}", self))
Expand Down
2 changes: 1 addition & 1 deletion zaino-serve/src/server/ingestor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl TcpIngestor {
}
Err(e) => {
eprintln!("Failed to accept connection with client: {}", e);
// TODO: Handle failed connection errors here (count errors and restart ingestor / proxy or initiate shotdown?)
// TODO: Handle failed connection errors here (count errors and restart ingestor / proxy or initiate shutdown?)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions zaino-serve/src/server/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl<T> Clone for QueueReceiver<T> {
}

impl<T> QueueReceiver<T> {
/// Try to receive a request from the queue, updatig queue size.
/// Try to receive a request from the queue, updating queue size.
pub(crate) fn try_recv(&self) -> Result<T, QueueError<T>> {
match self.inner.try_recv() {
Ok(message) => {
Expand All @@ -128,7 +128,7 @@ impl<T> QueueReceiver<T> {
}
}

/// Listens indefinately for an incoming message on the queue. Returns message if received or error if queue is closed.
/// Listens indefinitely for an incoming message on the queue. Returns message if received or error if queue is closed.
pub(crate) async fn listen(&self) -> Result<T, QueueError<T>> {
// NOTE: This interval may need to be reduced or removed / moved once scale testing begins.
let mut interval = tokio::time::interval(tokio::time::Duration::from_millis(50));
Expand Down
8 changes: 4 additions & 4 deletions zaino-serve/src/server/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use tokio::net::TcpStream;
#[derive(Debug, Clone)]
struct QueueData {
// / Exclusive request id.
// request_id: u64, // TODO: implement with request queue (implement exlusive request_id generator in queue object).
// request_id: u64, // TODO: implement with request queue (implement exclusive request_id generator in queue object).
/// Time which the request was received.
#[allow(dead_code)]
time_received: SystemTime,
Expand All @@ -32,7 +32,7 @@ impl QueueData {
self.requeue_attempts += 1;
}

/// Returns the duration sunce the request was received.
/// Returns the duration since the request was received.
#[allow(dead_code)]
fn duration(&self) -> Result<std::time::Duration, RequestError> {
self.time_received.elapsed().map_err(RequestError::from)
Expand Down Expand Up @@ -79,7 +79,7 @@ pub enum ZingoIndexerRequest {
}

impl ZingoIndexerRequest {
/// Creates a ZingoIndexerRequest from a gRPC service call, recieved by the gRPC server.
/// Creates a ZingoIndexerRequest from a gRPC service call, received by the gRPC server.
///
/// TODO: implement proper functionality along with queue.
pub(crate) fn new_from_grpc(stream: TcpStream) -> Self {
Expand All @@ -97,7 +97,7 @@ impl ZingoIndexerRequest {
}
}

/// Returns the duration sunce the request was received.
/// Returns the duration since the request was received.
#[allow(dead_code)]
pub(crate) fn duration(&self) -> Result<std::time::Duration, RequestError> {
match self {
Expand Down
6 changes: 3 additions & 3 deletions zaino-serve/src/server/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl Worker {
Err(_e) => {
self.atomic_status.store(StatusType::Offline.into());
eprintln!("Queue closed, worker shutting down.");
// TODO: Handle queue closed error here. (return correct error / undate status to correct err code.)
// TODO: Handle queue closed error here. (return correct error / update status to correct err code.)
return Ok(());
}
}
Expand Down Expand Up @@ -192,9 +192,9 @@ pub(crate) struct WorkerPool {
service_subscriber: IndexerSubscriber<FetchServiceSubscriber>,
/// Service status.
service_status: AtomicStatus,
/// Maximun number of concurrent workers allowed.
/// Maximum number of concurrent workers allowed.
max_size: u16,
/// Minimum number of workers kept running on stanby.
/// Minimum number of workers kept running on standby.
idle_size: u16,
/// Workers currently in the pool
workers: Vec<Worker>,
Expand Down
2 changes: 1 addition & 1 deletion zaino-state/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ pub enum MempoolError {
#[error("JsonRpcConnector error: {0}")]
JsonRpcConnectorError(#[from] zaino_fetch::jsonrpc::error::JsonRpcConnectorError),

/// Error from a Tokio Watch Reciever.
/// Error from a Tokio Watch Receiver.
#[error("Join error: {0}")]
WatchRecvError(#[from] tokio::sync::watch::error::RecvError),

Expand Down
16 changes: 8 additions & 8 deletions zaino-state/src/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ use zebra_rpc::methods::{
/// This service is a central service, [`FetchServiceSubscriber`] should be created to fetch data.
/// This is done to enable large numbers of concurrent subscribers without significant slowdowns.
///
/// NOTE: We currently dop not implement clone for chain fetch services as this service is responsible for maintainng and closing its child processes.
/// ServiceSubscribers are used to create seperate chain fetch processes while allowing central state processes to be managed in a sibgle place.
/// NOTE: We currently dop not implement clone for chain fetch services as this service is responsible for maintaining and closing its child processes.
/// ServiceSubscribers are used to create separate chain fetch processes while allowing central state processes to be managed in a single place.
/// If we want the ability to clone Service all JoinHandle's should be converted to Arc<JoinHandle>.
#[derive(Debug)]
pub struct FetchService {
Expand Down Expand Up @@ -516,7 +516,7 @@ impl LightWalletIndexer for FetchServiceSubscriber {

/// Return the compact block corresponding to the given block identifier
///
/// NOTE: This implementation is slow due to the absense on an internal CompactBlock cache.
/// NOTE: This implementation is slow due to the absence on an internal CompactBlock cache.
async fn get_block(&self, request: BlockId) -> Result<CompactBlock, Self::Error> {
let height: u32 = match request.height.try_into() {
Ok(height) => height,
Expand Down Expand Up @@ -554,7 +554,7 @@ impl LightWalletIndexer for FetchServiceSubscriber {

/// Same as GetBlock except actions contain only nullifiers
///
/// NOTE: This implementation is slow due to the absense on an internal CompactBlock cache.
/// NOTE: This implementation is slow due to the absence on an internal CompactBlock cache.
async fn get_block_nullifiers(&self, request: BlockId) -> Result<CompactBlock, Self::Error> {
let height: u32 = match request.height.try_into() {
Ok(height) => height,
Expand Down Expand Up @@ -592,7 +592,7 @@ impl LightWalletIndexer for FetchServiceSubscriber {

/// Return a list of consecutive compact blocks
///
/// NOTE: This implementation is slow due to the absense on an internal CompactBlock cache.
/// NOTE: This implementation is slow due to the absence on an internal CompactBlock cache.
async fn get_block_range(
&self,
request: BlockRange,
Expand Down Expand Up @@ -705,7 +705,7 @@ impl LightWalletIndexer for FetchServiceSubscriber {

/// Same as GetBlockRange except actions contain only nullifiers
///
/// NOTE: This implementation is slow due to the absense on an internal CompactBlock cache.
/// NOTE: This implementation is slow due to the absence on an internal CompactBlock cache.
async fn get_block_range_nullifiers(
&self,
request: BlockRange,
Expand Down Expand Up @@ -1723,7 +1723,7 @@ impl FetchServiceSubscriber {
///
/// Uses 2 calls as z_get_block verbosity=1 is required to fetch txids from zcashd.
///
/// NOTE: This implementation is slow due to the absense on an internal CompactBlock cache.
/// NOTE: This implementation is slow due to the absence on an internal CompactBlock cache.
async fn get_compact_block(&self, height: &u32) -> Result<CompactBlock, FetchServiceError> {
match self.z_get_block(height.to_string(), Some(1)).await {
Ok(GetBlock::Object {
Expand Down Expand Up @@ -1785,7 +1785,7 @@ impl FetchServiceSubscriber {

/// Returns a compact block holding only action nullifiers.
///
/// NOTE: This implementation is slow due to the absense on an internal CompactBlock cache.
/// NOTE: This implementation is slow due to the absence on an internal CompactBlock cache.
async fn get_nullifiers(&self, height: &u32) -> Result<CompactBlock, FetchServiceError> {
match self.get_compact_block(height).await {
Ok(block) => Ok(CompactBlock {
Expand Down
6 changes: 3 additions & 3 deletions zaino-state/src/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ where
/// Zcash Service functionality.
#[async_trait]
pub trait ZcashService: Sized {
/// Uses undelying error type of implementer.
/// Uses underlying error type of implementer.
type Error: std::error::Error + Send + Sync + 'static;

/// A subscriber to the service, used to fetch chain data.
Expand Down Expand Up @@ -125,7 +125,7 @@ where
/// Doc comments taken from Zebra for consistency.
#[async_trait]
pub trait ZcashIndexer: Send + Sync + 'static {
/// Uses undelying error type of implementer.
/// Uses underlying error type of implementer.
type Error: std::error::Error + Send + Sync + 'static;

/// Returns software information from the RPC server, as a [`GetInfo`] JSON struct.
Expand Down Expand Up @@ -355,7 +355,7 @@ pub trait ZcashIndexer: Send + Sync + 'static {
/// Doc comments taken from Zaino-Proto for consistency.
#[async_trait]
pub trait LightWalletIndexer: Send + Sync + 'static {
/// Uses undelying error type of implementer.
/// Uses underlying error type of implementer.
type Error: std::error::Error + Send + Sync + 'static + Into<tonic::Status>;

/// Return the height of the tip of the best chain
Expand Down
2 changes: 1 addition & 1 deletion zaino-state/src/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct MempoolKey(pub String);
///
/// NOTE: Currently holds a copy of txid,
/// this could be updated to store the corresponding transaction as the value,
/// this would enable the serving of mempool trasactions directly, significantly increasing efficiency.
/// this would enable the serving of mempool transactions directly, significantly increasing efficiency.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct MempoolValue(pub GetRawTransaction);

Expand Down
8 changes: 4 additions & 4 deletions zaino-state/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ use zaino_proto::proto::compact_formats::{

/// Chain fetch service backed by Zebra's `ReadStateService` and `TrustedChainSync`.
///
/// NOTE: We currently dop not implement clone for chain fetch services as this service is responsible for maintainng and closing its child processes.
/// ServiceSubscribers are used to create seperate chain fetch processes while allowing central state processes to be managed in a sibgle place.
/// NOTE: We currently dop not implement clone for chain fetch services as this service is responsible for maintaining and closing its child processes.
/// ServiceSubscribers are used to create separate chain fetch processes while allowing central state processes to be managed in a single place.
/// If we want the ability to clone Service all JoinHandle's should be converted to Arc<JoinHandle>.
#[derive(Debug)]
pub struct StateService {
Expand Down Expand Up @@ -1250,7 +1250,7 @@ mod tests {
let fetch_service_get_blockchain_info: GetBlockChainInfo =
fetch_service_get_blockchain_info.into();

// Zaino-Fetch does not return value_pools, ingnore this field.
// Zaino-Fetch does not return value_pools, ignore this field.
assert_eq!(
(
state_service_get_blockchain_info.chain(),
Expand Down Expand Up @@ -1339,7 +1339,7 @@ mod tests {

test_manager.local_net.print_stdout();

// Zaino-Fetch does not return value_pools, ingnore this field.
// Zaino-Fetch does not return value_pools, ignore this field.
assert_eq!(
(
state_service_get_blockchain_info.chain(),
Expand Down
2 changes: 1 addition & 1 deletion zaino-state/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::sync::{
Arc,
};

/// Holds a thread safe reperesentation of a StatusType.
/// Holds a thread safe representation of a StatusType.
/// Possible values:
/// - [0: Spawning]
/// - [1: Syncing]
Expand Down
10 changes: 5 additions & 5 deletions zaino-state/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub struct RawTransactionStream {
}

impl RawTransactionStream {
/// Returns new instanse of RawTransactionStream.
/// Returns new instance of RawTransactionStream.
pub fn new(rx: tokio::sync::mpsc::Receiver<Result<RawTransaction, tonic::Status>>) -> Self {
RawTransactionStream {
inner: ReceiverStream::new(rx),
Expand Down Expand Up @@ -43,7 +43,7 @@ pub struct CompactTransactionStream {
}

impl CompactTransactionStream {
/// Returns new instanse of RawTransactionStream.
/// Returns new instance of RawTransactionStream.
pub fn new(rx: tokio::sync::mpsc::Receiver<Result<CompactTx, tonic::Status>>) -> Self {
CompactTransactionStream {
inner: ReceiverStream::new(rx),
Expand Down Expand Up @@ -74,7 +74,7 @@ pub struct CompactBlockStream {
}

impl CompactBlockStream {
/// Returns new instanse of CompactBlockStream.
/// Returns new instance of CompactBlockStream.
pub fn new(rx: tokio::sync::mpsc::Receiver<Result<CompactBlock, tonic::Status>>) -> Self {
CompactBlockStream {
inner: ReceiverStream::new(rx),
Expand Down Expand Up @@ -105,7 +105,7 @@ pub struct UtxoReplyStream {
}

impl UtxoReplyStream {
/// Returns new instanse of CompactBlockStream.
/// Returns new instance of CompactBlockStream.
pub fn new(
rx: tokio::sync::mpsc::Receiver<Result<GetAddressUtxosReply, tonic::Status>>,
) -> Self {
Expand Down Expand Up @@ -138,7 +138,7 @@ pub struct SubtreeRootReplyStream {
}

impl SubtreeRootReplyStream {
/// Returns new instanse of CompactBlockStream.
/// Returns new instance of CompactBlockStream.
pub fn new(rx: tokio::sync::mpsc::Receiver<Result<SubtreeRoot, tonic::Status>>) -> Self {
SubtreeRootReplyStream {
inner: ReceiverStream::new(rx),
Expand Down
Loading

0 comments on commit 263d26d

Please sign in to comment.