Skip to content

Commit

Permalink
adr-update: Update ADR 009 (cosmos#1161)
Browse files Browse the repository at this point in the history
<!--
Please read and fill out this form before submitting your PR.

Please make sure you have reviewed our contributors guide before
submitting your
first PR.
-->

## Overview
Closes: cosmos#989 
<!-- 
Please provide an explanation of the PR, including the appropriate
context,
background, goal, and rationale. If there is an issue with this
information,
please provide a tl;dr and link the issue. 
-->

## Checklist

<!-- 
Please complete the checklist to ensure that the PR is ready to be
reviewed.

IMPORTANT:
PRs should be left in Draft until the below checklist is completed.
-->

- [x] New and updated code has appropriate documentation
- [ ] New and updated code has new and/or updated testing
- [x] Required CI checks are passing
- [ ] Visual proof for any user facing features like CLI or
documentation updates
- [x] Linked issues closed with keywords
  • Loading branch information
Manav-Aggarwal authored Sep 14, 2023
1 parent 63f6f23 commit 1d05cbe
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 26 deletions.
32 changes: 27 additions & 5 deletions docs/lazy-adr/adr-009-state-fraud-proofs.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,30 @@ List of caveats and required modifications to push State Fraud Proofs towards co
- Support for multiple sequencers, in which case, fraud proof detection works the same as described above.
- Support more ABCI-compatible State Machines, in addition to the Cosmos SDK state machine.

![State Fraud Proofs](./figures/state_fraud_proofs.png)
```mermaid
sequenceDiagram
title State Fraud Proofs
participant User
participant Block Producer
participant DA Layer
participant Full Node
participant Light Client
User->>Block Producer: Send Tx
Block Producer->>Block Producer: Generate Block
Block Producer->>Full Node: Gossip Header
Full Node->>Full Node: Verify Header
Full Node->>Light Client: Gossip Header
Block Producer->>Full Node: Gossip Block
Block Producer->>DA Layer: Publish Block
DA Layer->>Full Node: Retrieve Block
Full Node->>Full Node: Verify Block
Full Node->>Full Node: Generate Fraud Proof
Full Node->>Light Client: Gossip Fraud Proof
Light Client->>Light Client: Verify Fraud Proof
```

## Alternative Approaches

Expand All @@ -49,7 +72,6 @@ Rollkit blocks contain a field called `Intermediate State Roots` in block data:
type Data struct {
Txs Txs
IntermediateStateRoots IntermediateStateRoots
Evidence EvidenceData
}
```

Expand Down Expand Up @@ -125,7 +147,7 @@ message FraudProof {
map<string, StateWitness> state_witness = 4;
// Fraudulent state transition has to be one of these
// Only one have of these three can be non-nil
// Only one of these three can be non-nil
RequestBeginBlock fraudulent_begin_block = 5;
RequestDeliverTx fraudulent_deliver_tx = 6;
RequestEndBlock fraudulent_end_block = 7;
Expand Down Expand Up @@ -180,7 +202,7 @@ There are four stages of verification that must occur for a Fraud Proof. The fir

#### **Stage One**

Verify that both the `appHash` (ISR) and the fraudulent state transition in the `FraudProof` exist as part of a block published on the DA layer within a specified fraud proof window. This involves verifying that share containing the block is posted on Celestia via a Blob Inclusion Proof.
Verify that both the `appHash` (ISR) and the fraudulent state transition in the `FraudProof` exist as part of a block published on the DA layer within a specified fraud proof window. This involves verifying that the blob corresponding to the block is posted on the DA layer via a Blob Inclusion Proof and verifying the share(s) containing the fraudulent state transition and `appHash` were part of that blob via Share Inclusion Proof(s).

#### **Stage Two**

Expand Down Expand Up @@ -249,7 +271,7 @@ Proposed
A prototype implementation of the above design is available in the following working branches:

- [Rollkit](https://github.com/rollkit/rollkit/releases/tag/v0.6.0): Contains fraud proof detection and gossiping logic. As fraud proofs are currently a work in progress, this logic can be toggled using a flag `--rollkit.experimental_insecure_fraud_proofs`. By default, this flag is set to `false`.
- [Cosmos-SDK](https://github.com/rollkit/cosmos-sdk/tree/manav/fraudproof_iavl_prototype): Implements the new ABCI methods described.
- [Cosmos-SDK](https://github.com/rollkit/cosmos-sdk-old/tree/manav/fraudproof_iavl_prototype): Implements the new ABCI methods described.
- [Tendermint](https://github.com/rollkit/tendermint/tree/abci_fraud_proofs): Contains modifications to the ABCI interface described.
- [IAVL](https://github.com/rollkit/iavl/tree/deepsubtrees_0.19.x): Adds support for Deep Subtrees and tracing.

Expand Down
Binary file removed docs/lazy-adr/figures/state_fraud_proofs.png
Binary file not shown.
21 changes: 0 additions & 21 deletions docs/lazy-adr/sequence diagrams/State Fraud Proofs.txt

This file was deleted.

0 comments on commit 1d05cbe

Please sign in to comment.