Skip to content

Commit

Permalink
gh pages + nits
Browse files Browse the repository at this point in the history
  • Loading branch information
hashcashier committed Dec 20, 2024
1 parent 842856f commit e74d15f
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 37 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: GitHub Pages

on:
workflow_dispatch:
push:
branches:
- main
pull_request:

jobs:
publish:
name: Publish to GitHub Pages
runs-on: ubuntu-22.04
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v4
- uses: risc0/risc0/.github/actions/rustup@main

- name: Setup mdBook
run: cargo install mdbook mdbook-mermaid mdbook-admonish

- name: Build book
working-directory: ./book
run: mdbook build

- name: Deploy
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/book
57 changes: 30 additions & 27 deletions bin/cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,32 +49,26 @@ pub async fn config(args: ConfigArgs) -> anyhow::Result<()> {
let portal_address = system_config.optimismPortal().stall().await.addr_;
let dgf_address = system_config.disputeGameFactory().stall().await.addr_;

// report genesis time
println!("GENESIS_TIMESTAMP: {}", config.genesis.l2_time);
// report inter-block time
println!("BLOCK_TIME: {}", config.block_time);
// report rollup config hash
let rollup_config_hash = config_hash(&config).expect("Configuration hash derivation error");
// report risc0 version
println!("RISC0_VERSION: {}", risc0_zkvm::get_version()?);
// report fpvm image id
println!(
"ROLLUP_CONFIG_HASH: 0x{}",
hex::encode_upper(rollup_config_hash)
"FPVM_IMAGE_ID: 0x{}",
hex::encode_upper(Digest::new(KAILUA_FPVM_ID).as_bytes())
);
// report factory address
// Report expected Groth16 verifier parameters
println!(
"DISPUTE_GAME_FACTORY: 0x{}",
hex::encode_upper(dgf_address.as_slice())
"CONTROL_ROOT: 0x{}",
hex::encode_upper(CONTROL_ROOT.as_slice()),
);
// report portal address
println!(
"OPTIMISM_PORTAL: 0x{}",
hex::encode_upper(portal_address.as_slice())
"CONTROL_ID: 0x{}",
hex::encode_upper(BN254_CONTROL_ID.as_slice()),
);
// report game type
println!("KAILUA_GAME_TYPE: {}", KAILUA_GAME_TYPE);
// report fpvm image id
// Report expected Boundless verifier parameters
println!(
"FPVM_IMAGE_ID: 0x{}",
hex::encode_upper(Digest::new(KAILUA_FPVM_ID).as_bytes())
"SET_BUILDER_ID: 0x{}",
hex::encode_upper(SET_BUILDER_ID.as_slice())
);
// report verifier address
let verifier_address = match config.l1_chain_id {
Expand Down Expand Up @@ -106,20 +100,29 @@ pub async fn config(args: ConfigArgs) -> anyhow::Result<()> {
.map(|a| hex::encode_upper(a.as_slice()))
.unwrap_or_default()
);
// Report expected Boundless verifier parameters

// report genesis time
println!("GENESIS_TIMESTAMP: {}", config.genesis.l2_time);
// report inter-block time
println!("BLOCK_TIME: {}", config.block_time);
// report rollup config hash
let rollup_config_hash = config_hash(&config).expect("Configuration hash derivation error");
println!(
"SET_BUILDER_ID: 0x{}",
hex::encode_upper(SET_BUILDER_ID.as_slice())
"ROLLUP_CONFIG_HASH: 0x{}",
hex::encode_upper(rollup_config_hash)
);
// Report expected Groth16 verifier parameters
// report factory address
println!(
"CONTROL_ROOT: 0x{}",
hex::encode_upper(CONTROL_ROOT.as_slice()),
"DISPUTE_GAME_FACTORY: 0x{}",
hex::encode_upper(dgf_address.as_slice())
);
// report portal address
println!(
"CONTROL_ID: 0x{}",
hex::encode_upper(BN254_CONTROL_ID.as_slice()),
"OPTIMISM_PORTAL: 0x{}",
hex::encode_upper(portal_address.as_slice())
);
// report game type
println!("KAILUA_GAME_TYPE: {}", KAILUA_GAME_TYPE);

Ok(())
}
4 changes: 4 additions & 0 deletions book/src/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ RISC Zero maintains a set of pre-deployed verifier contracts for its ZK proving
These contracts are regularly upgraded to support new releases of the prover, and also have a permissionless fail-safe
mechanism that anyone who can produce a proof-of-exploit can trigger to halt the verifier.

```admonish note
You must ensure that the chosen verifier contract supports your RISC Zero zkVM version.
```

You have the choice of either using the already deployed verifier for your parent chain, or deploying and maintaining
your own verifier contracts, as described in the later sections.

Expand Down
11 changes: 6 additions & 5 deletions book/src/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ kailua // Root project directory

## CLI

The CLI for Kailua is designed to support four main commands:
* `Upgrade`: Upgrades an existing rollup deployment to utilize Kailua for fault proving.
* `Propose`: Monitor a rollup for sequencing state and publish proposals on-chain (akin to op-proposer).
* `Validate`: Monitor a rollup for disputes and publish the necessary FPVM proofs for resolution.
* `Fault`: Submit garbage proposals to test fault proving.
The CLI for Kailua is designed to support five main commands:
* `config`: Outputs configuration information required for migration.
* `fast-track`: Automatically upgrades an existing rollup deployment to utilize Kailua for fault proving.
* `propose`: Monitor a rollup for sequencing state and publish proposals on-chain (akin to op-proposer).
* `validate`: Monitor a rollup for disputes and publish the necessary FPVM proofs for resolution.
* `fault`: Submit garbage proposals to test fault proving.

## Contracts

Expand Down
11 changes: 6 additions & 5 deletions book/src/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,18 @@ kailua-cli config --op-node-url [YOUR_OP_NODE_URL] --op-geth-url [YOUR_OP_GETH_U

Running the above command against the respective op-sepolia endpoints should produce the following output:
```
RISC0_VERSION: 1.2.0
FPVM_IMAGE_ID: 0xA1FC2FD8A2EEE54047591648D90D7692D2E2EA9E5F1160CF7575AF2B03E16BBE
CONTROL_ROOT: 0x8CDAD9242664BE3112ABA377C5425A4DF735EB1C6966472B561D2855932C0469
CONTROL_ID: 0x04446E66D300EB7FB45C9726BB53C793DDA407A62E9601618BB43C5C14657AC0
SET_BUILDER_ID: 0x744CCA56CDE6933DEA72752C78B4A6CA894ED620E8AF6437AB05FAD53BCEC40A
RISC_ZERO_VERIFIER: 0x925D8331DDC0A1F0D96E68CF073DFE1D92B69187
GENESIS_TIMESTAMP: 1691802540
BLOCK_TIME: 2
ROLLUP_CONFIG_HASH: 0xF9CDE5599A197A7615D7207E55188D9D1709073A67A8F2D53EB9184400D4FBCD
DISPUTE_GAME_FACTORY: 0x05F9613ADB30026FFD634F38E5C4DFD30A197FA1
OPTIMISM_PORTAL: 0x16FC5058F25648194471939DF75CF27A2FDC48BC
KAILUA_GAME_TYPE: 1337
FPVM_IMAGE_ID: 0xA1FC2FD8A2EEE54047591648D90D7692D2E2EA9E5F1160CF7575AF2B03E16BBE
RISC_ZERO_VERIFIER: 0x925D8331DDC0A1F0D96E68CF073DFE1D92B69187
SET_BUILDER_ID: 0x744CCA56CDE6933DEA72752C78B4A6CA894ED620E8AF6437AB05FAD53BCEC40A
CONTROL_ROOT: 0x8CDAD9242664BE3112ABA377C5425A4DF735EB1C6966472B561D2855932C0469
CONTROL_ID: 0x04446E66D300EB7FB45C9726BB53C793DDA407A62E9601618BB43C5C14657AC0
```

```admonish note
Expand Down
5 changes: 5 additions & 0 deletions book/src/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
The Kailua validator watches your rollup for sequencing proposals that contradict each other and generates a ZK fault
proof to settle the dispute between them.

```admonish note
The Kailua validator agent requires access to an archive `op-geth` rollup node to retrieve data during proof generation.
Node software other than `geth` is not as reliable.
```

## Usage

Starting the Kailua validator is straightforward:
Expand Down

0 comments on commit e74d15f

Please sign in to comment.