diff --git a/.github/workflows/typo-check.yml b/.github/workflows/typo-check.yml new file mode 100644 index 000000000..415c8be1e --- /dev/null +++ b/.github/workflows/typo-check.yml @@ -0,0 +1,15 @@ +name: Typo Check + +on: [pull_request] + +jobs: + check-for-typos: + runs-on: [taiko-runner] + steps: + - name: Checkout the repository + uses: actions/checkout@v4 + + - name: Check for typos + uses: crate-ci/typos@master + with: + config: ${{github.workspace}}/.github/_typos.toml diff --git a/README.md b/README.md index 4c8392f4d..dae080dcd 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # raiko -Taiko's multi-prover of Taiko & Etheruem block, currently supports Risc0, Sp1, and SGX. +Taiko's multi-prover for Taiko & Ethereum blocks. Currently supports Risc0, SP1, and SGX. ## Usage ### Installing -To download all dependencies for all provers you can run +To download all dependencies for all provers you can run: ```shell make install @@ -20,17 +20,17 @@ TARGET=sp1 make install ### Building -After installing dependencies of selected prover, the following command internally calls cargo to build the prover's guest target with the `--release` profile by default, for example: +After installing dependencies of the selected prover, the following command internally calls cargo to build the prover's guest target with the `--release` profile by default, for example: ```shell TARGET=sp1 make build ``` -If you set `DEBUG=1` then the target will be compiled without optimization (not recommended for ZkVM elfs). +If you set `DEBUG=1`, then the target will be compiled without optimization (not recommended for zkVM elfs). ### Running -Note that you have to `make build` first before running ZkVM provers, otherwise the guest elf may not be up to date and can result in poof failures. +Note that you have to run `make build` first before running zkVM provers, otherwise the guest elf may not be up to date and can result in proof failures. ```shell TARGET=sp1 make run @@ -42,7 +42,7 @@ Just for development with the native prover which runs through the block executi cargo run ``` -`run` camand will start the host service that listens to proof requests, then in another terminal you can do requests like this, which proves the 10th block with native prover on Taiko A7 testnet: +The `run` command will start the host service that listens to proof requests, then in another terminal you can do requests like this, which proves the 10th block with the native prover on Taiko's A7 testnet: ```shell ./script/prove-block.sh taiko_a7 native 10 @@ -56,7 +56,7 @@ Look into `prove-block.sh` for the available options or run the script without i ## Provers -For all host program, you can enable CPU optimization through exporting `CPU_OPT=1`. +For all host programs, you can enable CPU optimization through exporting `CPU_OPT=1`. ### Risc zero @@ -67,7 +67,7 @@ export TARGET=risc0 make install && make build && make run ``` -To build and run test on Risc0 Zkvm: +To build and run tests on Risc0 zkVM: ```shell TARGET=risc0 make test @@ -75,7 +75,7 @@ TARGET=risc0 make test #### Bonsai -If you are using Bonsai service, edit `run-bonsai.sh` to setup your API key, endpoint and on-chain verifier address. +If you are using the Bonsai service, edit `run-bonsai.sh` to setup your API key, endpoint, and on-chain verifier address. ```shell ./script/setup-bonsai.sh @@ -84,7 +84,7 @@ If you are using Bonsai service, edit `run-bonsai.sh` to setup your API key, end #### GPU -If you have GPU with CUDA or Apple's GPU API to accelerate risc0 proof, you can do: +If you have a GPU with CUDA or Apple's GPU API to accelerate Risc0 proofs, you can do: ```shell // cuda @@ -93,7 +93,7 @@ cargo run -F cuda --release --features risc0 cargo run -F metal --release --features risc0 ``` -Note that CUDA needs to be installed when using `cuda`: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html +Note that CUDA needs to be installed when using `cuda`: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html. ### SP1 @@ -104,15 +104,15 @@ export TARGET=sp1 make install && make build && make run ``` -To build and run test on Sp1 Zkvm: +To build and run tests on the SP1 zkVM: ```shell TARGET=sp1 make test ``` -Some optimized configuration tailored to the host can be found [here](docs/README_Sp1.md) +Some optimized configurations tailored to the host can be found [here](docs/README_SP1.md). -### SGX: +### SGX To install, build, and run in one step: @@ -133,12 +133,12 @@ If your CPU doesn't support SGX, you can still run the SGX code through gramine MOCK=1 TARGET=sgx make run ``` -## Misc +## Misc docs -[Docker & Remote Attestation Support](docs/README_Docker_and_RA.md) -[Metrics](docs/README_Metrics.md) +- [Docker & Remote Attestation Support](docs/README_Docker_and_RA.md) +- [Metrics](docs/README_Metrics.md) -### Execution Trace +## Execution Trace You can generate an execution trace for the block that is being proven by enabling the `tracer` feature: diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 000000000..b54555e34 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,16 @@ +[default] +# False positives +extend-ignore-identifiers-re = [ + "MFowcDEiMCAGA1UEAwwZSW50ZWwgU0dYIFBDSyBDZXJ0aWZpY2F0ZTEaMBgGA1UE", + "VQQIDAJDQTELMAkGA1UEBhMCVVMwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQy", + "TGEB5zHBjzjv9kuWyUjUo4IDDjCCAwowHwYDVR0jBBgwFoAUlW9dzb0b4elAScnU", + "CAwCQ0ExCzAJBgNVBAYTAlVTMB4XDTI0MDExMDAyNDI0MFoXDTMxMDExMDAyNDI0", + "EUludGVsIENvcnBvcmF0aW9uMRQwEgYDVQQHDAtTYW50YSBDbGFyYTELMAkGA1UE", + "(?i)groth", + "leafs", + "benchs", + "ba" +] + +[files] +extend-exclude = [] diff --git a/docker/pccs-defaut-example.json b/docker/pccs-default-example.json similarity index 100% rename from docker/pccs-defaut-example.json rename to docker/pccs-default-example.json diff --git a/docs/README_Sp1.md b/docs/README_Sp1.md index dc943abb1..cf8580210 100644 --- a/docs/README_Sp1.md +++ b/docs/README_Sp1.md @@ -24,7 +24,7 @@ SHARD_SIZE=4194304 RUST_LOG=info RUSTFLAGS='-C target-cpu=native' cargo run --re ## Memory Usage -To reduce memory usage, set the `SHARD_BATCH_SIZE` enviroment variable depending on how much RAM +To reduce memory usage, set the `SHARD_BATCH_SIZE` environment variable depending on how much RAM your machine has. A higher number will use more memory, but will be faster. ```rust,noplayground diff --git a/lib/src/builder/execute.rs b/lib/src/builder/execute.rs index cd8e77749..8cdc7d91f 100644 --- a/lib/src/builder/execute.rs +++ b/lib/src/builder/execute.rs @@ -206,7 +206,7 @@ impl TxExecStrategy for TkoTxExecStrategy { ensure!(tx_env.blob_hashes.len() == 0); } - // if the sigature was not valid, the caller address will have been set to zero + // if the signature was not valid, the caller address will have been set to zero if tx_env.caller == Address::ZERO { if is_anchor { bail!("Error recovering anchor signature"); diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 1b7c5ca95..5facdcef1 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -152,7 +152,7 @@ pub fn clear_line() { /// call forget only if running inside the guest pub fn guest_mem_forget(_t: T) { - #[cfg(target_os = "zkvm")] // TODO: seperate for risc0 + #[cfg(target_os = "zkvm")] // TODO: separate for risc0 core::mem::forget(_t) } diff --git a/lib/src/utils.rs b/lib/src/utils.rs index abd8b4f61..f4baff556 100644 --- a/lib/src/utils.rs +++ b/lib/src/utils.rs @@ -52,7 +52,7 @@ fn validate_calldata_tx_list(tx_list: &[u8]) -> bool { fn get_tx_list(chain_spec: &ChainSpec, is_blob_data: bool, tx_list: &[u8]) -> Vec { if chain_spec.is_taiko() { - // taiko has some limiations to be aligned with taiko-client + // taiko has some limitations to be aligned with taiko-client if is_blob_data { let compressed_tx_list = decode_blob_data(tx_list); return zlib_decompress_data(&compressed_tx_list).unwrap_or_default(); diff --git a/provers/sp1/driver/src/lib.rs b/provers/sp1/driver/src/lib.rs index d25315ee4..e7d1e4983 100644 --- a/provers/sp1/driver/src/lib.rs +++ b/provers/sp1/driver/src/lib.rs @@ -51,7 +51,7 @@ impl Prover for Sp1Prover { ) .expect("Sp1: saving proof failed"); - println!("succesfully generated and verified proof for the program!"); + println!("successfully generated and verified proof for the program!"); to_proof(Ok(Sp1Response { proof: serde_json::to_string(&proof).unwrap(), output, diff --git a/provers/sp1/guest/src/zk_op.rs b/provers/sp1/guest/src/zk_op.rs index 70dcfcf36..343e142c8 100644 --- a/provers/sp1/guest/src/zk_op.rs +++ b/provers/sp1/guest/src/zk_op.rs @@ -172,7 +172,7 @@ harness::zk_suits!( let p = AffinePoint::::from(p_x, p_y); let p_bytes_le = p.to_le_bytes(); - // Reverse to x, y seperatly to big-endian bytes + // Reverse to x, y separately to big-endian bytes let mut p_bytes_be = [0; 64]; p_bytes_be[..32] .copy_from_slice(&p_bytes_le[..32].iter().rev().copied().collect::>());