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

Update readme #59

Merged
merged 2 commits into from
Oct 1, 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
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Validators: Vote to confirm the data availability, updating the blob status to "
These are main components in the workflow:

## 1. CADA

The core functionality of the **CADA** module is integrated with and operates on the Cosmos blockchain.

In the CADA module:
Expand Down Expand Up @@ -68,7 +69,7 @@ The **Cosmos Provider** is responsible for fetching block data via RPC so that t
- At each block interval, a request is sent from the `PreBlocker` ABCI method to the Keeper, specifying the range of block heights that are ready to be posted to the `Avail` DA network.
- The range of block heights should be from `provenHeight + 1` to `min(provenHeight + MaxBlocksLimitForBlob, CurrentBlockHeight)`.

- If the status of the previous blocks is either `READY` or `FAILURE`, the status can be updated to `PENDING`.
- If the status of the previous blocks is either `SUCCESS` or `FAILURE`, the status can be updated to `PENDING`.

```
range = [fromBlock, toBlock] // (fromBlock < toBlock < CurrentBlock)
Expand Down Expand Up @@ -96,8 +97,8 @@ The **Cosmos Provider** is responsible for fetching block data via RPC so that t
- At block height `VotingEndBlock`, all the votes from `vote_extensions` will be collected and aggregated. If the collective `voting power is > 66%`, the status will be updated

```
status = READY // success and ready for next blocks
provenHeight = Range End
status = SUCCESS // success and ready for next blocks
provenHeight = Range EndHeight // End Height from the given block range

```
- In case of failure at any stage, the whole flow will be repeated.
Expand Down
4 changes: 2 additions & 2 deletions x/cada/integration_docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Export the ValidatorKey and KeyringBackend by running the following commands:
export VALIDATOR_KEY="alice"
export KEYRING_BACKEND="os"
```

Ensure that these values are correctly configured before proceeding with further steps.

## Integration with SDK-Based Applications
Expand All @@ -37,7 +38,7 @@ For a detailed walkthrough,refer to this [integration guide](./integration.md).

For detailed instructions on integrating the CADA module into code generated by `spawn`, please refer to the [integration guide](./spawn.md).

## To run CADA on local
## To run CADA on local

To run the CADA module locally, follow these steps:

Expand All @@ -54,4 +55,3 @@ cada start
```

These steps will get the chain up and running in your local environment and post the data to avail light client. Be sure to run the avail light node and modify the configuration as mentioned above.

11 changes: 5 additions & 6 deletions x/cada/integration_docs/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ import (

// ......

cadakeeper "github.com/vitwit/avail-da-module/keeper"
cadamodule "github.com/vitwit/avail-da-module/module"
cadakeeper "github.com/vitwit/avail-da-module/x/cada/keeper"
cadamodule "github.com/vitwit/avail-da-module/x/cada/module"
cadarelayer "github.com/vitwit/avail-da-module/relayer"
"github.com/vitwit/avail-da-module/relayer/avail"
httpclient "github.com/vitwit/avail-da-module/relayer/http"
cadatypes "github.com/vitwit/avail-da-module/types"
cadatypes "github.com/vitwit/avail-da-module/x/cada/types"
)

```
Expand Down Expand Up @@ -203,8 +202,8 @@ Within the imported packages, add the cada module
import (
// ...
"github.com/vitwit/avail-da-module/simapp/app"
cadacli "github.com/vitwit/avail-da-module/client/cli"
cadatypes "github.com/vitwit/avail-da-module/types"
cadacli "github.com/vitwit/avail-da-module/x/cada/client/cli"
cadatypes "github.com/vitwit/avail-da-module/x/cada/types"
)
```

Expand Down
11 changes: 5 additions & 6 deletions x/cada/integration_docs/spawn.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ import (

// ......

cadakeeper "github.com/vitwit/avail-da-module/keeper"
cadamodule "github.com/vitwit/avail-da-module/module"
cadakeeper "github.com/vitwit/avail-da-module/x/cada/keeper"
cadamodule "github.com/vitwit/avail-da-module/x/cada/module"
cadarelayer "github.com/vitwit/avail-da-module/relayer"
"github.com/vitwit/avail-da-module/relayer/avail"
httpclient "github.com/vitwit/avail-da-module/relayer/http"
cadatypes "github.com/vitwit/avail-da-module/types"
cadatypes "github.com/vitwit/avail-da-module/x/cada/types"
)

```
Expand Down Expand Up @@ -226,8 +225,8 @@ Within the imported packages, add the cada module
import (
// ...
"github.com/vitwit/avail-da-module/simapp/app"
cadacli "github.com/vitwit/avail-da-module/client/cli"
cadatypes "github.com/vitwit/avail-da-module/types"
cadacli "github.com/vitwit/avail-da-module/x/cada/client/cli"
cadatypes "github.com/vitwit/avail-da-module/x/cada/types"
)
```

Expand Down
13 changes: 8 additions & 5 deletions x/cada/specs/02_state.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@ It is stored in the state as follows:

## Blocks Submission Status

Indicates the status of the current blocks submission (`READY`, `PENDING`, `IN_VOTING`, `FAILURE`).
Indicates the status of the current blocks submission (`SUCCESS`, `PENDING`, `IN_VOTING`, `FAILURE`).

** PENDING ** : Blocks data submission has been initiated and is awaiting confirmation
** IN_VOTING ** : Blocks data has been posted to `Avail` and is now pending validators' verification
** FAILURE ** : Blocks data submission or verification has failed and needs to be resubmitted
** READY ** : blocks data submission is successful; the next set of blocks is ready to be posted
**PENDING** : Blocks data submission has been initiated and is awaiting confirmation

**IN_VOTING** : Blocks data has been posted to `Avail` and is now pending validators' verification

**FAILURE** : Blocks data submission or verification has failed and needs to be resubmitted

**SUCCESS** : blocks data submission is successful; the next set of blocks is ready to be posted

It is stored in the state as follows:

Expand Down
7 changes: 3 additions & 4 deletions x/cada/specs/04_client.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ A user can query and interact with the `cada` module using the CLI.

The `query` commands allows users to query `cada` state.


```sh
simd query cada --help
$ simd query cada --help
```

#### Query the Status
### Query the Status

The `get-da-status` command enables users to retrieve comprehensive information, including the range of blocks currently being posted to Avail, the current status, the last proven height, the Avail height where the data is made available, and the voting block height by which voting should conclude.

Expand All @@ -33,4 +32,4 @@ range:
from: "1"
to: "5"
status: IN_VOTING
```
```
6 changes: 3 additions & 3 deletions x/cada/specs/06_preblocker.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The `PreBlocker` method is responsible for two primary tasks: processing votes f

When the current block height matches the voting end height and the status is `IN_VOTING`, the method processes the voting results and updates the state accordingly.

- **Success Condition:** If the collective voting power exceeds 66%, the status is updated to `READY`, and the `provenHeight` is set to the end of the current block range.
- **Success Condition:** If the collective voting power exceeds 66%, the status is updated to `SUCCESS`, and the `provenHeight` is set to the end of the current block range.
- **Failure Condition:** If the voting power is 66% or less, the status is updated to `FAILURE`.

```go
Expand All @@ -40,7 +40,7 @@ if len(req.Txs) > 0 && currentHeight == int64(votingEndHeight) && blobStatus ==

### 2. Initiate Block Data Availability (DA) Submission

If the current block height aligns with a voting interval and the status is either `READY` or `FAILURE`, the method updates the block range and sets the status to `PENDING` for the next round of blocks data submission.
If the current block height aligns with a voting interval and the status is either `SUCCESS` or `FAILURE`, the method updates the block range and sets the status to `PENDING` for the next round of blocks data submission.

- **Range Calculation:** The pending block range to be submitted is calculated based on the last proven height and the current block height.
- **Status Update:** The status is set to `PENDING` to mark the start of the data submission process.
Expand Down Expand Up @@ -80,4 +80,4 @@ for i := fromHeight; i < endHeight; i++ {
if bytes.Equal(req.ProposerAddress, k.proposerAddress) {
k.relayer.PostBlocks(ctx, blocksToSubmit, k.cdc, req.ProposerAddress)
}
```
```
3 changes: 1 addition & 2 deletions x/cada/specs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# `x/cada`

## Table of Conetents

- [Abstract](#abstract)
- [Concepts](01_concepts.md#concepts)
- [State](02_state.md#state)
Expand All @@ -10,8 +11,6 @@
- [PrepareProposal Abci method](05_prepare_proposal.md#proofofblobproposalhandler-prepareproposal-method)
- [PreBlocker Abci method](06_preblocker.md#proofofblobproposalhandler-preblocker-method)
- [Vote Extensions](07_vote_extension.md#vote-extensions)
- [Architecture](#architecture)


## Abstract

Expand Down
Loading