Skip to content

Commit

Permalink
editorial nits
Browse files Browse the repository at this point in the history
  • Loading branch information
hashcashier committed Dec 20, 2024
1 parent e74d15f commit 406a28f
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 35 deletions.
18 changes: 9 additions & 9 deletions book/src/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ computed by RISC Zero's Bonsai service in under an hour.
Assuming an honest majority operates the parent chain of the rollup, on-chain denial-of-service attacks can still
happen if a wealthy party raises the on-chain gas costs beyond what honest participants in the fault proof protocol can
afford.
This block congestion attack can effectively censor disputes on faulty sequencing from being made on-chain, threatening
the safety of the rollup.
This block congestion attack can effectively censor disputes against faulty sequencing proposals from being made
on-chain, threatening the safety of the rollup.

```admonish check
Kailua incorporates "Adaptive Dispute Cutoffs", which delays withdrawal finality to increase the opportunity to
dispute faulty sequencing based on the level of on-chain congestion. This guarantees that if faults cost more to
dispute than a predetermined amount, honest parties will be granted more time until gas costs return to normal.
Kailua's design incorporates "Adaptive Dispute Cutoffs", which delays withdrawal finality to increase the dispute
opportunity based on the level of on-chain congestion. This guarantees that if faults cost more to dispute than a
predetermined amount, honest parties will be granted more time until gas costs subside.
```

### Sybil Identities

Whale attackers can overwhelm honest parties in a dispute resolution mechanism by using multiple identities to flood the
system with disputes.
**Whale** attackers can overwhelm honest parties in a dispute resolution mechanism by using multiple identities to flood
the system with disputes.
In fault proving schemes where a defender has to issue a timely response on-chain to every dispute, the costs borne
by the defender to continuously participate in all open disputes until they are resolved can be overwhelming, leading
to some faults slipping through.
Expand All @@ -58,8 +58,8 @@ generate.

### Resource Exhaustion

In addition to transaction fee expenditure, some protocols additionally require collateral to be staked for every move
made in the system, while others require proofs to be generated in a timely manner.
Some fault proof protocols require additional collateral to be staked for every move made in the system, while others
require proofs to be generated in a timely manner.
These two requirements cause some other systems to be vulnerable to resource exhaustion, where the resource can be
the collateral or the proving power required for an honest party to issue a timely response, even if it can afford the
transaction fees.
Expand Down
21 changes: 11 additions & 10 deletions book/src/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ to ensure the liveness of your chain.
```admonish example
Consider Optimism Mainnnet as an example, which has a block time of 2 seconds.
To keep its current average sequencing frequency of ~55 minutes, it only needs to publish ~1650 commitments per proposal.
To maximize its usage of this single blob, OP Mainnet can relax its proposal rate to once per 2 hours and 15 minutes.
To maximize the utilization of the extra blob published when proposing, OP Mainnet can relax its proposal rate to once
per 2 hours and 15 minutes.
```

## Proposal Time Gap
Expand All @@ -44,11 +45,13 @@ proposals from being made eagerly before the parent chain data supporting that s
This mechanism comes in the form of a forced delay between the timestamp of the L2 block being proposed, and the current
timestamp on the parent chain (ethereum).

At the time of writing, Ethereum finalized a block in [approximately 15 minutes](https://ethereum.org/en/roadmap/single-slot-finality/#:~:text=It%20takes%20about%2015%20minutes%20for%20an%20Ethereum%20block%20to%20finalize).
Consequently, we recommend you set this parameter to `15 × 60 = 900` seconds.
At the time of writing, Ethereum finalizes each block in [approximately 15 minutes](https://ethereum.org/en/roadmap/single-slot-finality/#:~:text=It%20takes%20about%2015%20minutes%20for%20an%20Ethereum%20block%20to%20finalize).
Consequently, we recommend you set this parameter to `15 × 60 = 900` seconds to match.

```admonish note
While the Kailua proposer agent won't publish a sequencing proposal until it is considered safe, the Kailua contracts
allow you to enforce this requirement so that even an eager (potentially dishonest) proposer cannot have a head start!
```

## Collateral Amount

Expand All @@ -68,18 +71,15 @@ days if it is undisputed.
This means, at an average hourly rate of proposing, the proposer has `84 * 0.08 = 6.72` ETH (\~$3700 USD) on average
locked up as collateral in the best case where no disputes take place.
Using Kailua 0.08 ETH would be sufficient as the total collateral locked up by the proposer, even under the same finality
Using Kailua, 0.08 ETH would be sufficient as the total collateral locked up by the proposer, even under the same finality
delay.
This would cover the worst-case proving cost in case of dispute, and leave a $200 tip as well.
This would cover the worst-case proving cost in case of dispute, and, discounting transaction costs, leave a $200 tip.
```

## Challenge Timeout

```admonish note
Kailua does not yet implement adaptive dispute periods.
```

For simplicity and ease of mind, you can keep your current sequencing proposal dispute period.
The current implementation of Kailua does not yet have adaptive dispute periods based on congestion.
Consequently, you should keep your existing challenge timeout period.

## Verifier Contract
RISC Zero maintains a set of pre-deployed verifier contracts for its ZK proving system.
Expand All @@ -88,6 +88,7 @@ mechanism that anyone who can produce a proof-of-exploit can trigger to halt the

```admonish note
You must ensure that the chosen verifier contract supports your RISC Zero zkVM version.
Once a new zkVM version is released, there can be a delay in adding it to the router.
```

You have the choice of either using the already deployed verifier for your parent chain, or deploying and maintaining
Expand Down
8 changes: 4 additions & 4 deletions book/src/quickstart.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Quickstart

Kailua enables rollup operators to add a new fault proof system to their rollup using the `DisputeGameFactory`.
Kailua's contracts rely on RISC-Zero zkVM proofs to finalize/dismiss output proposals, and are compatible with Optimism's Bedrock contracts `v1.4.0` and above.
Kailua enables rollup operators to add a new fault proof system to their rollup via the Optimism `DisputeGameFactory`
contract.
Kailua's contracts rely on RISC-Zero zkVM proofs to finalize/dismiss output proposals, and are compatible with
Optimism's Bedrock contracts `v1.4.0` and above.

The `KailuaTournament` contract optimistically allows outputs to be accepted after a timeout if no fraud proof is published against it,
or if the output is challenged, waits for a proof to be submitted to decide whether to dismiss the output.

## Prerequisites
1. [rust](https://www.rust-lang.org/tools/install)
Expand Down
22 changes: 11 additions & 11 deletions book/src/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Before you can start migrating your rollup, you'll need to build and install Kai
commands from the root project directory:

```admonish tip
Do not run these commands in parallel.
Each of these commands will take time to build the FPVM program in release mode.
If you do, GitHub may throttle you, leading to a docker build error.
Do not run these `install` commands in parallel.
Each binary installation will take time to reproducibly build the FPVM program in release mode.
If you install them in parallel, GitHub may throttle you, leading to a docker build error.
```

### CLI Binary
Expand All @@ -33,8 +33,8 @@ cargo install kailua-host --path bin/host

## Configuration

Once your installation is successful, you should be able to run the following command to fetch the configuration
parameters of your rollup instance:
Once your installation is successful, you should be able to run the following command to fetch the Kailua configuration
parameters for your rollup instance:

```shell
kailua-cli config --op-node-url [YOUR_OP_NODE_URL] --op-geth-url [YOUR_OP_GETH_URL] --eth-rpc-url [YOUR_ETH_RPC_URL]
Expand All @@ -56,6 +56,11 @@ OPTIMISM_PORTAL: 0x16FC5058F25648194471939DF75CF27A2FDC48BC
KAILUA_GAME_TYPE: 1337
```

```admonish warning
Make sure that your `FPVM_IMAGE_ID` matches the value above.
This value determines the exact program used to prove faults.
```

```admonish note
If your `RISC_ZERO_VERIFIER` value is blank, this means that your rollup might be deployed on a base layer that does
not have a deployed RISC Zero zkVM verifier contract.
Expand All @@ -64,9 +69,4 @@ Always revise the RISC Zero [documentation](https://dev.risczero.com/api/blockch
to double-check verifier availability.
```

```admonish warning
Make sure that your `FPVM_IMAGE_ID` matches the value above.
This value determines the exact program used to prove faults.
```

Once you have these values you'll need to save them for later use during contract deployment.
Once you have these values you'll need to save them for later use during migration.
4 changes: 4 additions & 0 deletions book/src/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ The Kailua CLI has a `fast-track` command for automating the L1 transactions req
If the command does not yet support your configuration, you'll need to follow the manual steps in the next sub-sections.
```

```admonish hint
You might find it useful to rehearse migration using a local devnet first.
```

## Fast-track Migration

```admonish info
Expand Down
2 changes: 1 addition & 1 deletion book/src/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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.
Node software other than `op-geth` is not as reliable for the necessary `debug` namespace rpc calls.
```

## Usage
Expand Down

0 comments on commit 406a28f

Please sign in to comment.