Skip to content

Commit 5ed98ec

Browse files
docs: delete old files and resync (#284)
* remove accounts, counter, and validate module docs * synced
1 parent d51dbf3 commit 5ed98ec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+788
-1332
lines changed

Diff for: docs/build/abci/00-introduction.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## What is ABCI?
44

5-
ABC, Application Blockchain Interface is the interface between CometBFT and the application, more information about ABCI can be found [here](https://docs.cometbft.com/v0.38/spec/abci/). Within the release of ABCI 2.0 for the 0.38 CometBFT release there were additional methods introduced.
5+
ABCI, Application Blockchain Interface is the interface between CometBFT and the application. More information about ABCI can be found [here](https://docs.cometbft.com/v0.38/spec/abci/). CometBFT version 0.38 included a new version of ABCI (called ABCI 2.0) which added several new methods.
66

7-
The 5 methods introduced during ABCI 2.0 are:
7+
The 5 methods introduced in ABCI 2.0 are:
88

99
* `PrepareProposal`
1010
* `ProcessProposal`
@@ -17,11 +17,11 @@ The 5 methods introduced during ABCI 2.0 are:
1717

1818
## PrepareProposal
1919

20-
Based on their voting power, CometBFT chooses a block proposer and calls `PrepareProposal` on the block proposer's application (Cosmos SDK). The selected block proposer is responsible for collecting outstanding transactions from the mempool, adhering to the application's specifications. The application can enforce custom transaction ordering and incorporate additional transactions, potentially generated from vote extensions in the previous block.
20+
Based on validator voting power, CometBFT chooses a block proposer and calls `PrepareProposal` on the block proposer's application (Cosmos SDK). The selected block proposer is responsible for collecting outstanding transactions from the mempool, adhering to the application's specifications. The application can enforce custom transaction ordering and incorporate additional transactions, potentially generated from vote extensions in the previous block.
2121

22-
To perform this manipulation on the application side, a custom handler must be implemented. By default, the Cosmos SDK provides `PrepareProposalHandler`, used in conjunction with an application specific mempool. A custom handler can be written by application developer, if a noop handler provided, all transactions are considered valid. Please see [this](https://github.com/fatal-fruit/abci-workshop) tutorial for more information on custom handlers.
22+
To perform this manipulation on the application side, a custom handler must be implemented. By default, the Cosmos SDK provides `PrepareProposalHandler`, used in conjunction with an application specific mempool. A custom handler can be written by application developer, if a noop handler provided, all transactions are considered valid.
2323

24-
Please note that vote extensions will only be available on the following height in which vote extensions are enabled. More information about vote extensions can be found [here](https://docs.cosmos.network/main/build/abci/03-vote-extensions.md).
24+
Please note that vote extensions will only be available on the following height in which vote extensions are enabled. More information about vote extensions can be found [here](https://docs.cosmos.network/main/build/abci/vote-extensions).
2525

2626
After creating the proposal, the proposer returns it to CometBFT.
2727

@@ -48,4 +48,4 @@ Additionally, applications must keep the vote extension data concise as it can d
4848

4949
## FinalizeBlock
5050

51-
`FinalizeBlock` is then called and is responsible for updating the state of the blockchain and making the block available to users
51+
`FinalizeBlock` is then called and is responsible for updating the state of the blockchain and making the block available to users.

Diff for: docs/build/abci/01-prepare-proposal.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ it would like the block constructed.
2424

2525
The Cosmos SDK defines the `DefaultProposalHandler` type, which provides applications with
2626
`PrepareProposal` and `ProcessProposal` handlers. If you decide to implement your
27-
own `PrepareProposal` handler, you must be sure to ensure that the transactions
27+
own `PrepareProposal` handler, you must ensure that the transactions
2828
selected DO NOT exceed the maximum block gas (if set) and the maximum bytes provided
2929
by `req.MaxBytes`.
3030

3131
```go reference
32-
https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/abci_utils.go
32+
https://github.com/cosmos/cosmos-sdk/blob/v0.53.0-rc.2/baseapp/abci_utils.go
3333
```
3434

3535
This default implementation can be overridden by the application developer in
36-
favor of a custom implementation in [`app.go`](../building-apps/01-app-go-v2.md):
36+
favor of a custom implementation in [`app_di.go`](../building-apps/01-app-go-v2.md):
3737

3838
```go
3939
prepareOpt := func(app *baseapp.BaseApp) {
40-
abciPropHandler := baseapp.NewDefaultProposalHandler(mempool, app)
41-
app.SetPrepareProposal(abciPropHandler.PrepareProposalHandler())
40+
abciPropHandler := baseapp.NewDefaultProposalHandler(mempool, app)
41+
app.SetPrepareProposal(abciPropHandler.PrepareProposalHandler())
4242
}
4343

4444
baseAppOptions = append(baseAppOptions, prepareOpt)

Diff for: docs/build/abci/02-process-proposal.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
# Process Proposal
22

33
`ProcessProposal` handles the validation of a proposal from `PrepareProposal`,
4-
which also includes a block header. Meaning, that after a block has been proposed
5-
the other validators have the right to vote on a block. The validator in the
4+
which also includes a block header. After a block has been proposed,
5+
the other validators have the right to accept or reject that block. The validator in the
66
default implementation of `PrepareProposal` runs basic validity checks on each
77
transaction.
88

9-
Note, `ProcessProposal` MAY NOT be non-deterministic, i.e. it must be deterministic.
9+
Note, `ProcessProposal` MUST be deterministic. Non-deterministic behaviors will cause apphash mismatches.
1010
This means if `ProcessProposal` panics or fails and we reject, all honest validator
11-
processes will prevote nil and the CometBFT round will proceed again until a valid
12-
proposal is proposed.
11+
processes should reject (i.e., prevote nil). If so, CometBFT will start a new round with a new block proposal and the same cycle will happen with `PrepareProposal`
12+
and `ProcessProposal` for the new proposal.
1313

1414
Here is the implementation of the default implementation:
1515

1616
```go reference
17-
https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/abci_utils.go#L153-L159
17+
https://github.com/cosmos/cosmos-sdk/blob/v0.53.0-rc.2/baseapp/abci_utils.go#L219-L226
1818
```
1919

20-
Like `PrepareProposal` this implementation is the default and can be modified by
21-
the application developer in [`app.go`](../building-apps/01-app-go-v2.md). If you decide to implement
22-
your own `ProcessProposal` handler, you must be sure to ensure that the transactions
20+
Like `PrepareProposal`, this implementation is the default and can be modified by
21+
the application developer in [`app_di.go`](../building-apps/01-app-go-v2.md). If you decide to implement
22+
your own `ProcessProposal` handler, you must ensure that the transactions
2323
provided in the proposal DO NOT exceed the maximum block gas and `maxtxbytes` (if set).
2424

2525
```go
2626
processOpt := func(app *baseapp.BaseApp) {
27-
abciPropHandler := baseapp.NewDefaultProposalHandler(mempool, app)
28-
app.SetProcessProposal(abciPropHandler.ProcessProposalHandler())
27+
abciPropHandler := baseapp.NewDefaultProposalHandler(mempool, app)
28+
app.SetProcessProposal(abciPropHandler.ProcessProposalHandler())
2929
}
3030

3131
baseAppOptions = append(baseAppOptions, processOpt)

Diff for: docs/build/abci/03-vote-extensions.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ defined in ABCI++.
77

88
## Extend Vote
99

10-
ABCI++ allows an application to extend a pre-commit vote with arbitrary data. This
11-
process does NOT have to be deterministic, and the data returned can be unique to the
12-
validator process. The Cosmos SDK defines [`baseapp.ExtendVoteHandler`](https://github.com/cosmos/cosmos-sdk/blob/v0.50.1/types/abci.go#L26-L27):
10+
ABCI 2.0 (colloquially called ABCI++) allows an application to extend a pre-commit vote with arbitrary data. This process does NOT have to be deterministic, and the data returned can be unique to the
11+
validator process. The Cosmos SDK defines [`baseapp.ExtendVoteHandler`](https://github.com/cosmos/cosmos-sdk/blob/v0.53.0-rc.2/types/abci.go#L32):
1312

1413
```go
1514
type ExtendVoteHandler func(Context, *abci.RequestExtendVote) (*abci.ResponseExtendVote, error)
@@ -29,7 +28,7 @@ to consider the size of the vote extensions as they could increase latency in bl
2928
production. See [here](https://github.com/cometbft/cometbft/blob/v0.38.0-rc1/docs/qa/CometBFT-QA-38.md#vote-extensions-testbed)
3029
for more details.
3130

32-
Click [here](https://docs.cosmos.network/main/user/tutorials/vote-extensions) if you would like a walkthrough of how to implement vote extensions.
31+
Click [here](https://docs.cosmos.network/main/build/abci/vote-extensions) if you would like a walkthrough of how to implement vote extensions.
3332

3433

3534
## Verify Vote Extension

Diff for: docs/build/architecture/PROCESS.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# ADR Creation Process
22

33
1. Copy the `adr-template.md` file. Use the following filename pattern: `adr-next_number-title.md`
4-
2. Create a draft Pull Request if you want to get an early feedback.
5-
3. Make sure the context and a solution is clear and well documented.
6-
4. Add an entry to a list in the [README](./README.md) file.
4+
2. Create a draft Pull Request if you want to get early feedback.
5+
3. Make sure the context and solution are clear and well documented.
6+
4. Add an entry to the list in the [README](./README.md) file.
77
5. Create a Pull Request to propose a new ADR.
88

99
## What is an ADR?
1010

11-
An ADR is a document to document an implementation and design that may or may not have been discussed in an RFC. While an RFC is meant to replace synchoronus communication in a distributed environment, an ADR is meant to document an already made decision. An ADR wont come with much of a communication overhead because the discussion was recorded in an RFC or a synchronous discussion. If the consensus came from a synchoronus discussion then a short excerpt should be added to the ADR to explain the goals.
11+
An ADR is a document to document an implementation and design that may or may not have been discussed in an RFC. While an RFC is meant to replace synchronous communication in a distributed environment, an ADR is meant to document an already made decision. An ADR won't come with much of a communication overhead because the discussion was recorded in an RFC or a synchronous discussion. If the consensus came from a synchronous discussion, then a short excerpt should be added to the ADR to explain the goals.
1212

1313
## ADR life cycle
1414

1515
ADR creation is an **iterative** process. Instead of having a high amount of communication overhead, an ADR is used when there is already a decision made and implementation details need to be added. The ADR should document what the collective consensus for the specific issue is and how to solve it.
1616

17-
1. Every ADR should start with either an RFC or discussion where consensus has been met.
17+
1. Every ADR should start with either an RFC or a discussion where consensus has been met.
1818

1919
2. Once consensus is met, a GitHub Pull Request (PR) is created with a new document based on the `adr-template.md`.
2020

@@ -44,12 +44,12 @@ DRAFT -> PROPOSED -> LAST CALL yyyy-mm-dd -> ACCEPTED | REJECTED -> SUPERSEDED b
4444
ABANDONED
4545
```
4646

47-
* `DRAFT`: [optional] an ADR which is work in progress, not being ready for a general review. This is to present an early work and get an early feedback in a Draft Pull Request form.
48-
* `PROPOSED`: an ADR covering a full solution architecture and still in the review - project stakeholders haven't reached an agreed yet.
49-
* `LAST CALL <date for the last call>`: [optional] clear notify that we are close to accept updates. Changing a status to `LAST CALL` means that social consensus (of Cosmos SDK maintainers) has been reached and we still want to give it a time to let the community react or analyze.
47+
* `DRAFT`: [optional] an ADR which is a work in progress, not being ready for a general review. This is to present an early work and get early feedback in a Draft Pull Request form.
48+
* `PROPOSED`: an ADR covering a full solution architecture and still in the review - project stakeholders haven't reached an agreement yet.
49+
* `LAST CALL <date for the last call>`: [optional] Notify that we are close to accepting updates. Changing a status to `LAST CALL` means that social consensus (of Cosmos SDK maintainers) has been reached, and we still want to give it a time to let the community react or analyze.
5050
* `ACCEPTED`: ADR which will represent a currently implemented or to be implemented architecture design.
5151
* `REJECTED`: ADR can go from PROPOSED or ACCEPTED to rejected if the consensus among project stakeholders will decide so.
52-
* `SUPERSEEDED by ADR-xxx`: ADR which has been superseded by a new ADR.
52+
* `SUPERSEDED by ADR-xxx`: ADR which has been superseded by a new ADR.
5353
* `ABANDONED`: the ADR is no longer pursued by the original authors.
5454

5555
## Language used in ADR

Diff for: docs/build/architecture/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Read about the [PROCESS](./PROCESS.md).
3636

3737
### Use RFC 2119 Keywords
3838

39-
When writing ADRs, follow the same best practices for writing RFCs. When writing RFCs, key words are used to signify the requirements in the specification. These words are often capitalized: "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL. They are to be interpreted as described in [RFC 2119](https://datatracker.ietf.org/doc/html/rfc2119).
39+
When writing ADRs, follow the same best practices for writing RFCs. When writing RFCs, key words are used to signify the requirements in the specification. These words are often capitalized: "MUST," "MUST NOT," "REQUIRED," "SHALL," "SHALL NOT," "SHOULD," "SHOULD NOT," "RECOMMENDED," "MAY," and "OPTIONAL." They are to be interpreted as described in [RFC 2119](https://datatracker.ietf.org/doc/html/rfc2119).
4040

4141
## ADR Table of Contents
4242

Diff for: docs/build/architecture/adr-039-epoched-staking.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ Furthermore, it has become clearer over time that immediate execution of staking
3939

4040
### Slashing
4141

42-
There is a design consideration for whether to apply a slash immediately or at the end of an epoch. A slash event should apply to only members who are actually staked during the time of the infraction, namely during the epoch the slash event occured.
42+
There is a design consideration for whether to apply a slash immediately or at the end of an epoch. A slash event should apply to only members who are actually staked during the time of the infraction, namely during the epoch the slash event occurred.
4343

4444
Applying it immediately can be viewed as offering greater consensus layer security, at potential costs to the aforementioned usecases. The benefits of immediate slashing for consensus layer security can be all be obtained by executing the validator jailing immediately (thus removing it from the validator set), and delaying the actual slash change to the validator's weight until the epoch boundary. For the use cases mentioned above, workarounds can be integrated to avoid problems, as follows:
4545

4646
* For threshold based cryptography, this setting will have the threshold cryptography use the original epoch weights, while consensus has an update that lets it more rapidly benefit from additional security. If the threshold based cryptography blocks liveness of the chain, then we have effectively raised the liveness threshold of the remaining validators for the rest of the epoch. (Alternatively, jailed nodes could still contribute shares) This plan will fail in the extreme case that more than 1/3rd of the validators have been jailed within a single epoch. For such an extreme scenario, the chain already have its own custom incident response plan, and defining how to handle the threshold cryptography should be a part of that.
4747
* For light client efficiency, there can be a bit included in the header indicating an intra-epoch slash (ala https://github.com/tendermint/spec/issues/199).
4848
* For fairness of deterministic leader election, applying a slash or jailing within an epoch would break the guarantee we were seeking to provide. This then re-introduces a new (but significantly simpler) problem for trying to provide fairness guarantees. Namely, that validators can adversarially elect to remove themself from the set of proposers. From a security perspective, this could potentially be handled by two different mechanisms (or prove to still be too difficult to achieve). One is making a security statement acknowledging the ability for an adversary to force an ahead-of-time fixed threshold of users to drop out of the proposer set within an epoch. The second method would be to parameterize such that the cost of a slash within the epoch far outweights benefits due to being a proposer. However, this latter criterion is quite dubious, since being a proposer can have many advantageous side-effects in chains with complex state machines. (Namely, DeFi games such as Fomo3D)
49-
* For staking derivative design, there is no issue introduced. This does not increase the state size of staking records, since whether a slash has occured is fully queryable given the validator address.
49+
* For staking derivative design, there is no issue introduced. This does not increase the state size of staking records, since whether a slash has occurred is fully queryable given the validator address.
5050

5151
### Token lockup
5252

Diff for: docs/build/build.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar_position: 0
55
# Build
66

77
* [Building Apps](./building-apps/00-app-go.md) - The documentation in this section will guide you through the process of developing your dApp using the Cosmos SDK framework.
8-
* [Modules](./modules/README.md) - Information about the various modules available in the Cosmos SDK: Auth, Authz, Bank, Crisis, Distribution, Evidence, Feegrant, Governance, Mint, Params, Slashing, Staking, Upgrade, NFT, Consensus, Circuit, Genutil.
8+
* [Modules](./modules/README.md) - Information about the various modules available in the Cosmos SDK: Auth, Authz, Bank, Circuit, Consensus, Distribution, Epochs, Evidence, Feegrant, Governance, Group, Mint, NFT, Protocolpool, Slashing, Staking, Upgrade, Genutil.
99
* [Migrations](./migrations/01-intro.md) - See what has been updated in each release the process of the transition between versions.
1010
* [Packages](./packages/README.md) - Explore a curated collection of pre-built modules and functionalities, streamlining the development process.
1111
* [Tooling](./tooling/README.md) - A suite of utilities designed to enhance the development workflow, optimizing the efficiency of Cosmos SDK-based projects.

0 commit comments

Comments
 (0)