diff --git a/README.md b/README.md index 31f770d..faa4f3c 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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) @@ -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. diff --git a/x/cada/integration_docs/README.md b/x/cada/integration_docs/README.md index cd60b83..4288bad 100644 --- a/x/cada/integration_docs/README.md +++ b/x/cada/integration_docs/README.md @@ -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 @@ -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: @@ -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. - diff --git a/x/cada/integration_docs/integration.md b/x/cada/integration_docs/integration.md index 5064179..3b7d828 100644 --- a/x/cada/integration_docs/integration.md +++ b/x/cada/integration_docs/integration.md @@ -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" ) ``` @@ -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" ) ``` diff --git a/x/cada/integration_docs/spawn.md b/x/cada/integration_docs/spawn.md index 1cda805..a88181e 100644 --- a/x/cada/integration_docs/spawn.md +++ b/x/cada/integration_docs/spawn.md @@ -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" ) ``` @@ -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" ) ``` diff --git a/x/cada/specs/02_state.md b/x/cada/specs/02_state.md index 4b750fb..f80293b 100644 --- a/x/cada/specs/02_state.md +++ b/x/cada/specs/02_state.md @@ -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: diff --git a/x/cada/specs/04_client.md b/x/cada/specs/04_client.md index f5a188e..e2e9f65 100644 --- a/x/cada/specs/04_client.md +++ b/x/cada/specs/04_client.md @@ -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. @@ -33,4 +32,4 @@ range: from: "1" to: "5" status: IN_VOTING -``` \ No newline at end of file +``` diff --git a/x/cada/specs/06_preblocker.md b/x/cada/specs/06_preblocker.md index 1870b1a..2ddb04e 100644 --- a/x/cada/specs/06_preblocker.md +++ b/x/cada/specs/06_preblocker.md @@ -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 @@ -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. @@ -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) } -``` \ No newline at end of file +``` diff --git a/x/cada/specs/README.md b/x/cada/specs/README.md index cf72f99..9ee4789 100644 --- a/x/cada/specs/README.md +++ b/x/cada/specs/README.md @@ -2,6 +2,7 @@ # `x/cada` ## Table of Conetents + - [Abstract](#abstract) - [Concepts](01_concepts.md#concepts) - [State](02_state.md#state) @@ -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