Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix all typos #278

Merged
merged 2 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/typo-check.yml
Original file line number Diff line number Diff line change
@@ -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
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand All @@ -67,15 +67,15 @@ 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
```

#### 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
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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:

Expand All @@ -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:

Expand Down
16 changes: 16 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[default]
# False positives
extend-ignore-identifiers-re = [
"MFowcDEiMCAGA1UEAwwZSW50ZWwgU0dYIFBDSyBDZXJ0aWZpY2F0ZTEaMBgGA1UE",
"VQQIDAJDQTELMAkGA1UEBhMCVVMwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQy",
"TGEB5zHBjzjv9kuWyUjUo4IDDjCCAwowHwYDVR0jBBgwFoAUlW9dzb0b4elAScnU",
"CAwCQ0ExCzAJBgNVBAYTAlVTMB4XDTI0MDExMDAyNDI0MFoXDTMxMDExMDAyNDI0",
"EUludGVsIENvcnBvcmF0aW9uMRQwEgYDVQQHDAtTYW50YSBDbGFyYTELMAkGA1UE",
"(?i)groth",
"leafs",
"benchs",
"ba"
]

[files]
extend-exclude = []
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/README_Sp1.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/src/builder/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ pub fn clear_line() {

/// call forget only if running inside the guest
pub fn guest_mem_forget<T>(_t: T) {
#[cfg(target_os = "zkvm")] // TODO: seperate for risc0
#[cfg(target_os = "zkvm")] // TODO: separate for risc0
core::mem::forget(_t)
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8> {
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();
Expand Down
2 changes: 1 addition & 1 deletion provers/sp1/driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion provers/sp1/guest/src/zk_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ harness::zk_suits!(
let p = AffinePoint::<Bn254, 16>::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::<Vec<_>>());
Expand Down
Loading