-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Docs update #4176
Docs update #4176
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4176 +/- ##
==========================================
+ Coverage 60% 60.01% +0.01%
==========================================
Files 212 212
Lines 15127 15127
==========================================
+ Hits 9077 9079 +2
+ Misses 5427 5425 -2
Partials 623 623 |
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #4176 +/- ##
==========================================
+ Coverage 60% 60.01% +0.01%
==========================================
Files 212 212
Lines 15127 15127
==========================================
+ Hits 9077 9079 +2
+ Misses 5427 5425 -2
Partials 623 623 |
Thanks @gamarin2! In order to avoid the conflict mess we had last time with v0.34.0 and until we have a single canonical git branch, this PR should be targeted towards |
Yep @alexanderbez, indicated it cf "Will open a PR back to develop once merged". I will cherry pick, but want to wait for reviews first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this PR has a couple of net new documents as well as typo fixes. It would be better if we could split those up in to separate PRs in the future. That being said, the general app explainer that is here is quite good. I think the upgrade guide needs a refactor.
docs/cosmos-hub/upgrade-node.md
Outdated
# Upgrade Your Node | ||
|
||
::: warning | ||
The detailed procedure to upgrade a mainnet node from `cosmoshub-1` to `cosmoshub-2` can be found [here](https://gist.github.com/alexanderbez/5e87886221eb304b9e85ad4b167c99c8). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is kinda incorrect. That is the procedure to generate the genesis.json
file for cosmoshub-2
from the cosmoshub-1
state-dump at block 500,000
. I don't think we need to link to those here.
@@ -0,0 +1,99 @@ | |||
# Upgrade Your Node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this guide needs a rethink and shouldn't block the rest of this PR. This should be a doc that describes the process for upgrading a network generically and explains each of the steps. This guide kinda jumps in at the mainnet upgrade and then has that content in less detail at the bottom of the doc.
docs/cosmos-hub/upgrade-node.md
Outdated
The first step is to remove your current genesis: | ||
|
||
```bash | ||
rm $HOME/.gaiad/config/addrbook.json $HOME/.gaiad/config/genesis.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think users will want to remove their addrbook?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh this should not be there, good catch
**Note: These commands need to be run on an online computer. It is more secure to perform them commands using a ledger device. For the offline procedure, click [here](#signing-transactions-from-an-offline-computer).** | ||
::: | ||
|
||
```bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should just point to the gaiacli.md
docs? The develop
branch has changed this to now:
$ gaiacli tx send [from_key_or_address] [to_address] [amount] [flags]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep it as what it is in mainnet, BUT I will update it when doing the cherry pick to develop (setting a reminder rn)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we kill the --from
flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah but not on v0.34.x yet, which is what the master docs reflect.
## Reset Data | ||
|
||
:::warning | ||
If the version <new_version> you are upgrading to is not breaking from the previous one, you should not reset the data. If it is not breaking, you can skip to [Restart](#restart) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the version <new_version> you are upgrading to is not breaking from the previous one, you should not reset the data. If it is not breaking, you can skip to [Restart](#restart) | |
If the new version you are upgrading to doesn't have any braking changes, you can skip to the [Restart](#restart) section. |
``` | ||
+ | ||
| | ||
| Transaction relayed from Tendermint | ||
| via DeliverTx | ||
| Transaction relayed from the full-node's Tendermint engine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated, but it'd be cool to have an image here instead
Co-Authored-By: gamarin2 <gautier@tendermint.com>
|
||
To restart your node, just type: | ||
|
||
```bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to add a link to the systemd
example thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are a few post-merge comments, may want to consider another PR for any corrections
|
||
- `CheckTx`: When a transaction is received by Tendermint Core, it is passed to the application to check if a few basic requirements are met. `CheckTx` is used to protect the mempool of full-nodes against spam. A special handler called the "Ante Handler" is used to execute a series of validation steps such as checking for sufficient fees and validating the signatures. If the check is valid, the transaction is added to the [mempool](https://tendermint.com/docs/spec/reactors/mempool/functionality.html#mempool-functionality) and relayed to peer nodes. Note that transactions are not processed (i.e. no modification of the state occurs) with `CheckTx` since they have not been included in a block yet. | ||
- `DeliverTx`: When a [valid block](https://tendermint.com/docs/spec/blockchain/blockchain.html#validation) is received by Tendermint Core, each transaction in the given block is passed to the application via `DeliverTx` to be processed. It is during this stage that the state transitions occur. The "Ante Handler" executes again along with the actual handlers for each message in the transaction. | ||
- `BeginBlock`/`EndBlock`: These messages are executed at the beginning and the end of each block, whether the block contains transaction or not. It is useful to trigger automatic execution of logic. Proceed with caution though, as computationally expensive loops could slow down your blockchain, or even freeze it if the loop is infinite. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should explain this concept in-terms of the state machine running as a single thread. that way I'm not sure we'd need to mention "or even freeze it .." which is kinda a funny sentence - that is implied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will add a note about single threading
|
||
Here are the most important messages of the ABCI: | ||
|
||
- `CheckTx`: When a transaction is received by Tendermint Core, it is passed to the application to check if a few basic requirements are met. `CheckTx` is used to protect the mempool of full-nodes against spam. A special handler called the "Ante Handler" is used to execute a series of validation steps such as checking for sufficient fees and validating the signatures. If the check is valid, the transaction is added to the [mempool](https://tendermint.com/docs/spec/reactors/mempool/functionality.html#mempool-functionality) and relayed to peer nodes. Note that transactions are not processed (i.e. no modification of the state occurs) with `CheckTx` since they have not been included in a block yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to discuss what happens when CheckTx fails (before or after the signature verification part)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just an intro, not the full CheckTx
explanation (which will be in another doc). We just want to give a general sense of what CheckTx
does at this point
|
||
The main part of a Cosmos SDK application is a blockchain daemon that is run by each node in the network locally. If less than one third of the *validator set* is byzantine (i.e. malicious), then each node should obtain the same result when querying the state at the same time. | ||
|
||
## ABCI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to expand this acronym here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, will update
| | | | | ||
| S +---------------->+ S' | | ||
| | apply(T) | | | ||
+--------+ +--------+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (and the next) diagram are maybe a bit superfluous here. I think an clearly written description of determinism as it relates the state machine (without assigning letters ex. T
or using diagrams) would be adequate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can touch on determinism, but I push back on the idea that the diagrams are superfluous. Remember that all this is intro material. We can assume no prior knowledge from people reading this, and we need to make it as gentle as possible.
A lot of people discovering the SDK come from the Ethereum community and may not even know what a state machine is. Or they may know it, but they may not be accustomed to thinking of a blockchain as a replicated, deterministic state-machine. What is obvious to us is NOT to most people getting started with the SDK.
We will have more advanced and rigorous docs later. The intro docs are high-level and must be as easy to understand as possible.
gaiad unsafe-reset-all | ||
``` | ||
|
||
Your node is now in a pristine state while keeping the original `priv_validator.json` and `config.toml`. If you had any sentry nodes or full nodes setup before, your node will still try to connect to them, but may fail if they haven't also been upgraded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is pristine the best word here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you suggest?
mv new_genesis.json genesis.json | ||
``` | ||
|
||
At this point, you might want to run a script to update the exported genesis into a genesis that is compatible with your new version. For example, the attributes of a the `Account` type changed, a script should query encoded account from the account store, unmarshall them, update their type, re-marhsall and re-store them. You can find an example of such script [here](https://github.com/cosmos/cosmos-sdk/blob/develop/contrib/export/v0.33.x-to-v0.34.0.py). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-marhsall
-> re-marshal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will update
Docs update:
Will open a PR back to develop once merged
Targeted PR against correct branch (see CONTRIBUTING.md)
Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
Wrote tests
Updated relevant documentation (
docs/
)Added a relevant changelog entry:
sdkch add [section] [stanza] [message]
rereviewed
Files changed
in the github PR explorerFor Admin Use: