From b450634ab75084124c9b316035e8eb7e4b3b639f Mon Sep 17 00:00:00 2001 From: Dimitris Apostolou Date: Sun, 20 Dec 2020 23:33:43 +0200 Subject: [PATCH] Fix typos --- CONTRIBUTING.md | 10 +++++----- Dockerfile | 6 +++--- README.md | 10 +++++----- docs/darksidewalletd.md | 2 +- docs/docker-run.md | 4 ++-- docs/rtd/index.html | 8 ++++---- frontend/service.go | 4 ++-- parser/block_test.go | 4 ++-- walletrpc/darkside.pb.go | 9 ++------- walletrpc/service.pb.go | 21 ++++++++------------- walletrpc/service.proto | 8 ++++---- 11 files changed, 38 insertions(+), 48 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 92d69e0..89dc311 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,7 +11,7 @@ This document describes the standard workflows and terminology for developers at Before continuing, please ensure you have an existing GitHub or GitLab account. If not, visit [GitHub](https://github.com) or [GitLab](https://gitlab.com) to create an account. ## Fork Repository -This step assumes you are starting with a new GitHub/GitLab environment. If you have already forked the Lightwalletd repository, please continue to [Create Branch] section. Otherwise, open up a terminal and issue the below commands: +This step assumes you are starting with a new GitHub/GitLab environment. If you have already forked the lightwalletd repository, please continue to [Create Branch] section. Otherwise, open up a terminal and issue the below commands: Note: Please replace `your_username`, with your actual GitHub username @@ -43,10 +43,10 @@ After issuing the above commands, your `.git/config` file should look similar to fetch = +refs/heads/*:refs/remotes/upstream/* pushurl = DISABLED ``` -This setup provides a single cloned environment to develop for Lightwalletd. There are alternative methods using multiple clones, but this document does not cover that process. +This setup provides a single cloned environment to develop for lightwalletd. There are alternative methods using multiple clones, but this document does not cover that process. ## Create Branch -While working on the Lightwalletd project, you are going to have bugs, features, and ideas to work on. Branching exists to aid these different tasks while you write code. Below are some conventions of branching at Zcash: +While working on the lightwalletd project, you are going to have bugs, features, and ideas to work on. Branching exists to aid these different tasks while you write code. Below are some conventions of branching at Zcash: 1. `master` branch is **ALWAYS** deployable 2. Branch names **MUST** be descriptive: @@ -57,14 +57,14 @@ To create a new branch (assuming you are in `lightwalletd` directory): ```bash git checkout -b [new_branch_name] ``` -Note: Even though you have created a new branch, until you `git push` this local branch, it will not show up in your Lightwalletd fork on GitHub (e.g. https://github.com/your_username/lightwalletd) +Note: Even though you have created a new branch, until you `git push` this local branch, it will not show up in your lightwalletd fork on GitHub (e.g. https://github.com/your_username/lightwalletd) To checkout an existing branch (assuming you are in `lightwalletd` directory): ```bash git checkout [existing_branch_name] ``` -If you are fixing a bug or implementing a new feature, you likely will want to create a new branch. If you are reviewing code or working on existing branches, you likely will checkout an existing branch. To view the list of current Lightwalletd GitHub issues, click [here](https://github.com/zcash/lightwalletd/issues). +If you are fixing a bug or implementing a new feature, you likely will want to create a new branch. If you are reviewing code or working on existing branches, you likely will checkout an existing branch. To view the list of current lightwalletd GitHub issues, click [here](https://github.com/zcash/lightwalletd/issues). ## Make & Commit Changes If you have created a new branch or checked out an existing one, it is time to make changes to your local source code. Below are some formalities for commits: diff --git a/Dockerfile b/Dockerfile index 4776f57..b811d64 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # File: Dockerfile # Author: mdr0id # Date: 9/3/2019 - # Description: Used for devs that have not built zcash or lightwalletd on + # Description: Used for devs that have not built zcashd or lightwalletd on # on existing system # USAGE: # @@ -15,10 +15,10 @@ # First you need to get zcashd sync to current height on testnet, from outside container: # make docker_img_run_zcashd # - # Sometimes you need to manually start zcashd for the first time, from insdie the container: + # Sometimes you need to manually start zcashd for the first time, from inside the container: # zcashd -printtoconsole # - # Once the block height is atleast 280,000 you can go ahead and start lightwalletd + # Once the block height is at least 280,000 you can go ahead and start lightwalletd # make docker_img_run_lightwalletd_insecure_server # # If you need a random bash session in the container, use: diff --git a/README.md b/README.md index 846795d..c93f06a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ # Security Disclaimer -Lightwalletd is under active development, some features are more stable than +lightwalletd is under active development, some features are more stable than others. The code has not been subjected to a thorough review by an external auditor, and recent code changes have not yet received security review from Electric Coin Company's security team. @@ -12,7 +12,7 @@ Electric Coin Company's security team. Developers should familiarize themselves with the [wallet app threat model](https://zcash.readthedocs.io/en/latest/rtd_pages/wallet_threat_model.html), since it contains important information about the security and privacy -limitations of light wallets that use Lightwalletd. +limitations of light wallets that use lightwalletd. --- @@ -111,7 +111,7 @@ Example using server binary built from Makefile: ## Block cache -Lightwalletd caches all blocks from Sapling activation up to the +lightwalletd caches all blocks from Sapling activation up to the most recent block, which takes about an hour the first time you run lightwalletd. During this syncing, lightwalletd is fully available, but block fetches are slower until the download completes. @@ -121,7 +121,7 @@ because the blocks are cached in local files (by default, within `/var/lib/lightwalletd/db`; you can specify a different location using the `--data-dir` command-line option). -Lightwalletd checks the consistency of these files at startup and during +lightwalletd checks the consistency of these files at startup and during operation as these files may be damaged by, for example, an unclean shutdown. If the server detects corruption, it will automatically re-downloading blocks from `zcashd` from that height, requiring up to an hour again (no manual @@ -133,7 +133,7 @@ nature of the corruption. ## Darksidewalletd & Testing -Lightwalletd now supports a mode that enables integration testing of itself and +lightwalletd now supports a mode that enables integration testing of itself and wallets that connect to it. See the [darksidewalletd docs](docs/darksidewalletd.md) for more information. diff --git a/docs/darksidewalletd.md b/docs/darksidewalletd.md index dbbe5e8..ec44ae2 100644 --- a/docs/darksidewalletd.md +++ b/docs/darksidewalletd.md @@ -1,7 +1,7 @@ # Intro to darksidewalletd Darksidewalletd is a feature included in lightwalletd, enabled by the -`--darkside-very-insecure` flag, which can serve arbitrary blocks to a zcash +`--darkside-very-insecure` flag, which can serve arbitrary blocks to a Zcash light client wallet. This is useful for security and reorg testing. It includes a minimally-functional mock zcashd which comes with a gRPC API for controlling which blocks it will serve. diff --git a/docs/docker-run.md b/docs/docker-run.md index 1e82238..16e1e0a 100644 --- a/docs/docker-run.md +++ b/docs/docker-run.md @@ -3,7 +3,7 @@ Docker images are available on Docker Hub at [electriccoinco/lightwalletd](https ## Using command line options -Already have a zcash node running with an exposed RPC endpoint? +Already have a Zcash node running with an exposed RPC endpoint? Try the docker container with command lines flags like: ``` @@ -78,4 +78,4 @@ docker run --rm \ ## Using docker-compose for a full stack -Don't have an existing zcash node? Check out the [docker-compose](./docker-compose-setup.md) for examples of multi-container usage. +Don't have an existing Zcash node? Check out the [docker-compose](./docker-compose-setup.md) for examples of multi-container usage. diff --git a/docs/rtd/index.html b/docs/rtd/index.html index e184704..6070357 100644 --- a/docs/rtd/index.html +++ b/docs/rtd/index.html @@ -1318,7 +1318,7 @@ into a specified block on the next ApplyStaged().

data bytes -

exact data returned by zcash 'getrawtransaction'

+

exact data returned by Zcash 'getrawtransaction'

@@ -1398,7 +1398,7 @@ into a specified block on the next ApplyStaged().

TreeState

-

The TreeState is derived from the zcash z_gettreestate rpc.

+

The TreeState is derived from the Zcash z_gettreestate rpc.

@@ -1533,7 +1533,7 @@ into a specified block on the next ApplyStaged().

- + @@ -1577,7 +1577,7 @@ in the exclude list that don't exist in the mempool are ignored.

diff --git a/frontend/service.go b/frontend/service.go index 32e4478..ac9f239 100644 --- a/frontend/service.go +++ b/frontend/service.go @@ -170,14 +170,14 @@ func (s *lwdStreamer) GetBlockRange(span *walletrpc.BlockRange, resp walletrpc.C } // GetTreeState returns the note commitment tree state corresponding to the given block. -// See section 3.7 of the zcash protocol specification. It returns several other useful +// See section 3.7 of the Zcash protocol specification. It returns several other useful // values also (even though they can be obtained using GetBlock). // The block can be specified by either height or hash. func (s *lwdStreamer) GetTreeState(ctx context.Context, id *walletrpc.BlockID) (*walletrpc.TreeState, error) { if id.Height == 0 && id.Hash == nil { return nil, errors.New("request for unspecified identifier") } - // The zcash z_gettreestate rpc accepts either a block height or block hash + // The Zcash z_gettreestate rpc accepts either a block height or block hash params := make([]json.RawMessage, 1) var hashJSON []byte if id.Height > 0 { diff --git a/parser/block_test.go b/parser/block_test.go index 703dfee..99f6338 100644 --- a/parser/block_test.go +++ b/parser/block_test.go @@ -97,12 +97,12 @@ func TestBlockParser(t *testing.T) { t.Error("Unexpected number of transactions") } if block.HasSaplingTransactions() { - t.Error("Unexpected Saping tx") + t.Error("Unexpected Sapling tx") break } for txindex, tx := range block.Transactions() { if tx.HasSaplingElements() { - t.Error("Unexpected Saping tx") + t.Error("Unexpected Sapling tx") break } expectedHash := txhashes[blockindex][txindex%len(txhashes[blockindex])] diff --git a/walletrpc/darkside.pb.go b/walletrpc/darkside.pb.go index b44b4a9..cdabfc2 100644 --- a/walletrpc/darkside.pb.go +++ b/walletrpc/darkside.pb.go @@ -4,15 +4,14 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 -// protoc v3.11.0 +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 // source: darkside.proto package walletrpc import ( context "context" - proto "github.com/golang/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -29,10 +28,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type DarksideMetaState struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/walletrpc/service.pb.go b/walletrpc/service.pb.go index 315f9f9..303de81 100644 --- a/walletrpc/service.pb.go +++ b/walletrpc/service.pb.go @@ -4,15 +4,14 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 -// protoc v3.11.0 +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 // source: service.proto package walletrpc import ( context "context" - proto "github.com/golang/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -29,10 +28,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // A BlockID message contains identifiers to select a block: a height or a // hash. Specification by hash is not implemented, but may be in the future. type BlockID struct { @@ -220,7 +215,7 @@ type RawTransaction struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // exact data returned by zcash 'getrawtransaction' + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // exact data returned by Zcash 'getrawtransaction' Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` // height that the transaction was mined (or -1) } @@ -912,7 +907,7 @@ func (x *Exclude) GetTxid() [][]byte { return nil } -// The TreeState is derived from the zcash z_gettreestate rpc. +// The TreeState is derived from the Zcash z_gettreestate rpc. type TreeState struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1742,7 +1737,7 @@ type CompactTxStreamerClient interface { GetBlockRange(ctx context.Context, in *BlockRange, opts ...grpc.CallOption) (CompactTxStreamer_GetBlockRangeClient, error) // Return the requested full (not compact) transaction (as from zcashd) GetTransaction(ctx context.Context, in *TxFilter, opts ...grpc.CallOption) (*RawTransaction, error) - // Submit the given transaction to the zcash network + // Submit the given transaction to the Zcash network SendTransaction(ctx context.Context, in *RawTransaction, opts ...grpc.CallOption) (*SendResponse, error) // Return the txids corresponding to the given t-address within the given block range GetTaddressTxids(ctx context.Context, in *TransparentAddressBlockFilter, opts ...grpc.CallOption) (CompactTxStreamer_GetTaddressTxidsClient, error) @@ -1759,7 +1754,7 @@ type CompactTxStreamerClient interface { // in the exclude list that don't exist in the mempool are ignored. GetMempoolTx(ctx context.Context, in *Exclude, opts ...grpc.CallOption) (CompactTxStreamer_GetMempoolTxClient, error) // GetTreeState returns the note commitment tree state corresponding to the given block. - // See section 3.7 of the zcash protocol specification. It returns several other useful + // See section 3.7 of the Zcash protocol specification. It returns several other useful // values also (even though they can be obtained using GetBlock). // The block can be specified by either height or hash. GetTreeState(ctx context.Context, in *BlockID, opts ...grpc.CallOption) (*TreeState, error) @@ -2032,7 +2027,7 @@ type CompactTxStreamerServer interface { GetBlockRange(*BlockRange, CompactTxStreamer_GetBlockRangeServer) error // Return the requested full (not compact) transaction (as from zcashd) GetTransaction(context.Context, *TxFilter) (*RawTransaction, error) - // Submit the given transaction to the zcash network + // Submit the given transaction to the Zcash network SendTransaction(context.Context, *RawTransaction) (*SendResponse, error) // Return the txids corresponding to the given t-address within the given block range GetTaddressTxids(*TransparentAddressBlockFilter, CompactTxStreamer_GetTaddressTxidsServer) error @@ -2049,7 +2044,7 @@ type CompactTxStreamerServer interface { // in the exclude list that don't exist in the mempool are ignored. GetMempoolTx(*Exclude, CompactTxStreamer_GetMempoolTxServer) error // GetTreeState returns the note commitment tree state corresponding to the given block. - // See section 3.7 of the zcash protocol specification. It returns several other useful + // See section 3.7 of the Zcash protocol specification. It returns several other useful // values also (even though they can be obtained using GetBlock). // The block can be specified by either height or hash. GetTreeState(context.Context, *BlockID) (*TreeState, error) diff --git a/walletrpc/service.proto b/walletrpc/service.proto index 8e3ca33..df55c83 100644 --- a/walletrpc/service.proto +++ b/walletrpc/service.proto @@ -34,7 +34,7 @@ message TxFilter { // RawTransaction contains the complete transaction data. It also optionally includes // the block height in which the transaction was included. message RawTransaction { - bytes data = 1; // exact data returned by zcash 'getrawtransaction' + bytes data = 1; // exact data returned by Zcash 'getrawtransaction' uint64 height = 2; // height that the transaction was mined (or -1) } @@ -107,7 +107,7 @@ message Exclude { repeated bytes txid = 1; } -// The TreeState is derived from the zcash z_gettreestate rpc. +// The TreeState is derived from the Zcash z_gettreestate rpc. message TreeState { string network = 1; // "main" or "test" uint64 height = 2; @@ -142,7 +142,7 @@ service CompactTxStreamer { // Return the requested full (not compact) transaction (as from zcashd) rpc GetTransaction(TxFilter) returns (RawTransaction) {} - // Submit the given transaction to the zcash network + // Submit the given transaction to the Zcash network rpc SendTransaction(RawTransaction) returns (SendResponse) {} // Return the txids corresponding to the given t-address within the given block range @@ -162,7 +162,7 @@ service CompactTxStreamer { rpc GetMempoolTx(Exclude) returns (stream CompactTx) {} // GetTreeState returns the note commitment tree state corresponding to the given block. - // See section 3.7 of the zcash protocol specification. It returns several other useful + // See section 3.7 of the Zcash protocol specification. It returns several other useful // values also (even though they can be obtained using GetBlock). // The block can be specified by either height or hash. rpc GetTreeState(BlockID) returns (TreeState) {}
SendTransaction RawTransaction SendResponse

Submit the given transaction to the zcash network

Submit the given transaction to the Zcash network

BlockID TreeState

GetTreeState returns the note commitment tree state corresponding to the given block. -See section 3.7 of the zcash protocol specification. It returns several other useful +See section 3.7 of the Zcash protocol specification. It returns several other useful values also (even though they can be obtained using GetBlock). The block can be specified by either height or hash.